Increase the session timeout value
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-opp-client.c
index 152a556..3e83f72 100644 (file)
@@ -269,7 +269,7 @@ gboolean _bt_obex_client_started(const char *transfer_path)
        }
 
        /* Get the session bus. */
-       g_conn = _bt_get_session_gconn();
+       g_conn = _bt_gdbus_get_session_gconn();
        retv_if(g_conn == NULL, FALSE);
        properties_proxy = g_dbus_proxy_new_sync(g_conn, G_DBUS_PROXY_FLAGS_NONE,
                                                NULL, BT_OBEXD_DBUS_NAME,
@@ -320,9 +320,8 @@ static void __bt_free_sending_data(gpointer data)
 
        ret_if(info == NULL);
 
-       for (i = 0; i < info->file_count; i++) {
+       for (i = 0; i < info->file_count; i++)
                g_free(info->file_path[i]);
-       }
 
        _bt_delete_request_id(info->request_id);
 
@@ -340,9 +339,13 @@ static void __bt_sending_release_cb(GDBusProxy *proxy,
        GError *error = NULL;
        int result = BLUETOOTH_ERROR_NONE;
        GVariant *param = NULL;
-       g_dbus_proxy_call_finish(proxy, res, &error);
+       GVariant *reply = NULL;
+
+       reply = g_dbus_proxy_call_finish(proxy, res, &error);
        if (proxy)
                g_object_unref(proxy);
+       if (reply)
+               g_variant_unref(reply);
 
        if (error) {
                BT_ERR("%s", error->message);
@@ -404,7 +407,7 @@ static int _bt_remove_session()
        GDBusProxy *session_proxy;
        GError *err = NULL;
 
-       g_conn = _bt_get_session_gconn();
+       g_conn = _bt_gdbus_get_session_gconn();
        retv_if(g_conn == NULL, BLUETOOTH_ERROR_INTERNAL);
        retv_if(sending_info->session_path == NULL, BLUETOOTH_ERROR_INVALID_PARAM);
 
@@ -542,13 +545,12 @@ static void __bt_send_file_cb(GDBusProxy *proxy,
                GVariant *val;
                gsize len = 0;
                while (g_variant_iter_loop(iter, "{sv}", &key, &val)) {
-                       if (g_strcmp0(key, "Name") == 0) {
+                       if (g_strcmp0(key, "Name") == 0)
                                transfer_name = g_variant_dup_string(val, &len);
-                       } else if (g_strcmp0(key, "Filename") == 0) {
+                       else if (g_strcmp0(key, "Filename") == 0)
                                file_name = g_variant_dup_string(val, &len);
-                       } else if (g_strcmp0(key, "Size") == 0) {
+                       else if (g_strcmp0(key, "Size") == 0)
                                size = g_variant_get_uint64(val);
-                       }
                }
                g_variant_iter_free(iter);
        }
@@ -579,7 +581,7 @@ void _bt_sending_files(void)
                return;
        if (file_offset < sending_info->file_count) {
                /* Get the session bus. */
-               g_conn = _bt_get_session_gconn();
+               g_conn = _bt_gdbus_get_session_gconn();
                ret_if(g_conn == NULL);
 
                client_proxy = g_dbus_proxy_new_sync(g_conn, G_DBUS_PROXY_FLAGS_NONE,
@@ -595,11 +597,11 @@ void _bt_sending_files(void)
                                /* For IOPT compliance, change "text/x-iMelody" to "audio/imelody"
                                 * because few devices(multimedia players) reject the OPP put for text objects
                                 * since they support only multimedia files exchange */
-                               if(!strcasecmp(mime_type, "text/x-iMelody")) {
+                               if (!strcasecmp(mime_type, "text/x-iMelody")) {
                                        strncpy(mime_type, "audio/imelody", BT_MIME_TYPE_MAX_LEN);
                                        BT_DBG("over writing mime type to  = %s", mime_type);
                                }
-                               if(!strcasecmp(mime_type, "text/vcard")) {
+                               if (!strcasecmp(mime_type, "text/vcard")) {
                                        strncpy(mime_type, "text/x-vcard", BT_MIME_TYPE_MAX_LEN);
                                        BT_DBG("over writing mime type to  = %s", mime_type);
                                }
@@ -619,7 +621,7 @@ void _bt_sending_files(void)
                        return;
                }
 
-       }else{
+       } else {
                file_offset = 0;
                __bt_sending_release();
        }
@@ -716,7 +718,7 @@ static int __bt_opp_client_start_sending(int request_id, char *address,
        BT_CHECK_PARAMETER(file_name_array, return);
 
        /* Get the session bus. */
-       g_conn = _bt_get_session_gconn();
+       g_conn = _bt_gdbus_get_session_gconn();
        retv_if(g_conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        client_proxy =  g_dbus_proxy_new_sync(g_conn, G_DBUS_PROXY_FLAGS_NONE,