gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: fix crash if this end close


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: fix crash if this end closed connection and other still sends data
Date: Wed, 25 Jan 2017 09:52:02 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 30a3ad633 fix crash if this end closed connection and other still 
sends data
30a3ad633 is described below

commit 30a3ad6332bea548ba14c2e80d648e481aab4fe3
Author: Christian Grothoff <address@hidden>
AuthorDate: Wed Jan 25 09:51:54 2017 +0100

    fix crash if this end closed connection and other still sends data
---
 src/cadet/gnunet-service-cadet-new_channel.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

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,
   size_t payload_size;
 
   GNUNET_assert (GNUNET_NO == ch->is_loopback);
+  if ( (GNUNET_YES == ch->destroy) &&
+       (NULL == ch->owner) &&
+       (NULL == ch->dest) )
+  {
+    /* This client is gone, but we still have messages to send to
+       the other end (which is why @a ch is not yet dead).  However,
+       we cannot pass messages to our client anymore. */
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+         "Dropping incoming payload on %s as this end is already closed\n",
+         GCCH_2s (ch));
+    /* FIXME: send back ACK/NACK/Closed notification
+       to stop retransmissions! */
+    return;
+  }
   payload_size = ntohs (msg->header.size) - sizeof (*msg);
   env = GNUNET_MQ_msg_extra (ld,
                              payload_size,

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]