[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 04/04: use assert to guard better against double-c
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 04/04: use assert to guard better against double-close on client side |
Date: |
Sat, 13 Jan 2018 14:55:48 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit 801c75f9134547f7fb9b19a881ce96e4c37450ea
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Jan 13 14:47:16 2018 +0100
use assert to guard better against double-close on client side
---
src/cadet/cadet_api.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 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;
--
To stop receiving notification emails like this one, please contact
address@hidden