aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/cadet_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-23 23:54:09 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-24 21:59:28 +0100
commit33fccc1e9f5fde308fc6f2ee39b3340ab06aa715 (patch)
treef5dbcb997298f8fa78a06e4d905363aa32ff91fc /src/cadet/cadet_api.c
parent8ed6d64262665ba9ce306823f569213feabba669 (diff)
simplify logic
Diffstat (limited to 'src/cadet/cadet_api.c')
-rw-r--r--src/cadet/cadet_api.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index 89d9daedab..a3b23d9138 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);
}