diff options
author | t3sserakt <t3ss@posteo.de> | 2023-04-27 18:11:46 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2023-05-02 12:41:02 +0200 |
commit | e0d5206115db8eeeb42ca50237805f165f60c954 (patch) | |
tree | f42f2a559bd976389750d55c28f6875ddd300e4f | |
parent | 4af328381f1e954c90e9b821e366998808394d88 (diff) | |
download | gnunet-e0d5206115db8eeeb42ca50237805f165f60c954.tar.gz gnunet-e0d5206115db8eeeb42ca50237805f165f60c954.zip |
TNG: Fixed bug that additional queues for the same communicator inherit the validity period.
-rw-r--r-- | src/transport/gnunet-service-tng.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c index c30d2dd19..f030944bb 100644 --- a/src/transport/gnunet-service-tng.c +++ b/src/transport/gnunet-service-tng.c | |||
@@ -10899,6 +10899,7 @@ handle_add_queue_message (void *cls, | |||
10899 | struct TransportClient *tc = cls; | 10899 | struct TransportClient *tc = cls; |
10900 | struct Queue *queue; | 10900 | struct Queue *queue; |
10901 | struct Neighbour *neighbour; | 10901 | struct Neighbour *neighbour; |
10902 | struct GNUNET_TIME_Absolute validated_until = GNUNET_TIME_UNIT_ZERO_ABS; | ||
10902 | const char *addr; | 10903 | const char *addr; |
10903 | uint16_t addr_len; | 10904 | uint16_t addr_len; |
10904 | 10905 | ||
@@ -10915,6 +10916,7 @@ handle_add_queue_message (void *cls, | |||
10915 | NULL != queue; | 10916 | NULL != queue; |
10916 | queue = queue->next_client) | 10917 | queue = queue->next_client) |
10917 | { | 10918 | { |
10919 | validated_until = queue->validated_until; | ||
10918 | if (queue->qid != ntohl (aqm->qid)) | 10920 | if (queue->qid != ntohl (aqm->qid)) |
10919 | continue; | 10921 | continue; |
10920 | break; | 10922 | break; |
@@ -10956,6 +10958,13 @@ handle_add_queue_message (void *cls, | |||
10956 | ntohl (aqm->mtu)); | 10958 | ntohl (aqm->mtu)); |
10957 | queue = GNUNET_malloc (sizeof(struct Queue) + addr_len); | 10959 | queue = GNUNET_malloc (sizeof(struct Queue) + addr_len); |
10958 | queue->tc = tc; | 10960 | queue->tc = tc; |
10961 | if (GNUNET_TIME_UNIT_ZERO_ABS.abs_value_us != validated_until.abs_value_us) | ||
10962 | { | ||
10963 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
10964 | "New queue with QID %lu inherit validated until\n", | ||
10965 | ntohl (aqm->qid)); | ||
10966 | queue->validated_until = validated_until; | ||
10967 | } | ||
10959 | queue->address = (const char *) &queue[1]; | 10968 | queue->address = (const char *) &queue[1]; |
10960 | queue->pd.aged_rtt = GNUNET_TIME_UNIT_FOREVER_REL; | 10969 | queue->pd.aged_rtt = GNUNET_TIME_UNIT_FOREVER_REL; |
10961 | queue->qid = ntohl (aqm->qid); | 10970 | queue->qid = ntohl (aqm->qid); |