Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Deal properly with assymetric RPCs
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 9 Jul 2006 09:11:48 +0000 (09:11 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 9 Jul 2006 09:11:48 +0000 (09:11 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2507 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/gras/Msg/rl_msg.c

index fecc8cb..a4c4e16 100644 (file)
@@ -149,6 +149,20 @@ gras_msg_recv(gras_socket_t    sock,
     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) {