- separate hop and end ACK at destination
authorBart Polot <bart@net.in.tum.de>
Sat, 13 Jul 2013 03:39:04 +0000 (03:39 +0000)
committerBart Polot <bart@net.in.tum.de>
Sat, 13 Jul 2013 03:39:04 +0000 (03:39 +0000)
src/mesh/gnunet-service-mesh.c

index d861694d117b6a34c1fb168f446b3953686d5ab3..5ecbc5f9b474074669f4d4741111e9d690a3cb0c 100644 (file)
@@ -3766,27 +3766,28 @@ handle_mesh_unicast (void *cls, const struct GNUNET_PeerIdentity *peer,
                 "  it's for us! sending to clients...\n");
     GNUNET_STATISTICS_update (stats, "# unicast received", 1, GNUNET_NO);
 //     if (GMC_is_pid_bigger(pid, t->prev_fc.last_pid_recv)) FIXME use
-    if (GMC_is_pid_bigger (pid, t->prev_fc.last_pid_recv)
-        &&
-          (GNUNET_NO == t->reliable ||
-           GNUNET_ntohll (msg->mid) == t->bck_rel->mid_recv) )
+    if (GMC_is_pid_bigger (pid, t->prev_fc.last_pid_recv))
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  " pid %u not seen yet, forwarding\n", pid);
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "!!! RECV %llu\n", GNUNET_ntohll(msg->mid));
+                  " pid %u not seen yet\n", pid);
       t->prev_fc.last_pid_recv = pid;
-      if (GNUNET_YES == t->reliable)
-        t->bck_rel->mid_recv++;
-      tunnel_send_client_ucast (t, msg);
+
+      if (GNUNET_NO == t->reliable ||
+          GNUNET_ntohll (msg->mid) == t->bck_rel->mid_recv)
+      {
+        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                    "!!! RECV %llu\n", GNUNET_ntohll(msg->mid));
+        if (GNUNET_YES == t->reliable)
+          t->bck_rel->mid_recv++;
+        tunnel_send_client_ucast (t, msg);
+      }
     }
     else
     {
 //       GNUNET_STATISTICS_update (stats, "# duplicate PID", 1, GNUNET_NO);
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  " Pid %u (%llu) not expected (%u / %llu), dropping!\n",
-                  pid, GNUNET_ntohll(msg->mid),
-                  t->prev_fc.last_pid_recv + 1, t->bck_rel->mid_recv);
+                  " Pid %u not expected (%u), dropping!\n",
+                  pid, t->prev_fc.last_pid_recv + 1);
     }
     tunnel_send_fwd_ack (t, GNUNET_MESSAGE_TYPE_MESH_UNICAST);
     return GNUNET_OK;