diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-02-18 17:17:42 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-02-18 17:17:42 +0100 |
commit | e00dbaf6877d4a2177eedfea05bd3ac85e6afbb9 (patch) | |
tree | 88e6f52aea71b5c08fe2ac8d6ab4194f1722a362 /src/cadet | |
parent | dbd1c0216d81890be8125c7d17c7b3a93f2d2896 (diff) | |
download | gnunet-e00dbaf6877d4a2177eedfea05bd3ac85e6afbb9.tar.gz gnunet-e00dbaf6877d4a2177eedfea05bd3ac85e6afbb9.zip |
misc bugfixes
Diffstat (limited to 'src/cadet')
-rw-r--r-- | src/cadet/gnunet-service-cadet-new.c | 11 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet-new_channel.c | 13 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/cadet/gnunet-service-cadet-new.c b/src/cadet/gnunet-service-cadet-new.c index b16767fbb..a9b30ccd5 100644 --- a/src/cadet/gnunet-service-cadet-new.c +++ b/src/cadet/gnunet-service-cadet-new.c | |||
@@ -617,12 +617,15 @@ handle_channel_destroy (void *cls, | |||
617 | msg->ccn); | 617 | msg->ccn); |
618 | if (NULL == ch) | 618 | if (NULL == ch) |
619 | { | 619 | { |
620 | /* Client attempted to destroy unknown channel */ | 620 | /* Client attempted to destroy unknown channel. |
621 | GNUNET_break (0); | 621 | Can happen if the other side went down at the same time.*/ |
622 | GNUNET_SERVICE_client_drop (c->client); | 622 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
623 | "%s tried to destroy unknown channel %X\n", | ||
624 | GSC_2s(c), | ||
625 | ntohl (msg->ccn.channel_of_client)); | ||
623 | return; | 626 | return; |
624 | } | 627 | } |
625 | LOG (GNUNET_ERROR_TYPE_INFO, | 628 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
626 | "%s is destroying %s\n", | 629 | "%s is destroying %s\n", |
627 | GSC_2s(c), | 630 | GSC_2s(c), |
628 | GCCH_2s (ch)); | 631 | GCCH_2s (ch)); |
diff --git a/src/cadet/gnunet-service-cadet-new_channel.c b/src/cadet/gnunet-service-cadet-new_channel.c index 9f565a7f4..c418893a8 100644 --- a/src/cadet/gnunet-service-cadet-new_channel.c +++ b/src/cadet/gnunet-service-cadet-new_channel.c | |||
@@ -749,6 +749,7 @@ GCCH_channel_incoming_new (struct CadetTunnel *t, | |||
749 | port, | 749 | port, |
750 | ch, | 750 | ch, |
751 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 751 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
752 | GNUNET_assert (NULL == ch->retry_control_task); | ||
752 | ch->retry_control_task | 753 | ch->retry_control_task |
753 | = GNUNET_SCHEDULER_add_delayed (TIMEOUT_CLOSED_PORT, | 754 | = GNUNET_SCHEDULER_add_delayed (TIMEOUT_CLOSED_PORT, |
754 | &timeout_closed_cb, | 755 | &timeout_closed_cb, |
@@ -834,10 +835,10 @@ send_open_ack (void *cls) | |||
834 | struct CadetChannel *ch = cls; | 835 | struct CadetChannel *ch = cls; |
835 | struct GNUNET_CADET_ChannelManageMessage msg; | 836 | struct GNUNET_CADET_ChannelManageMessage msg; |
836 | 837 | ||
838 | ch->retry_control_task = NULL; | ||
837 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 839 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
838 | "Sending CHANNEL_OPEN_ACK on %s\n", | 840 | "Sending CHANNEL_OPEN_ACK on %s\n", |
839 | GCCH_2s (ch)); | 841 | GCCH_2s (ch)); |
840 | ch->retry_control_task = NULL; | ||
841 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK); | 842 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN_ACK); |
842 | msg.header.size = htons (sizeof (msg)); | 843 | msg.header.size = htons (sizeof (msg)); |
843 | msg.reserved = htonl (0); | 844 | msg.reserved = htonl (0); |
@@ -1011,6 +1012,7 @@ signal_remote_destroy_cb (void *cls) | |||
1011 | struct CadetChannelClient *ccc; | 1012 | struct CadetChannelClient *ccc; |
1012 | 1013 | ||
1013 | /* Find which end is left... */ | 1014 | /* Find which end is left... */ |
1015 | ch->retry_control_task = NULL; | ||
1014 | ccc = (NULL != ch->owner) ? ch->owner : ch->dest; | 1016 | ccc = (NULL != ch->owner) ? ch->owner : ch->dest; |
1015 | GSC_handle_remote_channel_destroy (ccc->c, | 1017 | GSC_handle_remote_channel_destroy (ccc->c, |
1016 | ccc->ccn, | 1018 | ccc->ccn, |
@@ -1780,7 +1782,7 @@ GCCH_handle_local_data (struct CadetChannel *ch, | |||
1780 | struct CadetChannelClient *receiver; | 1782 | struct CadetChannelClient *receiver; |
1781 | struct GNUNET_MQ_Envelope *env; | 1783 | struct GNUNET_MQ_Envelope *env; |
1782 | struct GNUNET_CADET_LocalData *ld; | 1784 | struct GNUNET_CADET_LocalData *ld; |
1783 | int to_owner; | 1785 | int ack_to_owner; |
1784 | 1786 | ||
1785 | env = GNUNET_MQ_msg_extra (ld, | 1787 | env = GNUNET_MQ_msg_extra (ld, |
1786 | buf_len, | 1788 | buf_len, |
@@ -1790,14 +1792,14 @@ GCCH_handle_local_data (struct CadetChannel *ch, | |||
1790 | ch->owner->ccn.channel_of_client) ) | 1792 | ch->owner->ccn.channel_of_client) ) |
1791 | { | 1793 | { |
1792 | receiver = ch->dest; | 1794 | receiver = ch->dest; |
1793 | to_owner = GNUNET_NO; | 1795 | ack_to_owner = GNUNET_YES; |
1794 | } | 1796 | } |
1795 | else if ( (NULL != ch->dest) && | 1797 | else if ( (NULL != ch->dest) && |
1796 | (sender_ccn.channel_of_client == | 1798 | (sender_ccn.channel_of_client == |
1797 | ch->dest->ccn.channel_of_client) ) | 1799 | ch->dest->ccn.channel_of_client) ) |
1798 | { | 1800 | { |
1799 | receiver = ch->owner; | 1801 | receiver = ch->owner; |
1800 | to_owner = GNUNET_YES; | 1802 | ack_to_owner = GNUNET_NO; |
1801 | } | 1803 | } |
1802 | else | 1804 | else |
1803 | { | 1805 | { |
@@ -1810,10 +1812,11 @@ GCCH_handle_local_data (struct CadetChannel *ch, | |||
1810 | buf_len); | 1812 | buf_len); |
1811 | if (GNUNET_YES == receiver->client_ready) | 1813 | if (GNUNET_YES == receiver->client_ready) |
1812 | { | 1814 | { |
1815 | ch->pending_messages--; | ||
1813 | GSC_send_to_client (receiver->c, | 1816 | GSC_send_to_client (receiver->c, |
1814 | env); | 1817 | env); |
1815 | send_ack_to_client (ch, | 1818 | send_ack_to_client (ch, |
1816 | to_owner); | 1819 | ack_to_owner); |
1817 | } | 1820 | } |
1818 | else | 1821 | else |
1819 | { | 1822 | { |