summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2017-09-08 18:57:21 +0530
committerNiraj Kumar Goit <niraj.g@samsung.com>2017-09-11 09:10:55 +0530
commit98145137772b04ce4e8ca140ee8ac217e7064933 (patch)
tree98ab4bba25cf736e6436f80d8bdb4bfc7ca74f22
parent4aa5c133cfdb1cd96fc3b661ba15ffff7c2b90ec (diff)
downloadconnman-98145137772b04ce4e8ca140ee8ac217e7064933.tar.gz
connman-98145137772b04ce4e8ca140ee8ac217e7064933.tar.bz2
connman-98145137772b04ce4e8ca140ee8ac217e7064933.zip
Send Error code only to requesting application.
Description: If an application request for wifi scan and it gets failed, then send error code only to the requesting application. Change-Id: I90bc3b0af68e9d3ff5c2e4709f5788c1f107a854 Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
-rwxr-xr-xsrc/technology.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/technology.c b/src/technology.c
index 94b99eab..a8da19b2 100755
--- a/src/technology.c
+++ b/src/technology.c
@@ -1179,18 +1179,27 @@ static DBusMessage *scan(DBusConnection *conn, DBusMessage *msg, void *data)
dbus_message_get_sender(msg));
dbus_message_ref(msg);
+#if !defined TIZEN_EXT
technology->scan_pending =
g_slist_prepend(technology->scan_pending, msg);
+#endif
err = __connman_device_request_scan(technology->type);
+#if defined TIZEN_EXT
+ if (err < 0)
+ return __connman_error_failed(msg, -err);
+#else
if (err < 0)
reply_scan_pending(technology, err);
+#endif
#if defined TIZEN_EXT
if (err == 0) {
g_scan_type = CONNMAN_SCAN_TYPE_FULL_CHANNEL;
DBG("g_scan_type %d", g_scan_type);
}
+ technology->scan_pending =
+ g_slist_prepend(technology->scan_pending, msg);
#endif
return NULL;
}
@@ -1256,12 +1265,10 @@ static DBusMessage *specific_scan(DBusConnection *conn, DBusMessage *msg, void *
}
dbus_message_ref(msg);
- technology->scan_pending =
- g_slist_prepend(technology->scan_pending, msg);
err = __connman_device_request_specific_scan(technology->type, scan_type, specific_scan_list);
if (err < 0)
- reply_scan_pending(technology, err);
+ return __connman_error_failed(msg, -err);
if (err == 0) {
guint list_size = g_slist_length(specific_scan_list);
@@ -1271,6 +1278,8 @@ static DBusMessage *specific_scan(DBusConnection *conn, DBusMessage *msg, void *
g_scan_type = CONNMAN_SCAN_TYPE_MULTI_AP;
DBG("list_size %u g_scan_type %d", list_size, g_scan_type);
}
+ technology->scan_pending =
+ g_slist_prepend(technology->scan_pending, msg);
if (scan_type == 1) {
g_slist_free_full(specific_scan_list, g_free);