if (kind == e_gras_msg_kind_rpcerror) {
/* error on remote host, carfull, payload is an exception */
gras_datadesc_send(sock, gras_datadesc_by_name("ex_t"),payload);
- } else {
+ } else if (kind == e_gras_msg_kind_rpcanswer) {
+ if (msgtype->answer_type)
+ gras_datadesc_send(sock, msgtype->answer_type, payload);
+ }else {
/* regular message */
if (msgtype->ctn_type)
gras_datadesc_send(sock, msgtype->ctn_type, payload);
msg->payl=xbt_malloc(msg->payl_size);
gras_datadesc_recv(sock, gras_datadesc_by_name("ex_t"), r_arch, msg->payl);
+ } else if (msg->kind == e_gras_msg_kind_rpcanswer) {
+ /* answer to RPC */
+ if (msg->type->answer_type) {
+ msg->payl_size=gras_datadesc_size(msg->type->answer_type);
+ xbt_assert2(msg->payl_size > 0,
+ "%s %s",
+ "Dynamic array as payload is forbided for now (FIXME?).",
+ "Reference to dynamic array is allowed.");
+ msg->payl = xbt_malloc(msg->payl_size);
+ gras_datadesc_recv(sock, msg->type->answer_type, r_arch, msg->payl);
+ } else {
+ msg->payl = NULL;
+ msg->payl_size = 0;
+ }
} else {
/* regular message */
if (msg->type->ctn_type) {