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 loopback disconnect sig


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: fix loopback disconnect signalling and a few memory leaks
Date: Fri, 17 Feb 2017 21:01:45 +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 47c8cd679 fix loopback disconnect signalling and a few memory leaks
47c8cd679 is described below

commit 47c8cd67924e0e6ebbdd8b40c52559eaf9d4e435
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Feb 17 21:01:43 2017 +0100

    fix loopback disconnect signalling and a few memory leaks
---
 src/cadet/cadet_api_new.c                    |  2 ++
 src/cadet/gnunet-service-cadet-new_channel.c | 18 +++++++++++++++---
 src/util/client.c                            |  2 ++
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/cadet/cadet_api_new.c b/src/cadet/cadet_api_new.c
index 8d778e10e..673764813 100644
--- a/src/cadet/cadet_api_new.c
+++ b/src/cadet/cadet_api_new.c
@@ -346,6 +346,8 @@ destroy_channel (struct GNUNET_CADET_Channel *ch)
   if (NULL != ch->disconnects)
     ch->disconnects (ch->ctx,
                      ch);
+  if (NULL != ch->pending_env)
+    GNUNET_MQ_discard (ch->pending_env);
   GNUNET_MQ_destroy (ch->mq);
   GNUNET_free (ch);
 }
diff --git a/src/cadet/gnunet-service-cadet-new_channel.c 
b/src/cadet/gnunet-service-cadet-new_channel.c
index e94800593..828c3daa7 100644
--- a/src/cadet/gnunet-service-cadet-new_channel.c
+++ b/src/cadet/gnunet-service-cadet-new_channel.c
@@ -1043,15 +1043,27 @@ GCCH_channel_local_destroy (struct CadetChannel *ch,
     channel_destroy (ch);
     return;
   }
-  if ( (NULL != ch->head_sent) ||
-       (NULL != ch->owner) ||
-       (NULL != ch->dest) )
+  if ( (NULL != ch->head_sent) &&
+       ( (NULL != ch->owner) ||
+         (NULL != ch->dest) ) )
   {
     /* Wait for other end to destroy us as well,
        and otherwise allow send queue to be transmitted first */
     ch->destroy = GNUNET_YES;
     return;
   }
+  if (GNUNET_YES == ch->is_loopback)
+  {
+    struct CadetChannelClient *ccc;
+
+    /* Find which end is left... */
+    ccc = (NULL != ch->owner) ? ch->owner : ch->dest;
+    GSC_handle_remote_channel_destroy (ccc->c,
+                                       ccc->ccn,
+                                       ch);
+    channel_destroy (ch);
+    return;
+  }
   /* If the we ever sent the CHANNEL_CREATE, we need to send a destroy 
message. */
   switch (ch->state)
   {
diff --git a/src/util/client.c b/src/util/client.c
index 4fd971040..1cf819f9d 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -510,6 +510,8 @@ try_unixpath (const char *service_name,
       GNUNET_free (unixpath);
       return sock;
     }
+    if (NULL != sock)
+      GNUNET_NETWORK_socket_close (sock);
   }
   GNUNET_free_non_null (unixpath);
 #endif

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



reply via email to

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