diff options
author | t3sserakt <t3ss@posteo.de> | 2023-04-27 17:26:31 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2023-05-02 12:40:59 +0200 |
commit | bc50efd138e39a77620f4154a5466b84e702c6aa (patch) | |
tree | 48224bc848a73700f75374f91eb30babf74ccfaf | |
parent | dc1b9baf8919345ae6984538697138712a457f91 (diff) | |
download | gnunet-bc50efd138e39a77620f4154a5466b84e702c6aa.tar.gz gnunet-bc50efd138e39a77620f4154a5466b84e702c6aa.zip |
TNG: Do not update queue performance if PendingMessage was resend.
-rw-r--r-- | src/transport/gnunet-service-tng.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c index cdaf6ff3a..e7acd49f5 100644 --- a/src/transport/gnunet-service-tng.c +++ b/src/transport/gnunet-service-tng.c | |||
@@ -1631,6 +1631,11 @@ struct PendingAcknowledgement | |||
1631 | * Number of bytes of the original message (to calculate bandwidth). | 1631 | * Number of bytes of the original message (to calculate bandwidth). |
1632 | */ | 1632 | */ |
1633 | uint16_t message_size; | 1633 | uint16_t message_size; |
1634 | |||
1635 | /** | ||
1636 | * How often the PendingMessage was send via the Queue of this PendingAcknowledgement. | ||
1637 | */ | ||
1638 | unsigned int num_send; | ||
1634 | }; | 1639 | }; |
1635 | 1640 | ||
1636 | 1641 | ||
@@ -4427,6 +4432,7 @@ queue_send_msg (struct Queue *queue, | |||
4427 | struct Neighbour *n = queue->neighbour; | 4432 | struct Neighbour *n = queue->neighbour; |
4428 | struct GNUNET_TRANSPORT_SendMessageTo *smt; | 4433 | struct GNUNET_TRANSPORT_SendMessageTo *smt; |
4429 | struct GNUNET_MQ_Envelope *env; | 4434 | struct GNUNET_MQ_Envelope *env; |
4435 | struct PendingAcknowledgement *pa; | ||
4430 | 4436 | ||
4431 | GNUNET_log ( | 4437 | GNUNET_log ( |
4432 | GNUNET_ERROR_TYPE_DEBUG, | 4438 | GNUNET_ERROR_TYPE_DEBUG, |
@@ -4495,13 +4501,22 @@ queue_send_msg (struct Queue *queue, | |||
4495 | queue->idle = GNUNET_NO; | 4501 | queue->idle = GNUNET_NO; |
4496 | if (0 == queue->q_capacity) | 4502 | if (0 == queue->q_capacity) |
4497 | queue->idle = GNUNET_NO; | 4503 | queue->idle = GNUNET_NO; |
4504 | |||
4505 | if (NULL != pm && NULL != (pa = pm->pa_head)) | ||
4506 | { | ||
4507 | while (pm != pa->pm) | ||
4508 | pa = pa->next_pa; | ||
4509 | pa->num_send++; | ||
4510 | } | ||
4511 | //GNUNET_CONTAINER_multiuuidmap_get (pending_acks, &ack[i].ack_uuid.value); | ||
4498 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 4512 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
4499 | "Sending message MID %lu of type %u (%u) and size %lu with MQ %p\n", | 4513 | "Sending message MID %lu of type %u (%u) and size %lu with MQ %p QID %lu\n", |
4500 | GNUNET_ntohll (smt->mid), | 4514 | GNUNET_ntohll (smt->mid), |
4501 | ntohs (((const struct GNUNET_MessageHeader *) payload)->type), | 4515 | ntohs (((const struct GNUNET_MessageHeader *) payload)->type), |
4502 | ntohs (smt->header.size), | 4516 | ntohs (smt->header.size), |
4503 | payload_size, | 4517 | payload_size, |
4504 | queue->tc->mq); | 4518 | queue->tc->mq, |
4519 | queue->qid); | ||
4505 | GNUNET_MQ_send (queue->tc->mq, env); | 4520 | GNUNET_MQ_send (queue->tc->mq, env); |
4506 | } | 4521 | } |
4507 | } | 4522 | } |
@@ -6459,7 +6474,7 @@ handle_acknowledged (struct PendingAcknowledgement *pa, | |||
6459 | delay = GNUNET_TIME_relative_subtract (delay, ack_delay); | 6474 | delay = GNUNET_TIME_relative_subtract (delay, ack_delay); |
6460 | if (NULL != pa->queue) | 6475 | if (NULL != pa->queue) |
6461 | update_queue_performance (pa->queue, delay, pa->message_size); | 6476 | update_queue_performance (pa->queue, delay, pa->message_size); |
6462 | if (NULL != pa->dvh) | 6477 | if (NULL != pa->dvh && 1 == pa->num_send) |
6463 | update_dvh_performance (pa->dvh, delay, pa->message_size); | 6478 | update_dvh_performance (pa->dvh, delay, pa->message_size); |
6464 | if (NULL != pa->pm) | 6479 | if (NULL != pa->pm) |
6465 | completed_pending_message (pa->pm); | 6480 | completed_pending_message (pa->pm); |