diff options
Diffstat (limited to 'src/fs/gnunet-service-fs_cp.c')
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 3cabfeaaf..e916a73a8 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c | |||
@@ -522,11 +522,9 @@ peer_transmit_ready_cb (void *cls, | |||
522 | * (re)try to reserve bandwidth from the given peer. | 522 | * (re)try to reserve bandwidth from the given peer. |
523 | * | 523 | * |
524 | * @param cls the `struct GSF_ConnectedPeer` to reserve from | 524 | * @param cls the `struct GSF_ConnectedPeer` to reserve from |
525 | * @param tc scheduler context | ||
526 | */ | 525 | */ |
527 | static void | 526 | static void |
528 | retry_reservation (void *cls, | 527 | retry_reservation (void *cls) |
529 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
530 | { | 528 | { |
531 | struct GSF_ConnectedPeer *cp = cls; | 529 | struct GSF_ConnectedPeer *cp = cls; |
532 | struct GNUNET_PeerIdentity target; | 530 | struct GNUNET_PeerIdentity target; |
@@ -675,11 +673,9 @@ GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer, | |||
675 | * peer. Check, and if so, restart migration. | 673 | * peer. Check, and if so, restart migration. |
676 | * | 674 | * |
677 | * @param cls the `struct GSF_ConnectedPeer` | 675 | * @param cls the `struct GSF_ConnectedPeer` |
678 | * @param tc scheduler context | ||
679 | */ | 676 | */ |
680 | static void | 677 | static void |
681 | revive_migration (void *cls, | 678 | revive_migration (void *cls) |
682 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
683 | { | 679 | { |
684 | struct GSF_ConnectedPeer *cp = cls; | 680 | struct GSF_ConnectedPeer *cp = cls; |
685 | struct GNUNET_TIME_Relative bt; | 681 | struct GNUNET_TIME_Relative bt; |
@@ -854,11 +850,9 @@ cancel_pending_request (void *cls, | |||
854 | * Free the given request. | 850 | * Free the given request. |
855 | * | 851 | * |
856 | * @param cls the request to free | 852 | * @param cls the request to free |
857 | * @param tc task context | ||
858 | */ | 853 | */ |
859 | static void | 854 | static void |
860 | peer_request_destroy (void *cls, | 855 | peer_request_destroy (void *cls) |
861 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
862 | { | 856 | { |
863 | struct PeerRequest *peerreq = cls; | 857 | struct PeerRequest *peerreq = cls; |
864 | struct GSF_PendingRequest *pr = peerreq->pr; | 858 | struct GSF_PendingRequest *pr = peerreq->pr; |
@@ -876,19 +870,19 @@ peer_request_destroy (void *cls, | |||
876 | * The artificial delay is over, transmit the message now. | 870 | * The artificial delay is over, transmit the message now. |
877 | * | 871 | * |
878 | * @param cls the `struct GSF_DelayedHandle` with the message | 872 | * @param cls the `struct GSF_DelayedHandle` with the message |
879 | * @param tc scheduler context | ||
880 | */ | 873 | */ |
881 | static void | 874 | static void |
882 | transmit_delayed_now (void *cls, | 875 | transmit_delayed_now (void *cls) |
883 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
884 | { | 876 | { |
885 | struct GSF_DelayedHandle *dh = cls; | 877 | struct GSF_DelayedHandle *dh = cls; |
886 | struct GSF_ConnectedPeer *cp = dh->cp; | 878 | struct GSF_ConnectedPeer *cp = dh->cp; |
879 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
887 | 880 | ||
888 | GNUNET_CONTAINER_DLL_remove (cp->delayed_head, | 881 | GNUNET_CONTAINER_DLL_remove (cp->delayed_head, |
889 | cp->delayed_tail, | 882 | cp->delayed_tail, |
890 | dh); | 883 | dh); |
891 | cp->delay_queue_size--; | 884 | cp->delay_queue_size--; |
885 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
892 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) | 886 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) |
893 | { | 887 | { |
894 | GNUNET_free (dh->pm); | 888 | GNUNET_free (dh->pm); |
@@ -1490,11 +1484,9 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other, | |||
1490 | * a transmission request. | 1484 | * a transmission request. |
1491 | * | 1485 | * |
1492 | * @param cls the `struct GSF_PeerTransmitHandle` of the request | 1486 | * @param cls the `struct GSF_PeerTransmitHandle` of the request |
1493 | * @param tc scheduler context | ||
1494 | */ | 1487 | */ |
1495 | static void | 1488 | static void |
1496 | peer_transmit_timeout (void *cls, | 1489 | peer_transmit_timeout (void *cls) |
1497 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1498 | { | 1490 | { |
1499 | struct GSF_PeerTransmitHandle *pth = cls; | 1491 | struct GSF_PeerTransmitHandle *pth = cls; |
1500 | struct GSF_ConnectedPeer *cp; | 1492 | struct GSF_ConnectedPeer *cp; |
@@ -1981,18 +1973,17 @@ GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, | |||
1981 | * Call this method periodically to flush respect information to disk. | 1973 | * Call this method periodically to flush respect information to disk. |
1982 | * | 1974 | * |
1983 | * @param cls closure, not used | 1975 | * @param cls closure, not used |
1984 | * @param tc task context, not used | ||
1985 | */ | 1976 | */ |
1986 | static void | 1977 | static void |
1987 | cron_flush_respect (void *cls, | 1978 | cron_flush_respect (void *cls) |
1988 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1989 | { | 1979 | { |
1980 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
1981 | |||
1990 | if (NULL == cp_map) | 1982 | if (NULL == cp_map) |
1991 | return; | 1983 | return; |
1992 | GNUNET_CONTAINER_multipeermap_iterate (cp_map, | 1984 | GNUNET_CONTAINER_multipeermap_iterate (cp_map, |
1993 | &flush_respect, NULL); | 1985 | &flush_respect, NULL); |
1994 | if (NULL == tc) | 1986 | tc = GNUNET_SCHEDULER_get_task_context (); |
1995 | return; | ||
1996 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 1987 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
1997 | return; | 1988 | return; |
1998 | GNUNET_SCHEDULER_add_delayed_with_priority (RESPECT_FLUSH_FREQ, | 1989 | GNUNET_SCHEDULER_add_delayed_with_priority (RESPECT_FLUSH_FREQ, |
@@ -2038,7 +2029,9 @@ clean_peer (void *cls, | |||
2038 | void | 2029 | void |
2039 | GSF_connected_peer_done_ () | 2030 | GSF_connected_peer_done_ () |
2040 | { | 2031 | { |
2041 | cron_flush_respect (NULL, NULL); | 2032 | GNUNET_CONTAINER_multipeermap_iterate (cp_map, |
2033 | &flush_respect, | ||
2034 | NULL); | ||
2042 | GNUNET_CONTAINER_multipeermap_iterate (cp_map, | 2035 | GNUNET_CONTAINER_multipeermap_iterate (cp_map, |
2043 | &clean_peer, NULL); | 2036 | &clean_peer, NULL); |
2044 | GNUNET_CONTAINER_multipeermap_destroy (cp_map); | 2037 | GNUNET_CONTAINER_multipeermap_destroy (cp_map); |