summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjusung son <jusung07.son@samsung.com>2016-11-07 10:13:46 +0900
committerjusung son <jusung07.son@samsung.com>2016-11-07 10:13:46 +0900
commit0c406c420f694edb4d2b6000bbc97cc11f11198d (patch)
tree4f68d80e8562fa033f906d67867a596deb547b4e
parenta332cb9382931276a85605442fd33b4d7ec3c2c5 (diff)
downloadmessage-port-0c406c420f694edb4d2b6000bbc97cc11f11198d.tar.gz
message-port-0c406c420f694edb4d2b6000bbc97cc11f11198d.tar.bz2
message-port-0c406c420f694edb4d2b6000bbc97cc11f11198d.zip
Change-Id: I4d8a30e7235a5b530980dada2de149aff0c08d45 Signed-off-by: jusung son <jusung07.son@samsung.com>
-rwxr-xr-xsrc/message-port.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/message-port.c b/src/message-port.c
index 17c4943..523027a 100755
--- a/src/message-port.c
+++ b/src/message-port.c
@@ -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;