From a1521b52f7f3a4d9e21afae071aa83746324e82d Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Tue, 15 Jan 2019 14:02:46 +0900 Subject: [PATCH] Fix the bug for the OPP server progress callback's file name Change-Id: I3113a1e669304c559580ae0962b67f2ae67f4991 Signed-off-by: DoHyun Pyun --- .../services/obex/bt-service-obex-server.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/bt-service-adaptation/services/obex/bt-service-obex-server.c b/bt-service-adaptation/services/obex/bt-service-obex-server.c index 56c6eab..baa9690 100644 --- a/bt-service-adaptation/services/obex/bt-service-obex-server.c +++ b/bt-service-adaptation/services/obex/bt-service-obex-server.c @@ -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; } -- 2.7.4