opensubscriber
   Find in this group all groups
 
Unknown more information…

g : gnunet-svn@gnu.org 18 August 2012 • 9:12PM -0400

[GNUnet-SVN] r23303 - gnunet/src/mesh
by gnunet

REPLY TO AUTHOR
 
REPLY TO GROUP




Author: bartpolot
Date: 2012-08-18 15:12:14 +0200 (Sat, 18 Aug 2012)
New Revision: 23303

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
Log:
- fixes, eliminate malformed data assert

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c 2012-08-18 12:47:42 UTC (rev 23302)
+++ gnunet/src/mesh/gnunet-service-mesh.c 2012-08-18 13:12:14 UTC (rev 23303)
@@ -6886,7 +6886,8 @@
     GNUNET_break (0);
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                 "To Origin PID, expected %u, got %u\n",
-                clinfo->bck_pid + 1, ntohl (data_msg->pid));
+                clinfo->bck_pid + 1,
+                ntohl (data_msg->pid));
     GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
     return;
   }
@@ -6894,6 +6895,7 @@
   /* Ok, everything is correct, send the message
    * (pretend we got it from a mesh peer)
    */
+  clinfo->bck_pid++;
   {
     char buf[ntohs (message->size)] GNUNET_ALIGN;
     struct GNUNET_MESH_ToOrigin *copy;
@@ -6904,7 +6906,16 @@
     GNUNET_PEER_resolve (t->id.oid, ©->oid);
     copy->tid = htonl (t->id.tid);
     copy->ttl = htonl (default_ttl);
-    GNUNET_assert (ntohl (copy->pid) == (t->bck_pid + 1));
+    if (ntohl (copy->pid) != (t->bck_pid + 1))
+    {
+      GNUNET_break (0);
+      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                  "To Origin PID, expected %u, got %u\n",
+                  t->bck_pid + 1,
+                  ntohl (copy->pid));
+      return;
+    }
+    t->bck_pid++;
     copy->sender = my_full_id;
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "  calling generic handler...\n");


_______________________________________________
GNUnet-SVN mailing list
GNUnet-SVN@gnu....
https://lists.gnu.org/mailman/listinfo/gnunet-svn

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

opensubscriber is not affiliated with the authors of this message nor responsible for its content.