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/gnunet-service-fs_cp.c | |
parent | fdc0057520fed26405a2ee9d078ed4eea1884e8c (diff) | |
download | gnunet-eae4621c85fc447f0a17197991c0ea2f47c9da53.tar.gz gnunet-eae4621c85fc447f0a17197991c0ea2f47c9da53.zip |
check return values, cancel timeout task
Diffstat (limited to 'src/fs/gnunet-service-fs_cp.c')
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 14 |
1 files changed, 12 insertions, 2 deletions
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); |