gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] 01/05: simplify logic


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 01/05: simplify logic
Date: Tue, 24 Jan 2017 21:59:35 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

commit 33fccc1e9f5fde308fc6f2ee39b3340ab06aa715
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Jan 23 23:54:09 2017 +0100

    simplify logic
---
 src/cadet/cadet_api.c  | 40 ++++++++++++++++------------------------
 src/cadet/test_cadet.c |  3 ++-
 2 files changed, 18 insertions(+), 25 deletions(-)

diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index 89d9daeda..a3b23d913 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -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);
 }
 
 
diff --git a/src/cadet/test_cadet.c b/src/cadet/test_cadet.c
index ce0178bd5..2f50a7346 100644
--- a/src/cadet/test_cadet.c
+++ b/src/cadet/test_cadet.c
@@ -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,

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]