aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-07-13 03:16:11 +0000
committerBart Polot <bart@net.in.tum.de>2013-07-13 03:16:11 +0000
commita579667087600fd9d5509118d0febdc310af4974 (patch)
treeb411758b2bbc9d8403983751b327f52e63ab1038 /src/mesh/gnunet-service-mesh.c
parentbf6dcf2d7ce2f765ba21d0f79fbee17bb25aee7c (diff)
downloadgnunet-a579667087600fd9d5509118d0febdc310af4974.tar.gz
gnunet-a579667087600fd9d5509118d0febdc310af4974.zip
- off by one
Diffstat (limited to 'src/mesh/gnunet-service-mesh.c')
-rw-r--r--src/mesh/gnunet-service-mesh.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index fc21436f7..d861694d1 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -338,7 +338,7 @@ struct MeshTunnelReliability
338 unsigned int n_sent; 338 unsigned int n_sent;
339 339
340 /** 340 /**
341 * Next MID to use 341 * Next MID to use.
342 */ 342 */
343 uint64_t mid_sent; 343 uint64_t mid_sent;
344 344
@@ -348,6 +348,9 @@ struct MeshTunnelReliability
348 struct MeshReliableMessage *head_recv; 348 struct MeshReliableMessage *head_recv;
349 struct MeshReliableMessage *tail_recv; 349 struct MeshReliableMessage *tail_recv;
350 350
351 /**
352 * Next MID expected.
353 */
351 uint64_t mid_recv; 354 uint64_t mid_recv;
352 355
353 /** 356 /**
@@ -2065,7 +2068,7 @@ tunnel_send_fwd_data_ack (struct MeshTunnel *t)
2065 msg.header.size = htons (sizeof (msg)); 2068 msg.header.size = htons (sizeof (msg));
2066 msg.tid = htonl (t->id.tid); 2069 msg.tid = htonl (t->id.tid);
2067 GNUNET_PEER_resolve (t->id.oid, &msg.oid); 2070 GNUNET_PEER_resolve (t->id.oid, &msg.oid);
2068 msg.mid = GNUNET_htonll (t->bck_rel->mid_recv); 2071 msg.mid = GNUNET_htonll (t->bck_rel->mid_recv - 1);
2069 msg.futures = 0; // FIXME set bits of other newer messages received 2072 msg.futures = 0; // FIXME set bits of other newer messages received
2070 2073
2071 send_prebuilt_message (&msg.header, t->prev_hop, t); 2074 send_prebuilt_message (&msg.header, t->prev_hop, t);
@@ -2086,7 +2089,7 @@ tunnel_send_bck_data_ack (struct MeshTunnel *t)
2086 msg.header.size = htons (sizeof (msg)); 2089 msg.header.size = htons (sizeof (msg));
2087 msg.tid = htonl (t->id.tid); 2090 msg.tid = htonl (t->id.tid);
2088 GNUNET_PEER_resolve (t->id.oid, &msg.oid); 2091 GNUNET_PEER_resolve (t->id.oid, &msg.oid);
2089 msg.mid = GNUNET_htonll (t->fwd_rel->mid_recv); 2092 msg.mid = GNUNET_htonll (t->fwd_rel->mid_recv - 1);
2090 msg.futures = 0; // FIXME set bits of other newer messages received 2093 msg.futures = 0; // FIXME set bits of other newer messages received
2091 2094
2092 send_prebuilt_message (&msg.header, t->next_hop, t); 2095 send_prebuilt_message (&msg.header, t->next_hop, t);
@@ -2136,7 +2139,7 @@ tunnel_send_fwd_ack (struct MeshTunnel *t, uint16_t type)
2136 } 2139 }
2137 2140
2138 /* Check if we need to transmit the ACK */ 2141 /* Check if we need to transmit the ACK */
2139 if (NULL == t->owner && 2142 if (0 && NULL == t->owner &&
2140 t->queue_max > t->next_fc.queue_n * 4 && 2143 t->queue_max > t->next_fc.queue_n * 4 &&
2141 GMC_is_pid_bigger(t->prev_fc.last_ack_sent, t->prev_fc.last_pid_recv) && 2144 GMC_is_pid_bigger(t->prev_fc.last_ack_sent, t->prev_fc.last_pid_recv) &&
2142 GNUNET_NO == t->force_ack) 2145 GNUNET_NO == t->force_ack)
@@ -3781,8 +3784,9 @@ handle_mesh_unicast (void *cls, const struct GNUNET_PeerIdentity *peer,
3781 { 3784 {
3782// GNUNET_STATISTICS_update (stats, "# duplicate PID", 1, GNUNET_NO); 3785// GNUNET_STATISTICS_update (stats, "# duplicate PID", 1, GNUNET_NO);
3783 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 3786 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
3784 " Pid %u not expected (%u), dropping!\n", 3787 " Pid %u (%llu) not expected (%u / %llu), dropping!\n",
3785 pid, t->prev_fc.last_pid_recv + 1); 3788 pid, GNUNET_ntohll(msg->mid),
3789 t->prev_fc.last_pid_recv + 1, t->bck_rel->mid_recv);
3786 } 3790 }
3787 tunnel_send_fwd_ack (t, GNUNET_MESSAGE_TYPE_MESH_UNICAST); 3791 tunnel_send_fwd_ack (t, GNUNET_MESSAGE_TYPE_MESH_UNICAST);
3788 return GNUNET_OK; 3792 return GNUNET_OK;