diff options
author | t3sserakt <t3ss@posteo.de> | 2023-04-27 18:13:55 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2023-05-02 12:41:02 +0200 |
commit | 498b0c3957b499213246972d95b5c98d8553b2d9 (patch) | |
tree | f60aaaad6f00c6bb21ae7bf75d31f5afa1a71338 | |
parent | e0d5206115db8eeeb42ca50237805f165f60c954 (diff) | |
download | gnunet-498b0c3957b499213246972d95b5c98d8553b2d9.tar.gz gnunet-498b0c3957b499213246972d95b5c98d8553b2d9.zip |
TNG: Fixed misplaced increase of queue length.
-rw-r--r-- | src/transport/gnunet-service-tng.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c index f030944bb..5aa9f1a51 100644 --- a/src/transport/gnunet-service-tng.c +++ b/src/transport/gnunet-service-tng.c | |||
@@ -4488,15 +4488,19 @@ queue_send_msg (struct Queue *queue, | |||
4488 | } | 4488 | } |
4489 | GNUNET_CONTAINER_DLL_insert (queue->queue_head, queue->queue_tail, qe); | 4489 | GNUNET_CONTAINER_DLL_insert (queue->queue_head, queue->queue_tail, qe); |
4490 | GNUNET_assert (CT_COMMUNICATOR == queue->tc->type); | 4490 | GNUNET_assert (CT_COMMUNICATOR == queue->tc->type); |
4491 | queue->queue_length++; | ||
4492 | queue->tc->details.communicator.total_queue_length++; | ||
4493 | //FIXME Probably this if statement here is completely wrong in this method, | ||
4494 | // and only fixed a symptom, but not an actual bug. | ||
4495 | if (0 == queue->q_capacity) | 4491 | if (0 == queue->q_capacity) |
4496 | { | 4492 | { |
4493 | // Messages without FC or fragments can get here. | ||
4494 | if (NULL != pm) | ||
4495 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
4496 | "Message %llu (pm type %u) was not send because queue has no capacity.\n", | ||
4497 | pm->logging_uuid, | ||
4498 | pm->pmt); | ||
4497 | GNUNET_free (env); | 4499 | GNUNET_free (env); |
4498 | return; | 4500 | return; |
4499 | } | 4501 | } |
4502 | queue->queue_length++; | ||
4503 | queue->tc->details.communicator.total_queue_length++; | ||
4500 | if (GNUNET_NO == queue->unlimited_length) | 4504 | if (GNUNET_NO == queue->unlimited_length) |
4501 | queue->q_capacity--; | 4505 | queue->q_capacity--; |
4502 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 4506 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |