diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-25 09:51:54 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-25 09:51:54 +0100 |
commit | 30a3ad6332bea548ba14c2e80d648e481aab4fe3 (patch) | |
tree | 1363403f37345a4f4b92f6a170fbc5954f7296a6 /src/cadet/gnunet-service-cadet-new_channel.c | |
parent | 742a87b2ebbed2f12573842d8641a4f0071974e6 (diff) | |
download | gnunet-30a3ad6332bea548ba14c2e80d648e481aab4fe3.tar.gz gnunet-30a3ad6332bea548ba14c2e80d648e481aab4fe3.zip |
fix crash if this end closed connection and other still sends data
Diffstat (limited to 'src/cadet/gnunet-service-cadet-new_channel.c')
-rw-r--r-- | src/cadet/gnunet-service-cadet-new_channel.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cadet/gnunet-service-cadet-new_channel.c b/src/cadet/gnunet-service-cadet-new_channel.c index 600b5be15..cc59ced52 100644 --- a/src/cadet/gnunet-service-cadet-new_channel.c +++ b/src/cadet/gnunet-service-cadet-new_channel.c | |||
@@ -1087,6 +1087,20 @@ GCCH_handle_channel_plaintext_data (struct CadetChannel *ch, | |||
1087 | size_t payload_size; | 1087 | size_t payload_size; |
1088 | 1088 | ||
1089 | GNUNET_assert (GNUNET_NO == ch->is_loopback); | 1089 | GNUNET_assert (GNUNET_NO == ch->is_loopback); |
1090 | if ( (GNUNET_YES == ch->destroy) && | ||
1091 | (NULL == ch->owner) && | ||
1092 | (NULL == ch->dest) ) | ||
1093 | { | ||
1094 | /* This client is gone, but we still have messages to send to | ||
1095 | the other end (which is why @a ch is not yet dead). However, | ||
1096 | we cannot pass messages to our client anymore. */ | ||
1097 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
1098 | "Dropping incoming payload on %s as this end is already closed\n", | ||
1099 | GCCH_2s (ch)); | ||
1100 | /* FIXME: send back ACK/NACK/Closed notification | ||
1101 | to stop retransmissions! */ | ||
1102 | return; | ||
1103 | } | ||
1090 | payload_size = ntohs (msg->header.size) - sizeof (*msg); | 1104 | payload_size = ntohs (msg->header.size) - sizeof (*msg); |
1091 | env = GNUNET_MQ_msg_extra (ld, | 1105 | env = GNUNET_MQ_msg_extra (ld, |
1092 | payload_size, | 1106 | payload_size, |