diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-08-22 18:44:55 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-08-22 18:44:55 +0000 |
commit | 338c85b7f114869623fc16937b54ae0dead5bb9b (patch) | |
tree | cc29a9df57b1be1c1aea9c543d31d6674a15fd95 | |
parent | 1d6475f3849adac36f665d6261753c7eb2c3dd93 (diff) | |
download | gnunet-338c85b7f114869623fc16937b54ae0dead5bb9b.tar.gz gnunet-338c85b7f114869623fc16937b54ae0dead5bb9b.zip |
- fix peer fwd ack gathering
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index e1fa5797f..c4d3b59aa 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -3437,6 +3437,7 @@ tunnel_get_child_fwd_ack (void *cls, | |||
3437 | cinfo = tunnel_get_neighbor_fc (t, &peer_id); | 3437 | cinfo = tunnel_get_neighbor_fc (t, &peer_id); |
3438 | ack = cinfo->fwd_ack; | 3438 | ack = cinfo->fwd_ack; |
3439 | 3439 | ||
3440 | ctx->nchildren++; | ||
3440 | if (GNUNET_NO == ctx->init) | 3441 | if (GNUNET_NO == ctx->init) |
3441 | { | 3442 | { |
3442 | ctx->max_child_ack = ack; | 3443 | ctx->max_child_ack = ack; |
@@ -3474,7 +3475,11 @@ tunnel_get_children_fwd_ack (struct MeshTunnel *t) | |||
3474 | tree_iterate_children (t->tree, tunnel_get_child_fwd_ack, &ctx); | 3475 | tree_iterate_children (t->tree, tunnel_get_child_fwd_ack, &ctx); |
3475 | 3476 | ||
3476 | if (0 == ctx.nchildren) | 3477 | if (0 == ctx.nchildren) |
3478 | { | ||
3479 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
3480 | " tunnel has no children, no FWD ACK\n"); | ||
3477 | return -1LL; | 3481 | return -1LL; |
3482 | } | ||
3478 | 3483 | ||
3479 | if (GNUNET_YES == t->nobuffer && GMC_is_pid_bigger(ctx.max_child_ack, t->fwd_pid)) | 3484 | if (GNUNET_YES == t->nobuffer && GMC_is_pid_bigger(ctx.max_child_ack, t->fwd_pid)) |
3480 | ctx.max_child_ack = t->fwd_pid + 1; // Might overflow, it's ok. | 3485 | ctx.max_child_ack = t->fwd_pid + 1; // Might overflow, it's ok. |
@@ -3524,7 +3529,11 @@ tunnel_get_clients_fwd_ack (struct MeshTunnel *t) | |||
3524 | int64_t ack; | 3529 | int64_t ack; |
3525 | 3530 | ||
3526 | if (0 == t->nclients) | 3531 | if (0 == t->nclients) |
3527 | return -1; | 3532 | { |
3533 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
3534 | " tunnel has no clients, no FWD ACK\n"); | ||
3535 | return -1LL; | ||
3536 | } | ||
3528 | 3537 | ||
3529 | for (ack = -1, i = 0; i < t->nclients; i++) | 3538 | for (ack = -1, i = 0; i < t->nclients; i++) |
3530 | { | 3539 | { |
@@ -4399,7 +4408,9 @@ queue_send (void *cls, size_t size, void *buf) | |||
4399 | if (GNUNET_MESSAGE_TYPE_MESH_UNICAST == queue->type) | 4408 | if (GNUNET_MESSAGE_TYPE_MESH_UNICAST == queue->type) |
4400 | { | 4409 | { |
4401 | t->fwd_queue_n--; | 4410 | t->fwd_queue_n--; |
4402 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "********* unicast: %u\n"); | 4411 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
4412 | "********* unicast: %u\n", | ||
4413 | t->fwd_queue_n); | ||
4403 | } | 4414 | } |
4404 | else if (GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN == queue->type) | 4415 | else if (GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN == queue->type) |
4405 | { | 4416 | { |