Fix the bug for the OPP server progress callback's file name 59/197659/1 accepted/tizen/unified/20190116.060558 submit/tizen/20190115.054612
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 15 Jan 2019 05:02:46 +0000 (14:02 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 15 Jan 2019 05:02:46 +0000 (14:02 +0900)
Change-Id: I3113a1e669304c559580ae0962b67f2ae67f4991
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-service-adaptation/services/obex/bt-service-obex-server.c

index 56c6eab..baa9690 100644 (file)
@@ -1186,6 +1186,7 @@ int _bt_obex_server_accept_authorize(const char *filename, gboolean is_native)
 {
        char file_path[BT_FILE_PATH_MAX] = { 0 };
        bt_server_info_t *server_info;
+       bt_auth_info_t *new_auth_info;
 
        BT_CHECK_PARAMETER(filename, return);
 
@@ -1209,10 +1210,20 @@ int _bt_obex_server_accept_authorize(const char *filename, gboolean is_native)
 
        g_dbus_method_invocation_return_value(agent_info.auth_info->reply_context,
                g_variant_new("(s)", &file_path));
-       agent_info.auth_info->reply_context = NULL;
-       agent_info.auth_info->file_path = g_strdup(file_path);
-       g_free(agent_info.auth_info->filename);
-       agent_info.auth_info->filename = g_strdup(filename);
+
+       new_auth_info = g_malloc0(sizeof(bt_auth_info_t));
+
+       new_auth_info->file_size = agent_info.auth_info->file_size;
+       new_auth_info->file_path = g_strdup(file_path);
+       new_auth_info->filename = g_strdup(filename);
+       new_auth_info->device_name = g_strdup(agent_info.auth_info->device_name);
+       new_auth_info->transfer_path = g_strdup(agent_info.auth_info->transfer_path);
+       new_auth_info->address = g_strdup(agent_info.auth_info->address);
+       memcpy(new_auth_info->contact_auth_info, agent_info.auth_info->contact_auth_info, 5);
+
+       __bt_free_auth_info(agent_info.auth_info);
+
+       agent_info.auth_info = new_auth_info;
 
        return BLUETOOTH_ERROR_NONE;
 }