From: Bart Polot Date: Wed, 26 Jun 2013 22:49:43 +0000 (+0000) Subject: - just update fc->queue for payload messages X-Git-Tag: initial-import-from-subversion-38251~8608 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=69f35c68816c5fa71eb6ebad14ba210a927bf879;p=oweals%2Fgnunet.git - just update fc->queue for payload messages --- diff --git a/src/mesh/gnunet-service-mesh-new.c b/src/mesh/gnunet-service-mesh-new.c index bd0442f92..5a259bfbc 100644 --- a/src/mesh/gnunet-service-mesh-new.c +++ b/src/mesh/gnunet-service-mesh-new.c @@ -236,7 +236,7 @@ struct MeshFlowControl uint32_t last_ack_recv; /** - * How many messages are in the queue towards this peer. + * How many payload messages are in the queue towards this peer. */ uint32_t queue_n; @@ -2743,16 +2743,20 @@ queue_destroy (struct MeshPeerQueue *queue, int clear_cls) queue); /* Delete from appropriate fc in the tunnel */ - if (queue->peer->id == queue->tunnel->prev_hop) - fc = &queue->tunnel->prev_fc; - else if (queue->peer->id == queue->tunnel->next_hop) - fc = &queue->tunnel->next_fc; - else + if (GNUNET_MESSAGE_TYPE_MESH_UNICAST == queue->type || + GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN == queue->type ) { - GNUNET_break (0); - return; + if (queue->peer->id == queue->tunnel->prev_hop) + fc = &queue->tunnel->prev_fc; + else if (queue->peer->id == queue->tunnel->next_hop) + fc = &queue->tunnel->next_fc; + else + { + GNUNET_break (0); + return; + } + fc->queue_n--; } - fc->queue_n--; GNUNET_free (queue); } @@ -3020,6 +3024,9 @@ queue_add (void *cls, uint16_t type, size_t size, if (*n >= t->queue_max) { GNUNET_break(0); + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "queue full: %u/%u\n", + *n, t->queue_max); GNUNET_STATISTICS_update(stats, "# messages dropped (buffer full)", 1, GNUNET_NO);