gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated (88a4bbdd9 -> 801c75f91)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (88a4bbdd9 -> 801c75f91)
Date: Sat, 13 Jan 2018 14:55:44 +0100

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

grothoff pushed a change to branch master
in repository gnunet.

    from 88a4bbdd9 fix reverse lookup from namestore
     new 7c2ee1630 prevent NPE
     new 4bd01d03e prevent assertion failure
     new 58e2f8ead do not die if client closes port it never opened
     new 801c75f91 use assert to guard better against double-close on client 
side

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/cadet/cadet_api.c                               | 10 +++++-----
 src/cadet/gnunet-service-cadet.c                    |  9 ++++++++-
 src/transport/gnunet-service-transport_neighbours.c | 10 ++++++++++
 src/util/container_bloomfilter.c                    |  2 +-
 4 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index 6b07ab7b7..3c142a95c 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -1276,15 +1276,15 @@ GNUNET_CADET_close_port (struct GNUNET_CADET_Port *p)
   struct GNUNET_CADET_PortMessage *msg;
   struct GNUNET_MQ_Envelope *env;
 
+  GNUNET_assert (GNUNET_YES ==
+                 GNUNET_CONTAINER_multihashmap_remove (p->cadet->ports,
+                                                       &p->id,
+                                                       p));
   env = GNUNET_MQ_msg (msg,
                        GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE);
   msg->port = p->id;
   GNUNET_MQ_send (p->cadet->mq,
                   env);
-  GNUNET_assert (GNUNET_YES ==
-                 GNUNET_CONTAINER_multihashmap_remove (p->cadet->ports,
-                                                       &p->id,
-                                                       p));
   GNUNET_free_non_null (p->handlers);
   GNUNET_free (p);
 }
@@ -1673,7 +1673,7 @@ GNUNET_CADET_open_port (struct GNUNET_CADET_Handle *h,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Listening to CADET port %s\n",
              GNUNET_h2s (port));
-  
+
   p = GNUNET_new (struct GNUNET_CADET_Port);
   p->cadet = h;
   p->id = *port;
diff --git a/src/cadet/gnunet-service-cadet.c b/src/cadet/gnunet-service-cadet.c
index c3e99e0eb..20e4c363e 100644
--- a/src/cadet/gnunet-service-cadet.c
+++ b/src/cadet/gnunet-service-cadet.c
@@ -75,7 +75,7 @@ struct CadetClient
    * Handle to communicate with the client
    */
   struct GNUNET_MQ_Handle *mq;
-  
+
   /**
    * Client handle.
    */
@@ -536,6 +536,13 @@ handle_port_close (void *cls,
        "Closing port %s as requested by %s\n",
        GNUNET_h2s (&pmsg->port),
        GSC_2s (c));
+  if (NULL == c->ports)
+  {
+    /* Client closed a port despite _never_ having opened one? */
+    GNUNET_break (0);
+    GNUNET_SERVICE_client_drop (c->client);
+    return;
+  }
   op = GNUNET_CONTAINER_multihashmap_get (c->ports,
                                          &pmsg->port);
   if (NULL == op)
diff --git a/src/transport/gnunet-service-transport_neighbours.c 
b/src/transport/gnunet-service-transport_neighbours.c
index 2bf07bcd7..e124f1667 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -1407,6 +1407,14 @@ try_transmission_to_peer (struct NeighbourMapEntry *n)
   }
   if (NULL == mq)
     return;                     /* no more messages */
+  if (NULL == n->primary_address.address)
+  {
+    /* transmit_send_continuation() caused us to drop session,
+       can't try transmission anymore. */
+    return;
+  }
+
+
   GNUNET_CONTAINER_DLL_remove (n->messages_head,
                                n->messages_tail,
                                mq);
@@ -2137,6 +2145,8 @@ inbound_bw_tracker_update (void *cls)
               "New inbound delay for peer `%s' is %llu ms\n",
               GNUNET_i2s (&n->id),
               (unsigned long long) delay.rel_value_us / 1000LL);
+  if (NULL == n->primary_address.session)
+    return;
   papi->update_inbound_delay (papi->cls,
                               &n->id,
                               n->primary_address.session,
diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c
index 95c05b9d7..db61c5221 100644
--- a/src/util/container_bloomfilter.c
+++ b/src/util/container_bloomfilter.c
@@ -660,7 +660,7 @@ GNUNET_CONTAINER_bloomfilter_init (const char *data, size_t 
size,
  * @param bf bloomfilter to take the raw data from
  * @param data where to write the data
  * @param size the size of the given data array
- * @return GNUNET_SYSERR if the data array is not big enough
+ * @return #GNUNET_SYSERR if the data array is not big enough
  */
 int
 GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct

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



reply via email to

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