cancel existing last_control_qe handle before scheduling a new one, always
authorChristian Grothoff <christian@grothoff.org>
Thu, 16 Feb 2017 13:54:14 +0000 (14:54 +0100)
committerChristian Grothoff <christian@grothoff.org>
Thu, 16 Feb 2017 13:54:14 +0000 (14:54 +0100)
src/cadet/gnunet-service-cadet-new_channel.c
src/util/mq.c

index 6df6c24cdd5d13845146d5f2b88589741f95dd91..fe3faef5aefcab60e4c080c4f4d955daa5a2abcd 100644 (file)
@@ -566,6 +566,8 @@ send_channel_open (void *cls)
   msgcc.port = ch->port;
   msgcc.ctn = ch->ctn;
   ch->state = CADET_CHANNEL_OPEN_SENT;
+  if (NULL != ch->last_control_qe)
+    GCT_send_cancel (ch->last_control_qe);
   ch->last_control_qe = GCT_send (ch->t,
                                   &msgcc.header,
                                   &channel_open_sent_cb,
@@ -801,13 +803,13 @@ send_channel_data_ack (struct CadetChannel *ch)
   msg.ctn = ch->ctn;
   msg.mid.mid = htonl (ntohl (ch->mid_recv.mid));
   msg.futures = GNUNET_htonll (ch->mid_futures);
-  if (NULL != ch->last_control_qe)
-    GCT_send_cancel (ch->last_control_qe);
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Sending DATA_ACK %u:%llX via %s\n",
        (unsigned int) ntohl (msg.mid.mid),
        (unsigned long long) ch->mid_futures,
        GCCH_2s (ch));
+  if (NULL != ch->last_control_qe)
+    GCT_send_cancel (ch->last_control_qe);
   ch->last_control_qe = GCT_send (ch->t,
                                   &msg.header,
                                   &send_ack_cb,
index bd7ad7c4728ecdb131d649ae805a20c39b07d3de..265e4744baaa907b604861004d08bd996173393b 100644 (file)
@@ -730,7 +730,8 @@ server_client_send_impl (struct GNUNET_MQ_Handle *mq,
   state->th = GNUNET_SERVER_notify_transmit_ready (state->client,
                                                   ntohs (msg->size),
                                                   GNUNET_TIME_UNIT_FOREVER_REL,
-                                                  &transmit_queued, mq);
+                                                  &transmit_queued,
+                                                   mq);
 }