diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-02-16 14:54:14 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-02-16 14:54:14 +0100 |
commit | ad22adb15a0c895ac9c25d4c289abf86355a4737 (patch) | |
tree | dbc75bdc1b5d08613d391b74e40637ec6c63a0b0 /src/cadet | |
parent | 043e4a49181172a448dcb8a6bd1d0b59d79dcee2 (diff) | |
download | gnunet-ad22adb15a0c895ac9c25d4c289abf86355a4737.tar.gz gnunet-ad22adb15a0c895ac9c25d4c289abf86355a4737.zip |
cancel existing last_control_qe handle before scheduling a new one, always
Diffstat (limited to 'src/cadet')
-rw-r--r-- | src/cadet/gnunet-service-cadet-new_channel.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cadet/gnunet-service-cadet-new_channel.c b/src/cadet/gnunet-service-cadet-new_channel.c index 6df6c24cd..fe3faef5a 100644 --- a/src/cadet/gnunet-service-cadet-new_channel.c +++ b/src/cadet/gnunet-service-cadet-new_channel.c | |||
@@ -566,6 +566,8 @@ send_channel_open (void *cls) | |||
566 | msgcc.port = ch->port; | 566 | msgcc.port = ch->port; |
567 | msgcc.ctn = ch->ctn; | 567 | msgcc.ctn = ch->ctn; |
568 | ch->state = CADET_CHANNEL_OPEN_SENT; | 568 | ch->state = CADET_CHANNEL_OPEN_SENT; |
569 | if (NULL != ch->last_control_qe) | ||
570 | GCT_send_cancel (ch->last_control_qe); | ||
569 | ch->last_control_qe = GCT_send (ch->t, | 571 | ch->last_control_qe = GCT_send (ch->t, |
570 | &msgcc.header, | 572 | &msgcc.header, |
571 | &channel_open_sent_cb, | 573 | &channel_open_sent_cb, |
@@ -801,13 +803,13 @@ send_channel_data_ack (struct CadetChannel *ch) | |||
801 | msg.ctn = ch->ctn; | 803 | msg.ctn = ch->ctn; |
802 | msg.mid.mid = htonl (ntohl (ch->mid_recv.mid)); | 804 | msg.mid.mid = htonl (ntohl (ch->mid_recv.mid)); |
803 | msg.futures = GNUNET_htonll (ch->mid_futures); | 805 | msg.futures = GNUNET_htonll (ch->mid_futures); |
804 | if (NULL != ch->last_control_qe) | ||
805 | GCT_send_cancel (ch->last_control_qe); | ||
806 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 806 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
807 | "Sending DATA_ACK %u:%llX via %s\n", | 807 | "Sending DATA_ACK %u:%llX via %s\n", |
808 | (unsigned int) ntohl (msg.mid.mid), | 808 | (unsigned int) ntohl (msg.mid.mid), |
809 | (unsigned long long) ch->mid_futures, | 809 | (unsigned long long) ch->mid_futures, |
810 | GCCH_2s (ch)); | 810 | GCCH_2s (ch)); |
811 | if (NULL != ch->last_control_qe) | ||
812 | GCT_send_cancel (ch->last_control_qe); | ||
811 | ch->last_control_qe = GCT_send (ch->t, | 813 | ch->last_control_qe = GCT_send (ch->t, |
812 | &msg.header, | 814 | &msg.header, |
813 | &send_ack_cb, | 815 | &send_ack_cb, |