summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-11-15 14:08:31 +0100
committerChristian Grothoff <christian@grothoff.org>2018-11-15 14:08:31 +0100
commitc359c3f7d928abf47a0c29d735bb7e30fb55e4dc (patch)
tree9cfb8ebf2deafb06503ebb0b2d160c8851dfb3bb
parent478a4c062b7d12b5d75d10667aa7739bd15b6405 (diff)
fix double-read task in communicator-unix
-rw-r--r--src/transport/Makefile.am3
-rw-r--r--src/transport/gnunet-communicator-unix.c9
2 files changed, 6 insertions, 6 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index ad39abe6a..deeb39b48 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -8,7 +8,8 @@ pkgcfgdir= $(pkgdatadir)/config.d/
libexecdir= $(pkglibdir)/libexec/
pkgcfg_DATA = \
- transport.conf
+ transport.conf \
+ communicator-unix.conf
if HAVE_MHD
GN_LIBMHD = -lmicrohttpd
diff --git a/src/transport/gnunet-communicator-unix.c b/src/transport/gnunet-communicator-unix.c
index cd3ae5dce..b2eebbe20 100644
--- a/src/transport/gnunet-communicator-unix.c
+++ b/src/transport/gnunet-communicator-unix.c
@@ -533,6 +533,7 @@ mq_send (struct GNUNET_MQ_Handle *mq,
GNUNET_CONTAINER_DLL_insert (queue_head,
queue_tail,
queue);
+ GNUNET_assert (NULL != unix_sock);
if (NULL == write_task)
write_task =
GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL,
@@ -708,6 +709,7 @@ receive_complete_cb (void *cls,
"# transport transmission failures",
1,
GNUNET_NO);
+ GNUNET_assert (NULL != unix_sock);
if ( (NULL == read_task) &&
(delivering_messages < max_queue_length) )
read_task = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
@@ -735,6 +737,7 @@ select_read_cb (void *cls)
ssize_t ret;
uint16_t msize;
+ GNUNET_assert (NULL != unix_sock);
read_task = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
unix_sock,
&select_read_cb,
@@ -1083,16 +1086,12 @@ run (void *cls,
"%s-%s",
COMMUNICATOR_ADDRESS_PREFIX,
unix_socket_path);
+ GNUNET_free (unix_socket_path);
ai = GNUNET_TRANSPORT_communicator_address_add (ch,
my_addr,
GNUNET_ATS_NET_LOOPBACK,
GNUNET_TIME_UNIT_FOREVER_REL);
GNUNET_free (my_addr);
- GNUNET_free (unix_socket_path);
- read_task = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
- unix_sock,
- &select_read_cb,
- NULL);
}