Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
moved a line for comprehension
[simgrid.git] / examples / c / dht-pastry / dht-pastry.c
index 0e9c6dd23e376fc1cdf14a955e6c49344e7160f5..c6e5947b9189e46dbda6292e3986a998e7c5e323 100644 (file)
@@ -236,7 +236,8 @@ static void handle_message(node_t node, pastry_message_t message)
         err  = sg_comm_wait_for(comm, timeout);
         if (err == SG_ERROR_TIMEOUT) {
           XBT_DEBUG("Timeout expired when forwarding join to next %d", next);
-          message_free(message);
+          xbt_free(request);
+          break;
         }
         type = JOIN_REPLY;
       }
@@ -250,7 +251,7 @@ static void handle_message(node_t node, pastry_message_t message)
       err                = sg_comm_wait_for(comm, timeout);
       if (err == SG_ERROR_TIMEOUT) {
         XBT_DEBUG("Timeout expired when sending back the current node state to the joining node to %d", node->id);
-        message_free(message);
+        message_free(request);
       }
       break;
     /* Join reply from all the node touched by the join  */
@@ -313,6 +314,7 @@ static void handle_message(node_t node, pastry_message_t message)
             if (err == SG_ERROR_TIMEOUT) {
               XBT_DEBUG("Timeout expired when sending update to %d", j);
               message_free(request);
+              break;
             }
           }
         }