Modify the response condition for TV profile 63/215863/3 accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix accepted/tizen/5.5/unified/20191031.021642 accepted/tizen/5.5/unified/mobile/hotfix/20201027.083829 accepted/tizen/unified/20191018.042643 submit/tizen/20191017.070644 submit/tizen_5.5/20191031.000004 submit/tizen_5.5_mobile_hotfix/20201026.185103 tizen_5.5.m2_release
authorchengyj1985 <yujie.cheng@samsung.com>
Thu, 17 Oct 2019 03:48:17 +0000 (11:48 +0800)
committerchengyj1985 <yujie.cheng@samsung.com>
Thu, 17 Oct 2019 06:33:29 +0000 (14:33 +0800)
1. Send partial message to all requester
2. Don't remove owner if MS_MSG_SCANNER_COMPLETE

Change-Id: I15761c449fc1275e8e167aec32f9d58cde01a119

src/server/media-server-socket.c

index cf91705..f914bb7 100644 (file)
@@ -142,14 +142,24 @@ static int __ms_send_result_to_client(int pid, ms_comm_msg_s *recv_msg)
        MS_DBG_RETVM_IF(!MS_STRING_VALID(recv_msg->msg), MS_MEDIA_ERR_INVALID_PARAMETER, "msg is NULL");
        MS_DBG_RETVM_IF(!owner_list, MS_MEDIA_ERR_INTERNAL, "owner_list is NULL");
 
-       for (i = 0; i < owner_list->len; i++) {
-               data = g_array_index(owner_list, ms_req_owner_data*, i);
-               if (data->pid == pid && strcmp(data->req_path, recv_msg->msg) == 0) {
-                       ms_ipc_send_msg_to_client_tcp(data->client_sockfd, recv_msg, NULL);
-                       if (recv_msg->msg_type != MS_MSG_SCANNER_PARTIAL)
-                               g_array_remove_index(owner_list, i);
-
-                       break;
+       if (recv_msg->msg_type == MS_MSG_SCANNER_PARTIAL) {
+               for (i = 0; i < owner_list->len; i++) {
+                       data = g_array_index(owner_list, ms_req_owner_data*, i);
+                       if (strcmp(data->req_path, recv_msg->msg) == 0) {
+                               MS_DBG_SERR("PARTIAL message:pid %d,path %s", data->pid, data->req_path);
+                               ms_ipc_send_msg_to_client_tcp(data->client_sockfd, recv_msg, NULL);
+                       }
+               }
+       } else {
+               for (i = 0; i < owner_list->len; i++) {
+                       data = g_array_index(owner_list, ms_req_owner_data*, i);
+                       if (data->pid == pid && strcmp(data->req_path, recv_msg->msg) == 0) {
+                               ms_ipc_send_msg_to_client_tcp(data->client_sockfd, recv_msg, NULL);
+                               if (recv_msg->msg_type != MS_MSG_SCANNER_COMPLETE)
+                                       g_array_remove_index(owner_list, i);
+
+                               break;
+                       }
                }
        }