aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-02-16 14:54:14 +0100
committerChristian Grothoff <christian@grothoff.org>2017-02-16 14:54:14 +0100
commitad22adb15a0c895ac9c25d4c289abf86355a4737 (patch)
treedbc75bdc1b5d08613d391b74e40637ec6c63a0b0
parent043e4a49181172a448dcb8a6bd1d0b59d79dcee2 (diff)
downloadgnunet-ad22adb15a0c895ac9c25d4c289abf86355a4737.tar.gz
gnunet-ad22adb15a0c895ac9c25d4c289abf86355a4737.zip
cancel existing last_control_qe handle before scheduling a new one, always
-rw-r--r--src/cadet/gnunet-service-cadet-new_channel.c6
-rw-r--r--src/util/mq.c3
2 files changed, 6 insertions, 3 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,
diff --git a/src/util/mq.c b/src/util/mq.c
index bd7ad7c47..265e4744b 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -730,7 +730,8 @@ server_client_send_impl (struct GNUNET_MQ_Handle *mq,
730 state->th = GNUNET_SERVER_notify_transmit_ready (state->client, 730 state->th = GNUNET_SERVER_notify_transmit_ready (state->client,
731 ntohs (msg->size), 731 ntohs (msg->size),
732 GNUNET_TIME_UNIT_FOREVER_REL, 732 GNUNET_TIME_UNIT_FOREVER_REL,
733 &transmit_queued, mq); 733 &transmit_queued,
734 mq);
734} 735}
735 736
736 737