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;
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;