From: Christian Grothoff Date: Fri, 27 May 2011 13:32:42 +0000 (+0000) Subject: check return values, cancel timeout task X-Git-Tag: initial-import-from-subversion-38251~18393 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=eae4621c85fc447f0a17197991c0ea2f47c9da53;p=oweals%2Fgnunet.git check return values, cancel timeout task --- diff --git a/src/fs/fs_test_lib_data.conf b/src/fs/fs_test_lib_data.conf index bd1c61cb6..00654c73d 100644 --- a/src/fs/fs_test_lib_data.conf +++ b/src/fs/fs_test_lib_data.conf @@ -55,8 +55,8 @@ HOSTNAME = localhost CONTENT_CACHING = NO CONTENT_PUSHING = NO #DEBUG = YES -#PREFIX = valgrind --tool=memcheck --leak-check=yes --trace-children=yes -#BINARY = /home/grothoff/bin/gnunet-service-fs +PREFIX = valgrind --tool=memcheck --leak-check=yes --trace-children=yes +BINARY = /home/grothoff/bin/gnunet-service-fs #PREFIX = xterm -e gdb -x cmd --args [testing] diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 519e897c5..2d8c879b8 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c @@ -417,6 +417,7 @@ peer_transmit_ready_cb (void *cls, void *buf) { struct GSF_PeerTransmitHandle *pth = cls; + struct GSF_PeerTransmitHandle *pos; struct GSF_ConnectedPeer *cp; size_t ret; @@ -445,9 +446,13 @@ peer_transmit_ready_cb (void *cls, GNUNET_TIME_absolute_get_duration (pth->transmission_request_start_time).rel_value); ret = pth->gmc (pth->gmc_cls, size, buf); + GNUNET_assert (NULL == pth->cth); + for (pos = cp->pth_head; pos != NULL; pos = pos->next) + { + GNUNET_assert (pos != pth); + schedule_transmission (pos); + } GNUNET_free (pth); - for (pth = cp->pth_head; pth != NULL; pth = pth->next) - schedule_transmission (pth); return ret; } @@ -1497,6 +1502,11 @@ GSF_peer_disconnect_handler_ (void *cls, GNUNET_CORE_notify_transmit_ready_cancel (pth->cth); pth->cth = NULL; } + if (pth->timeout_task != GNUNET_SCHEDULER_NO_TASK) + { + GNUNET_SCHEDULER_cancel (pth->timeout_task); + pth->timeout_task = GNUNET_SCHEDULER_NO_TASK; + } GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth); diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c index e4ba2d763..339f98616 100644 --- a/src/fs/gnunet-service-fs_push.c +++ b/src/fs/gnunet-service-fs_push.c @@ -594,7 +594,8 @@ gather_migration_blocks (void *cls, 0, UINT_MAX, GNUNET_TIME_UNIT_FOREVER_REL, &process_migration_content, NULL); - GNUNET_assert (mig_qe != NULL); + if (NULL == mig_qe) + consider_gathering (); } }