From: Bart Polot Date: Tue, 9 Jul 2013 23:44:37 +0000 (+0000) Subject: - fix unreliable expected traffic X-Git-Tag: initial-import-from-subversion-38251~8438 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0388af8e69d9422ec7e12c14eedba6ad0529a3a7;p=oweals%2Fgnunet.git - fix unreliable expected traffic --- diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index c61178e0b..74bfdf363 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -2122,6 +2122,10 @@ tunnel_send_fwd_ack (struct MeshTunnel *t, uint16_t type) /* Ok, ACK might be necessary, what PID to ACK? */ ack = t->prev_fc.last_pid_recv + t->queue_max - t->next_fc.queue_n; + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " FWD ACK %u\n", ack); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + " last %u, qmax %u, q %u\n", + t->prev_fc.last_pid_recv, t->queue_max, t->next_fc.queue_n); if (ack == t->prev_fc.last_ack_sent && GNUNET_NO == t->force_ack) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Not sending FWD ACK, not needed\n"); @@ -3655,7 +3659,11 @@ 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 (pid == t->prev_fc.last_pid_recv + 1) + if ( (GNUNET_NO == t->reliable && + GMC_is_pid_bigger(pid, t->prev_fc.last_pid_recv)) + || + (GNUNET_YES == t->reliable && + pid == t->prev_fc.last_pid_recv + 1) ) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " pid %u not seen yet, forwarding\n", pid); @@ -3757,7 +3765,11 @@ handle_mesh_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " it's for us! sending to clients...\n"); GNUNET_STATISTICS_update (stats, "# to origin received", 1, GNUNET_NO); - if (pid == t->next_fc.last_pid_recv + 1) // FIXME use "futures" as accepting + if ( (GNUNET_NO == t->reliable && + GMC_is_pid_bigger(pid, t->next_fc.last_pid_recv)) + || + (GNUNET_YES == t->reliable && + pid == t->next_fc.last_pid_recv + 1) ) // FIXME use "futures" as accepting { t->next_fc.last_pid_recv = pid; tunnel_send_client_to_orig (t, msg);