From c359c3f7d928abf47a0c29d735bb7e30fb55e4dc Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 15 Nov 2018 14:08:31 +0100 Subject: fix double-read task in communicator-unix --- src/transport/Makefile.am | 3 ++- src/transport/gnunet-communicator-unix.c | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/transport') 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); } -- cgit v1.2.3