aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/gnunet-service-cadet_channel.c')
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index 1a2b32be0..06711dc8b 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2001-2017 GNUnet e.V. 3 Copyright (C) 2001-2017 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software: you can redistribute it and/or modify it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20/** 18/**
21 * @file cadet/gnunet-service-cadet_channel.c 19 * @file cadet/gnunet-service-cadet_channel.c
@@ -411,7 +409,7 @@ GCCH_2s (const struct CadetChannel *ch)
411 409
412 410
413/** 411/**
414 * Hash the @a port and @a initiator and @a listener to 412 * Hash the @a port and @a initiator and @a listener to
415 * calculate the "challenge" @a h_port we send to the other 413 * calculate the "challenge" @a h_port we send to the other
416 * peer on #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN. 414 * peer on #GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN.
417 * 415 *
@@ -1186,7 +1184,7 @@ GCCH_handle_channel_open_ack (struct CadetChannel *ch,
1186 port, 1184 port,
1187 sizeof (struct GNUNET_HashCode))) 1185 sizeof (struct GNUNET_HashCode)))
1188 { 1186 {
1189 /* Other peer failed to provide the right port, 1187 /* Other peer failed to provide the right port,
1190 refuse connection. */ 1188 refuse connection. */
1191 GNUNET_break_op (0); 1189 GNUNET_break_op (0);
1192 return; 1190 return;
@@ -1279,8 +1277,7 @@ GCCH_handle_channel_plaintext_data (struct CadetChannel *ch,
1279 uint32_t delta; 1277 uint32_t delta;
1280 1278
1281 GNUNET_assert (GNUNET_NO == ch->is_loopback); 1279 GNUNET_assert (GNUNET_NO == ch->is_loopback);
1282 if ( (GNUNET_YES == ch->destroy) && 1280 if ( (NULL == ch->owner) &&
1283 (NULL == ch->owner) &&
1284 (NULL == ch->dest) ) 1281 (NULL == ch->dest) )
1285 { 1282 {
1286 /* This client is gone, but we still have messages to send to 1283 /* This client is gone, but we still have messages to send to
@@ -1290,8 +1287,9 @@ GCCH_handle_channel_plaintext_data (struct CadetChannel *ch,
1290 "Dropping incoming payload on %s as this end is already closed\n", 1287 "Dropping incoming payload on %s as this end is already closed\n",
1291 GCCH_2s (ch)); 1288 GCCH_2s (ch));
1292 /* send back DESTROY notification to stop further retransmissions! */ 1289 /* send back DESTROY notification to stop further retransmissions! */
1293 GCT_send_channel_destroy (ch->t, 1290 if (GNUNET_YES == ch->destroy)
1294 ch->ctn); 1291 GCT_send_channel_destroy (ch->t,
1292 ch->ctn);
1295 return; 1293 return;
1296 } 1294 }
1297 payload_size = ntohs (msg->header.size) - sizeof (*msg); 1295 payload_size = ntohs (msg->header.size) - sizeof (*msg);
@@ -1822,7 +1820,7 @@ GCCH_handle_local_data (struct CadetChannel *ch,
1822{ 1820{
1823 struct CadetReliableMessage *crm; 1821 struct CadetReliableMessage *crm;
1824 1822
1825 if (ch->pending_messages > ch->max_pending_messages) 1823 if (ch->pending_messages >= ch->max_pending_messages)
1826 { 1824 {
1827 GNUNET_break (0); 1825 GNUNET_break (0);
1828 return GNUNET_SYSERR; 1826 return GNUNET_SYSERR;