Adjust position of exception handling 19/95819/1 accepted/tizen/3.0/common/20161114.081054 accepted/tizen/3.0/ivi/20161110.015027 accepted/tizen/3.0/mobile/20161110.014932 accepted/tizen/3.0/tv/20161110.014951 accepted/tizen/3.0/wearable/20161110.015006 accepted/tizen/common/20161107.072159 accepted/tizen/ivi/20161108.000751 accepted/tizen/mobile/20161108.000657 accepted/tizen/tv/20161108.000711 accepted/tizen/wearable/20161108.000731 submit/tizen/20161107.015116 submit/tizen_3.0/20161107.015011 submit/tizen_3.0_common/20161110.084657
authorjusung son <jusung07.son@samsung.com>
Mon, 7 Nov 2016 01:13:46 +0000 (10:13 +0900)
committerjusung son <jusung07.son@samsung.com>
Mon, 7 Nov 2016 01:13:46 +0000 (10:13 +0900)
Change-Id: I4d8a30e7235a5b530980dada2de149aff0c08d45
Signed-off-by: jusung son <jusung07.son@samsung.com>
src/message-port.c

index 17c49433ee8e8f3cb9c727a7909597fb6651e6af..523027ade23b6c1f2c548682b9c1c1ab2b424d80 100755 (executable)
@@ -1366,6 +1366,19 @@ int __message_port_send_async(int sockfd, bundle *kb, const char *local_port,
        unsigned int nb;
        bundle_raw *kb_data = NULL;
 
+       bundle_encode(kb, &kb_data, &data_len);
+       if (kb_data == NULL) {
+               _LOGE("bundle encode fail");
+               ret = MESSAGEPORT_ERROR_IO_ERROR;
+               goto out;
+       }
+
+       if (data_len > MAX_MESSAGE_SIZE) {
+               _LOGE("bigger than max size\n");
+               ret = MESSAGEPORT_ERROR_MAX_EXCEEDED;
+               goto out;
+       }
+
        if (local_port != NULL)
                local_port_len = strlen(local_port) + 1;
 
@@ -1384,19 +1397,6 @@ int __message_port_send_async(int sockfd, bundle *kb, const char *local_port,
                return MESSAGEPORT_ERROR_IO_ERROR;
        }
 
-       bundle_encode(kb, &kb_data, &data_len);
-       if (kb_data == NULL) {
-               _LOGE("bundle encode fail");
-               ret = MESSAGEPORT_ERROR_IO_ERROR;
-               goto out;
-       }
-
-       if (data_len > MAX_MESSAGE_SIZE) {
-               _LOGE("bigger than max size\n");
-               ret = MESSAGEPORT_ERROR_MAX_EXCEEDED;
-               goto out;
-       }
-
        if (__write_string_to_socket(sockfd, (void *)kb_data, data_len) != MESSAGEPORT_ERROR_NONE) {
                _LOGE("write kb_data fail");
                ret = MESSAGEPORT_ERROR_IO_ERROR;