Bug fix regarding MS_MSG_DIRECTORY_SCANNING_CANCEL 82/242982/3
authorhj kim <backto.kim@samsung.com>
Wed, 2 Sep 2020 07:30:03 +0000 (16:30 +0900)
committerhj kim <backto.kim@samsung.com>
Wed, 2 Sep 2020 08:00:27 +0000 (08:00 +0000)
Regarding the MS_MSG_DIRECTORY_SCANNING_CANCEL request from the client, the scanner doesn't need to send a response for this task,
because client gets the result for this request by checking from its own request list.

Change-Id: If46eb7f0825ce9f19e8ba09c7588ec39f5eb94f7

src/scanner-v2/media-scanner-extract-v2.c
src/scanner-v2/media-scanner-scan-v2.c
src/server/media-server-socket.c

index 284fc40..16d08da 100644 (file)
@@ -689,10 +689,6 @@ void msc_remove_folder_extract_request(ms_comm_msg_s *recv_msg)
                msg = g_async_queue_pop(folder_extract_queue);
                if ((strcmp(msg->msg, cancel_path) == 0) && (pid == msg->pid)) {
                        MS_DBG_WARN("Remove request. cancel path [%s]", cancel_path);
-                       if (msg->result) {
-                               msg->msg_type = MS_MSG_DIRECTORY_SCANNING_CANCEL;
-                               msc_send_result(MS_MEDIA_ERR_SCANNER_FORCE_STOP, msg);
-                       }
                        g_free(msg);
                } else {
                        g_async_queue_push(temp_extract_queue, msg);
index 65a71e4..72557c2 100644 (file)
@@ -1442,8 +1442,7 @@ void msc_remove_dir_scan_request(ms_comm_msg_s *recv_msg)
                        msg = g_async_queue_pop(scan_queue2);
                        MS_DBG_WARN("msg->msg[%.*s], msg->pid[%d]", MAX_MSG_SIZE, msg->msg, msg->pid);
                        if ((strcmp(msg->msg, cancel_path) == 0) && (pid == msg->pid)) {
-                               msg->msg_type = MS_MSG_DIRECTORY_SCANNING_CANCEL;
-                               msc_send_result(MS_MEDIA_ERR_SCANNER_FORCE_STOP, msg);
+                               MS_DBG_WARN("Remove request. cancel path [%s]", cancel_path);
                                g_free(msg);
                        } else {
                                g_async_queue_push(temp_scan_queue, msg);
index 108fbfa..94e70f3 100644 (file)
@@ -439,7 +439,6 @@ gboolean ms_receive_message_from_scanner(GIOChannel *src, GIOCondition condition
        switch (recv_msg.msg_type) {
        case MS_MSG_SCANNER_RESULT:
        case MS_MSG_SCANNER_BULK_RESULT:
-       case MS_MSG_DIRECTORY_SCANNING_CANCEL:
        case MS_MSG_EXTRACTOR_COMPLETE:
                MS_DBG_WARN("DB UPDATING IS DONE[%d]", recv_msg.msg_type);
                ms_req_num--;