*bytes_write += nb;
retry_cnt = 0;
}
+
+ if (left != 0) {
+ _LOGE("error fd %d: retry_cnt %d", fd, retry_cnt);
+ return MESSAGE_PORT_ERROR_IO_ERROR;
+ }
+
return MESSAGE_PORT_ERROR_NONE;
}
*bytes_read += nb;
retry_cnt = 0;
}
+
+ if (left != 0) {
+ _LOGE("error fd %d: retry_cnt %d", fd, retry_cnt);
+ return MESSAGE_PORT_ERROR_IO_ERROR;
+ }
+
return MESSAGE_PORT_ERROR_NONE;
}
message_port_local_port_info_s *local_port_info;
bundle *kb = NULL;
GError *error = NULL;
+ bool ret = TRUE;
mi = (message_port_callback_info_s *)data;
if (mi == NULL) {
}
kb = bundle_decode(pkt->data, pkt->data_len);
+ if (!kb) {
+ _LOGE("Invalid argument : message");
+ __callback_info_free_by_info(mi);
+ ret = FALSE;
+ goto out;
+ }
+
if (pkt->is_bidirection)
local_port_info->callback(mi->local_id, mi->remote_app_id,
pkt->remote_port_name, pkt->is_trusted, kb, local_port_info->user_data);
-
else
local_port_info->callback(mi->local_id, mi->remote_app_id,
NULL, pkt->is_trusted, kb, local_port_info->user_data);
bundle_free(kb);
+
+out:
if (pkt) {
if (pkt->remote_port_name)
free(pkt->remote_port_name);
free(pkt);
}
- return TRUE;
+ return ret;
}
static bool __receive_message(GVariant *parameters, GDBusMethodInvocation *invocation)