diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-05-27 13:32:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-05-27 13:32:42 +0000 |
commit | eae4621c85fc447f0a17197991c0ea2f47c9da53 (patch) | |
tree | b1a6c4f75d15656cd9fe7a31cb63086af6798163 /src/fs | |
parent | fdc0057520fed26405a2ee9d078ed4eea1884e8c (diff) | |
download | gnunet-eae4621c85fc447f0a17197991c0ea2f47c9da53.tar.gz gnunet-eae4621c85fc447f0a17197991c0ea2f47c9da53.zip |
check return values, cancel timeout task
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/fs_test_lib_data.conf | 4 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 14 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_push.c | 3 |
3 files changed, 16 insertions, 5 deletions
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 | |||
55 | CONTENT_CACHING = NO | 55 | CONTENT_CACHING = NO |
56 | CONTENT_PUSHING = NO | 56 | CONTENT_PUSHING = NO |
57 | #DEBUG = YES | 57 | #DEBUG = YES |
58 | #PREFIX = valgrind --tool=memcheck --leak-check=yes --trace-children=yes | 58 | PREFIX = valgrind --tool=memcheck --leak-check=yes --trace-children=yes |
59 | #BINARY = /home/grothoff/bin/gnunet-service-fs | 59 | BINARY = /home/grothoff/bin/gnunet-service-fs |
60 | #PREFIX = xterm -e gdb -x cmd --args | 60 | #PREFIX = xterm -e gdb -x cmd --args |
61 | 61 | ||
62 | [testing] | 62 | [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, | |||
417 | void *buf) | 417 | void *buf) |
418 | { | 418 | { |
419 | struct GSF_PeerTransmitHandle *pth = cls; | 419 | struct GSF_PeerTransmitHandle *pth = cls; |
420 | struct GSF_PeerTransmitHandle *pos; | ||
420 | struct GSF_ConnectedPeer *cp; | 421 | struct GSF_ConnectedPeer *cp; |
421 | size_t ret; | 422 | size_t ret; |
422 | 423 | ||
@@ -445,9 +446,13 @@ peer_transmit_ready_cb (void *cls, | |||
445 | GNUNET_TIME_absolute_get_duration (pth->transmission_request_start_time).rel_value); | 446 | GNUNET_TIME_absolute_get_duration (pth->transmission_request_start_time).rel_value); |
446 | ret = pth->gmc (pth->gmc_cls, | 447 | ret = pth->gmc (pth->gmc_cls, |
447 | size, buf); | 448 | size, buf); |
449 | GNUNET_assert (NULL == pth->cth); | ||
450 | for (pos = cp->pth_head; pos != NULL; pos = pos->next) | ||
451 | { | ||
452 | GNUNET_assert (pos != pth); | ||
453 | schedule_transmission (pos); | ||
454 | } | ||
448 | GNUNET_free (pth); | 455 | GNUNET_free (pth); |
449 | for (pth = cp->pth_head; pth != NULL; pth = pth->next) | ||
450 | schedule_transmission (pth); | ||
451 | return ret; | 456 | return ret; |
452 | } | 457 | } |
453 | 458 | ||
@@ -1497,6 +1502,11 @@ GSF_peer_disconnect_handler_ (void *cls, | |||
1497 | GNUNET_CORE_notify_transmit_ready_cancel (pth->cth); | 1502 | GNUNET_CORE_notify_transmit_ready_cancel (pth->cth); |
1498 | pth->cth = NULL; | 1503 | pth->cth = NULL; |
1499 | } | 1504 | } |
1505 | if (pth->timeout_task != GNUNET_SCHEDULER_NO_TASK) | ||
1506 | { | ||
1507 | GNUNET_SCHEDULER_cancel (pth->timeout_task); | ||
1508 | pth->timeout_task = GNUNET_SCHEDULER_NO_TASK; | ||
1509 | } | ||
1500 | GNUNET_CONTAINER_DLL_remove (cp->pth_head, | 1510 | GNUNET_CONTAINER_DLL_remove (cp->pth_head, |
1501 | cp->pth_tail, | 1511 | cp->pth_tail, |
1502 | pth); | 1512 | 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, | |||
594 | 0, UINT_MAX, | 594 | 0, UINT_MAX, |
595 | GNUNET_TIME_UNIT_FOREVER_REL, | 595 | GNUNET_TIME_UNIT_FOREVER_REL, |
596 | &process_migration_content, NULL); | 596 | &process_migration_content, NULL); |
597 | GNUNET_assert (mig_qe != NULL); | 597 | if (NULL == mig_qe) |
598 | consider_gathering (); | ||
598 | } | 599 | } |
599 | } | 600 | } |
600 | 601 | ||