Avoid infinite DBus timeout when tethering enable fails 94/181394/3
authorMilind Murhekar <m.murhekar@samsung.com>
Wed, 13 Jun 2018 06:42:32 +0000 (12:12 +0530)
committerMilind Murhekar <m.murhekar@samsung.com>
Wed, 13 Jun 2018 06:49:26 +0000 (12:19 +0530)
Description: This patch avoids the infinite Dbus timeout
if API fails.

Change-Id: I0008808412f9c65331fd512c1576ad0473edd218
Signed-off-by: Milind Murhekar <m.murhekar@samsung.com>
src/tethering.c

index 9afcb84..e4f4007 100755 (executable)
@@ -1574,6 +1574,7 @@ API int tethering_enable(tethering_h tethering, tethering_type_e type)
        if (__check_precondition(type) == FALSE) {
                //LCOV_EXCL_START
                INFO("-\n");
+               g_dbus_proxy_set_default_timeout(proxy, DBUS_TIMEOUT_USE_DEFAULT);
                return TETHERING_ERROR_OPERATION_FAILED;
                //LCOV_EXCL_STOP
        }
@@ -1629,6 +1630,7 @@ API int tethering_enable(tethering_h tethering, tethering_type_e type)
                ret = __prepare_wifi_settings(tethering, &p2p_set);
                if (ret != TETHERING_ERROR_NONE) {
                        ERR("p2p settings initialization failed\n");
+                       g_dbus_proxy_set_default_timeout(proxy, DBUS_TIMEOUT_USE_DEFAULT);
                        DBG("-\n");
                        return TETHERING_ERROR_OPERATION_FAILED;
                }
@@ -1646,6 +1648,7 @@ API int tethering_enable(tethering_h tethering, tethering_type_e type)
                ret = __prepare_wifi_settings(tethering, &set);
                if (ret != TETHERING_ERROR_NONE) {
                        ERR("softap settings initialization failed\n");
+                       g_dbus_proxy_set_default_timeout(proxy, DBUS_TIMEOUT_USE_DEFAULT);
                        return TETHERING_ERROR_OPERATION_FAILED;
                }
 
@@ -1715,6 +1718,7 @@ API int tethering_ipv6_enable(tethering_h tethering, tethering_type_e type)
        if (__check_precondition(type) == FALSE) {
                //LCOV_EXCL_START
                DBG("-\n");
+               g_dbus_proxy_set_default_timeout(proxy, DBUS_TIMEOUT_USE_DEFAULT);
                return TETHERING_ERROR_OPERATION_FAILED;
                //LCOV_EXCL_STOP
        }
@@ -1738,6 +1742,7 @@ API int tethering_ipv6_enable(tethering_h tethering, tethering_type_e type)
                if (ret != TETHERING_ERROR_NONE) {
                        ERR("softap settings initialization failed\n");
                        DBG("-\n");
+                       g_dbus_proxy_set_default_timeout(proxy, DBUS_TIMEOUT_USE_DEFAULT);
                        return TETHERING_ERROR_OPERATION_FAILED;
                }
                g_dbus_connection_signal_unsubscribe(connection,