simplify logic
authorChristian Grothoff <christian@grothoff.org>
Mon, 23 Jan 2017 22:54:09 +0000 (23:54 +0100)
committerChristian Grothoff <christian@grothoff.org>
Tue, 24 Jan 2017 20:59:28 +0000 (21:59 +0100)
src/cadet/cadet_api.c
src/cadet/test_cadet.c

index 89d9daedab78798a9a2c8fa53c6babf44b8d3e83..a3b23d9138f5bc2f9b048978b3054fc5ee61d03d 100644 (file)
@@ -513,29 +513,6 @@ remove_from_queue (struct GNUNET_CADET_TransmitHandle *th)
 }
 
 
-/**
- * Send an ack on the channel to confirm the processing of a message.
- *
- * @param ch Channel on which to send the ACK.
- */
-static void
-send_ack (struct GNUNET_CADET_Channel *ch)
-{
-  struct GNUNET_CADET_LocalAck *msg;
-  struct GNUNET_MQ_Envelope *env;
-
-  env = GNUNET_MQ_msg (msg,
-                       GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK);
-
-  LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "Sending ACK on channel %X\n",
-       ch->ccn.channel_of_client);
-  msg->ccn = ch->ccn;
-  GNUNET_MQ_send (ch->cadet->mq,
-                  env);
-}
-
-
 
 /******************************************************************************/
 /***********************      RECEIVE HANDLERS     ****************************/
@@ -1749,10 +1726,25 @@ GNUNET_CADET_notify_transmit_ready_cancel (struct GNUNET_CADET_TransmitHandle *t
 }
 
 
+/**
+ * Send an ack on the channel to confirm the processing of a message.
+ *
+ * @param ch Channel on which to send the ACK.
+ */
 void
 GNUNET_CADET_receive_done (struct GNUNET_CADET_Channel *channel)
 {
-  send_ack (channel);
+  struct GNUNET_CADET_LocalAck *msg;
+  struct GNUNET_MQ_Envelope *env;
+
+  env = GNUNET_MQ_msg (msg,
+                       GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK);
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Sending ACK on channel %X\n",
+       channel->ccn.channel_of_client);
+  msg->ccn = channel->ccn;
+  GNUNET_MQ_send (channel->cadet->mq,
+                  env);
 }
 
 
index ce0178bd5b2c5869f5756ed44c32a771406d3c36..2f50a7346372206a3015a1362cfbce9b52060c7b 100644 (file)
@@ -633,7 +633,8 @@ data_callback (void *cls,
   {
     if (NULL != disconnect_task)
     {
-      GNUNET_log (GNUNET_ERROR_TYPE_INFO, " reschedule timeout\n");
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  " reschedule timeout\n");
       GNUNET_SCHEDULER_cancel (disconnect_task);
       disconnect_task = GNUNET_SCHEDULER_add_delayed (SHORT_TIME,
                                                       &gather_stats_and_exit,