diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-23 23:54:09 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-24 21:59:28 +0100 |
commit | 33fccc1e9f5fde308fc6f2ee39b3340ab06aa715 (patch) | |
tree | f5dbcb997298f8fa78a06e4d905363aa32ff91fc | |
parent | 8ed6d64262665ba9ce306823f569213feabba669 (diff) | |
download | gnunet-33fccc1e9f5fde308fc6f2ee39b3340ab06aa715.tar.gz gnunet-33fccc1e9f5fde308fc6f2ee39b3340ab06aa715.zip |
simplify logic
-rw-r--r-- | src/cadet/cadet_api.c | 40 | ||||
-rw-r--r-- | 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) | |||
513 | } | 513 | } |
514 | 514 | ||
515 | 515 | ||
516 | /** | ||
517 | * Send an ack on the channel to confirm the processing of a message. | ||
518 | * | ||
519 | * @param ch Channel on which to send the ACK. | ||
520 | */ | ||
521 | static void | ||
522 | send_ack (struct GNUNET_CADET_Channel *ch) | ||
523 | { | ||
524 | struct GNUNET_CADET_LocalAck *msg; | ||
525 | struct GNUNET_MQ_Envelope *env; | ||
526 | |||
527 | env = GNUNET_MQ_msg (msg, | ||
528 | GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK); | ||
529 | |||
530 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
531 | "Sending ACK on channel %X\n", | ||
532 | ch->ccn.channel_of_client); | ||
533 | msg->ccn = ch->ccn; | ||
534 | GNUNET_MQ_send (ch->cadet->mq, | ||
535 | env); | ||
536 | } | ||
537 | |||
538 | |||
539 | 516 | ||
540 | /******************************************************************************/ | 517 | /******************************************************************************/ |
541 | /*********************** RECEIVE HANDLERS ****************************/ | 518 | /*********************** RECEIVE HANDLERS ****************************/ |
@@ -1749,10 +1726,25 @@ GNUNET_CADET_notify_transmit_ready_cancel (struct GNUNET_CADET_TransmitHandle *t | |||
1749 | } | 1726 | } |
1750 | 1727 | ||
1751 | 1728 | ||
1729 | /** | ||
1730 | * Send an ack on the channel to confirm the processing of a message. | ||
1731 | * | ||
1732 | * @param ch Channel on which to send the ACK. | ||
1733 | */ | ||
1752 | void | 1734 | void |
1753 | GNUNET_CADET_receive_done (struct GNUNET_CADET_Channel *channel) | 1735 | GNUNET_CADET_receive_done (struct GNUNET_CADET_Channel *channel) |
1754 | { | 1736 | { |
1755 | send_ack (channel); | 1737 | struct GNUNET_CADET_LocalAck *msg; |
1738 | struct GNUNET_MQ_Envelope *env; | ||
1739 | |||
1740 | env = GNUNET_MQ_msg (msg, | ||
1741 | GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK); | ||
1742 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
1743 | "Sending ACK on channel %X\n", | ||
1744 | channel->ccn.channel_of_client); | ||
1745 | msg->ccn = channel->ccn; | ||
1746 | GNUNET_MQ_send (channel->cadet->mq, | ||
1747 | env); | ||
1756 | } | 1748 | } |
1757 | 1749 | ||
1758 | 1750 | ||
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, | |||
633 | { | 633 | { |
634 | if (NULL != disconnect_task) | 634 | if (NULL != disconnect_task) |
635 | { | 635 | { |
636 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, " reschedule timeout\n"); | 636 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
637 | " reschedule timeout\n"); | ||
637 | GNUNET_SCHEDULER_cancel (disconnect_task); | 638 | GNUNET_SCHEDULER_cancel (disconnect_task); |
638 | disconnect_task = GNUNET_SCHEDULER_add_delayed (SHORT_TIME, | 639 | disconnect_task = GNUNET_SCHEDULER_add_delayed (SHORT_TIME, |
639 | &gather_stats_and_exit, | 640 | &gather_stats_and_exit, |