diff options
author | t3sserakt <t3ss@posteo.de> | 2023-07-14 20:10:57 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2023-07-14 20:10:57 +0200 |
commit | aec63bfd2c3d92b9652ea6b1ea963d324ad6310f (patch) | |
tree | a675263137680fce99fda05b8cbed9f80900347f | |
parent | 61bbc04e96076a7cfd65a574be51655be052b733 (diff) | |
download | gnunet-aec63bfd2c3d92b9652ea6b1ea963d324ad6310f.tar.gz gnunet-aec63bfd2c3d92b9652ea6b1ea963d324ad6310f.zip |
TNG: Fixed bug that QueueEntry of another queue still holds reference to PendingMessage.
-rw-r--r-- | src/transport/gnunet-service-tng.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c index 23503b998..b6039a2ae 100644 --- a/src/transport/gnunet-service-tng.c +++ b/src/transport/gnunet-service-tng.c | |||
@@ -3070,6 +3070,11 @@ free_pending_message (struct PendingMessage *pm) | |||
3070 | if (NULL != pm->bpm) | 3070 | if (NULL != pm->bpm) |
3071 | { | 3071 | { |
3072 | free_fragment_tree (pm->bpm); | 3072 | free_fragment_tree (pm->bpm); |
3073 | if (NULL != pm->bpm->qe) | ||
3074 | { | ||
3075 | struct QueueEntry *qe = pm->bpm->qe; | ||
3076 | qe->pm = NULL; | ||
3077 | } | ||
3073 | GNUNET_free (pm->bpm); | 3078 | GNUNET_free (pm->bpm); |
3074 | } | 3079 | } |
3075 | 3080 | ||
@@ -4310,7 +4315,7 @@ handle_client_recv_ok (void *cls, const struct RecvOkMessage *rom) | |||
4310 | delta = ntohl (rom->increase_window_delta); | 4315 | delta = ntohl (rom->increase_window_delta); |
4311 | vl->core_recv_window += delta; | 4316 | vl->core_recv_window += delta; |
4312 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 4317 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
4313 | "CORE ack receiving message, increased CORE recv window to %u\n", | 4318 | "CORE ack receiving message, increased CORE recv window to %d\n", |
4314 | vl->core_recv_window); | 4319 | vl->core_recv_window); |
4315 | GNUNET_SERVICE_client_continue (tc->client); | 4320 | GNUNET_SERVICE_client_continue (tc->client); |
4316 | if (vl->core_recv_window <= 0) | 4321 | if (vl->core_recv_window <= 0) |
@@ -5749,7 +5754,7 @@ finish_handling_raw_message (struct VirtualLink *vl, | |||
5749 | return; | 5754 | return; |
5750 | } | 5755 | } |
5751 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 5756 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
5752 | "Delivered message from %s of type %u to CORE recv window %u\n", | 5757 | "Delivered message from %s of type %u to CORE recv window %d\n", |
5753 | GNUNET_i2s (&cmc->im.sender), | 5758 | GNUNET_i2s (&cmc->im.sender), |
5754 | ntohs (mh->type), | 5759 | ntohs (mh->type), |
5755 | vl->core_recv_window); | 5760 | vl->core_recv_window); |
@@ -10303,9 +10308,10 @@ handle_send_message_ack (void *cls, | |||
10303 | GNUNET_ntohll (sma->mid), | 10308 | GNUNET_ntohll (sma->mid), |
10304 | ntohl (sma->qid)); | 10309 | ntohl (sma->qid)); |
10305 | // TODO I guess this can happen, if the Ack from the peer comes before the Ack from the queue. | 10310 | // TODO I guess this can happen, if the Ack from the peer comes before the Ack from the queue. |
10311 | // Update: Maybe QueueEntry was accidentally freed during freeing PendingMessage. | ||
10306 | /* this should never happen */ | 10312 | /* this should never happen */ |
10307 | /*GNUNET_break (0); | 10313 | GNUNET_break (0); |
10308 | GNUNET_SERVICE_client_drop (tc->client);*/ | 10314 | //GNUNET_SERVICE_client_drop (tc->client); |
10309 | GNUNET_SERVICE_client_continue (tc->client); | 10315 | GNUNET_SERVICE_client_continue (tc->client); |
10310 | return; | 10316 | return; |
10311 | } | 10317 | } |