From 8a075f7e6292be43c22c4fa9a4a53e078a5c136c Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Wed, 17 Jul 2013 12:54:59 +0000 Subject: [PATCH] - refactor --- src/mesh/gnunet-service-mesh.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 5cba49297..3b569e7a3 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -4334,26 +4334,20 @@ handle_mesh_poll (void *cls, const struct GNUNET_PeerIdentity *peer, } /* Is this a forward or backward ACK? */ - id = GNUNET_PEER_search(peer); + id = GNUNET_PEER_search (peer); pid = ntohl (msg->pid); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " PID %u\n", pid); if (t->next_hop == id) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " from FWD\n"); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " was %u\n", t->next_fc.last_pid_recv); fc = &t->next_fc; old = fc->last_pid_recv; - fc->last_pid_recv = pid; - tunnel_send_ack (t, GNUNET_MESSAGE_TYPE_MESH_POLL, GNUNET_NO); } else if (t->prev_hop == id) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " from BCK\n"); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " was %u\n", t->prev_fc.last_pid_recv); fc = &t->prev_fc; old = fc->last_pid_recv; - fc->last_pid_recv = pid; - tunnel_send_ack (t, GNUNET_MESSAGE_TYPE_MESH_POLL, GNUNET_YES); } else { @@ -4361,6 +4355,10 @@ handle_mesh_poll (void *cls, const struct GNUNET_PeerIdentity *peer, return GNUNET_OK; } + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " was %u\n", fc->last_pid_recv); + fc->last_pid_recv = pid; + tunnel_send_ack (t, GNUNET_MESSAGE_TYPE_MESH_POLL, t->prev_hop == id); + if (GNUNET_YES == t->reliable) fc->last_pid_recv = old; -- 2.25.1