aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_cp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-service-fs_cp.c')
-rw-r--r--src/fs/gnunet-service-fs_cp.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c
index 030d8b643..8c956c274 100644
--- a/src/fs/gnunet-service-fs_cp.c
+++ b/src/fs/gnunet-service-fs_cp.c
@@ -86,7 +86,7 @@ struct GSF_PeerTransmitHandle
86 /** 86 /**
87 * Task called on timeout, or 0 for none. 87 * Task called on timeout, or 0 for none.
88 */ 88 */
89 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 89 struct GNUNET_SCHEDULER_Task * timeout_task;
90 90
91 /** 91 /**
92 * Function to call to get the actual message. 92 * Function to call to get the actual message.
@@ -155,7 +155,7 @@ struct GSF_DelayedHandle
155 /** 155 /**
156 * Task for the delay. 156 * Task for the delay.
157 */ 157 */
158 GNUNET_SCHEDULER_TaskIdentifier delay_task; 158 struct GNUNET_SCHEDULER_Task * delay_task;
159 159
160 /** 160 /**
161 * Size of the message. 161 * Size of the message.
@@ -184,7 +184,7 @@ struct PeerRequest
184 /** 184 /**
185 * Task for asynchronous stopping of this request. 185 * Task for asynchronous stopping of this request.
186 */ 186 */
187 GNUNET_SCHEDULER_TaskIdentifier kill_task; 187 struct GNUNET_SCHEDULER_Task * kill_task;
188 188
189}; 189};
190 190
@@ -209,7 +209,7 @@ struct GSF_ConnectedPeer
209 /** 209 /**
210 * Task scheduled to revive migration to this peer. 210 * Task scheduled to revive migration to this peer.
211 */ 211 */
212 GNUNET_SCHEDULER_TaskIdentifier mig_revive_task; 212 struct GNUNET_SCHEDULER_Task * mig_revive_task;
213 213
214 /** 214 /**
215 * Messages (replies, queries, content migration) we would like to 215 * Messages (replies, queries, content migration) we would like to
@@ -248,7 +248,7 @@ struct GSF_ConnectedPeer
248 /** 248 /**
249 * Task scheduled if we need to retry bandwidth reservation later. 249 * Task scheduled if we need to retry bandwidth reservation later.
250 */ 250 */
251 GNUNET_SCHEDULER_TaskIdentifier rc_delay_task; 251 struct GNUNET_SCHEDULER_Task * rc_delay_task;
252 252
253 /** 253 /**
254 * Active requests from this neighbour, map of query to 'struct PeerRequest'. 254 * Active requests from this neighbour, map of query to 'struct PeerRequest'.
@@ -472,10 +472,10 @@ peer_transmit_ready_cb (void *cls, size_t size, void *buf)
472 schedule_transmission (pth); 472 schedule_transmission (pth);
473 return 0; 473 return 0;
474 } 474 }
475 if (GNUNET_SCHEDULER_NO_TASK != pth->timeout_task) 475 if (NULL != pth->timeout_task)
476 { 476 {
477 GNUNET_SCHEDULER_cancel (pth->timeout_task); 477 GNUNET_SCHEDULER_cancel (pth->timeout_task);
478 pth->timeout_task = GNUNET_SCHEDULER_NO_TASK; 478 pth->timeout_task = NULL;
479 } 479 }
480 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth); 480 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
481 if (GNUNET_YES == pth->is_query) 481 if (GNUNET_YES == pth->is_query)
@@ -516,7 +516,7 @@ retry_reservation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
516 struct GNUNET_PeerIdentity target; 516 struct GNUNET_PeerIdentity target;
517 517
518 GNUNET_PEER_resolve (cp->ppd.pid, &target); 518 GNUNET_PEER_resolve (cp->ppd.pid, &target);
519 cp->rc_delay_task = GNUNET_SCHEDULER_NO_TASK; 519 cp->rc_delay_task = NULL;
520 cp->rc = 520 cp->rc =
521 GNUNET_ATS_reserve_bandwidth (GSF_ats, &target, DBLOCK_SIZE, 521 GNUNET_ATS_reserve_bandwidth (GSF_ats, &target, DBLOCK_SIZE,
522 &ats_reserve_callback, cp); 522 &ats_reserve_callback, cp);
@@ -652,7 +652,7 @@ revive_migration (void *cls,
652 struct GSF_ConnectedPeer *cp = cls; 652 struct GSF_ConnectedPeer *cp = cls;
653 struct GNUNET_TIME_Relative bt; 653 struct GNUNET_TIME_Relative bt;
654 654
655 cp->mig_revive_task = GNUNET_SCHEDULER_NO_TASK; 655 cp->mig_revive_task = NULL;
656 bt = GNUNET_TIME_absolute_get_remaining (cp->ppd.migration_blocked_until); 656 bt = GNUNET_TIME_absolute_get_remaining (cp->ppd.migration_blocked_until);
657 if (0 != bt.rel_value_us) 657 if (0 != bt.rel_value_us)
658 { 658 {
@@ -715,7 +715,7 @@ GSF_handle_p2p_migration_stop_ (void *cls,
715 GNUNET_i2s (other), 715 GNUNET_i2s (other),
716 GNUNET_STRINGS_relative_time_to_string (bt, GNUNET_YES)); 716 GNUNET_STRINGS_relative_time_to_string (bt, GNUNET_YES));
717 cp->ppd.migration_blocked_until = GNUNET_TIME_relative_to_absolute (bt); 717 cp->ppd.migration_blocked_until = GNUNET_TIME_relative_to_absolute (bt);
718 if (GNUNET_SCHEDULER_NO_TASK == cp->mig_revive_task) 718 if (NULL == cp->mig_revive_task)
719 { 719 {
720 GSF_push_stop_ (cp); 720 GSF_push_stop_ (cp);
721 cp->mig_revive_task = 721 cp->mig_revive_task =
@@ -773,10 +773,10 @@ free_pending_request (struct PeerRequest *peerreq,
773{ 773{
774 struct GSF_ConnectedPeer *cp = peerreq->cp; 774 struct GSF_ConnectedPeer *cp = peerreq->cp;
775 775
776 if (GNUNET_SCHEDULER_NO_TASK != peerreq->kill_task) 776 if (NULL != peerreq->kill_task)
777 { 777 {
778 GNUNET_SCHEDULER_cancel (peerreq->kill_task); 778 GNUNET_SCHEDULER_cancel (peerreq->kill_task);
779 peerreq->kill_task = GNUNET_SCHEDULER_NO_TASK; 779 peerreq->kill_task = NULL;
780 } 780 }
781 GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# P2P searches active"), 781 GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# P2P searches active"),
782 -1, GNUNET_NO); 782 -1, GNUNET_NO);
@@ -825,7 +825,7 @@ peer_request_destroy (void *cls,
825 struct GSF_PendingRequest *pr = peerreq->pr; 825 struct GSF_PendingRequest *pr = peerreq->pr;
826 struct GSF_PendingRequestData *prd; 826 struct GSF_PendingRequestData *prd;
827 827
828 peerreq->kill_task = GNUNET_SCHEDULER_NO_TASK; 828 peerreq->kill_task = NULL;
829 prd = GSF_pending_request_get_data_ (pr); 829 prd = GSF_pending_request_get_data_ (pr);
830 cancel_pending_request (NULL, &prd->query, peerreq); 830 cancel_pending_request (NULL, &prd->query, peerreq);
831} 831}
@@ -987,7 +987,7 @@ handle_p2p_reply (void *cls,
987 } 987 }
988 if (GNUNET_BLOCK_EVALUATION_OK_LAST != eval) 988 if (GNUNET_BLOCK_EVALUATION_OK_LAST != eval)
989 return; 989 return;
990 if (GNUNET_SCHEDULER_NO_TASK == peerreq->kill_task) 990 if (NULL == peerreq->kill_task)
991 { 991 {
992 GNUNET_STATISTICS_update (GSF_stats, 992 GNUNET_STATISTICS_update (GSF_stats,
993 gettext_noop 993 gettext_noop
@@ -1356,7 +1356,7 @@ peer_transmit_timeout (void *cls,
1356 1356
1357 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1357 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1358 "Timeout trying to transmit to other peer\n"); 1358 "Timeout trying to transmit to other peer\n");
1359 pth->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1359 pth->timeout_task = NULL;
1360 cp = pth->cp; 1360 cp = pth->cp;
1361 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth); 1361 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
1362 if (GNUNET_YES == pth->is_query) 1362 if (GNUNET_YES == pth->is_query)
@@ -1440,10 +1440,10 @@ GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth)
1440{ 1440{
1441 struct GSF_ConnectedPeer *cp; 1441 struct GSF_ConnectedPeer *cp;
1442 1442
1443 if (GNUNET_SCHEDULER_NO_TASK != pth->timeout_task) 1443 if (NULL != pth->timeout_task)
1444 { 1444 {
1445 GNUNET_SCHEDULER_cancel (pth->timeout_task); 1445 GNUNET_SCHEDULER_cancel (pth->timeout_task);
1446 pth->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1446 pth->timeout_task = NULL;
1447 } 1447 }
1448 cp = pth->cp; 1448 cp = pth->cp;
1449 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth); 1449 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
@@ -1586,10 +1586,10 @@ GSF_peer_disconnect_handler_ (void *cls,
1586 GNUNET_ATS_reserve_bandwidth_cancel (cp->rc); 1586 GNUNET_ATS_reserve_bandwidth_cancel (cp->rc);
1587 cp->rc = NULL; 1587 cp->rc = NULL;
1588 } 1588 }
1589 if (GNUNET_SCHEDULER_NO_TASK != cp->rc_delay_task) 1589 if (NULL != cp->rc_delay_task)
1590 { 1590 {
1591 GNUNET_SCHEDULER_cancel (cp->rc_delay_task); 1591 GNUNET_SCHEDULER_cancel (cp->rc_delay_task);
1592 cp->rc_delay_task = GNUNET_SCHEDULER_NO_TASK; 1592 cp->rc_delay_task = NULL;
1593 } 1593 }
1594 GNUNET_CONTAINER_multihashmap_iterate (cp->request_map, 1594 GNUNET_CONTAINER_multihashmap_iterate (cp->request_map,
1595 &cancel_pending_request, cp); 1595 &cancel_pending_request, cp);
@@ -1608,10 +1608,10 @@ GSF_peer_disconnect_handler_ (void *cls,
1608 GNUNET_assert (0 == cp->cth_in_progress); 1608 GNUNET_assert (0 == cp->cth_in_progress);
1609 while (NULL != (pth = cp->pth_head)) 1609 while (NULL != (pth = cp->pth_head))
1610 { 1610 {
1611 if (pth->timeout_task != GNUNET_SCHEDULER_NO_TASK) 1611 if (pth->timeout_task != NULL)
1612 { 1612 {
1613 GNUNET_SCHEDULER_cancel (pth->timeout_task); 1613 GNUNET_SCHEDULER_cancel (pth->timeout_task);
1614 pth->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1614 pth->timeout_task = NULL;
1615 } 1615 }
1616 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth); 1616 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
1617 pth->gmc (pth->gmc_cls, 0, NULL); 1617 pth->gmc (pth->gmc_cls, 0, NULL);
@@ -1625,10 +1625,10 @@ GSF_peer_disconnect_handler_ (void *cls,
1625 GNUNET_free (dh); 1625 GNUNET_free (dh);
1626 } 1626 }
1627 GNUNET_PEER_change_rc (cp->ppd.pid, -1); 1627 GNUNET_PEER_change_rc (cp->ppd.pid, -1);
1628 if (GNUNET_SCHEDULER_NO_TASK != cp->mig_revive_task) 1628 if (NULL != cp->mig_revive_task)
1629 { 1629 {
1630 GNUNET_SCHEDULER_cancel (cp->mig_revive_task); 1630 GNUNET_SCHEDULER_cancel (cp->mig_revive_task);
1631 cp->mig_revive_task = GNUNET_SCHEDULER_NO_TASK; 1631 cp->mig_revive_task = NULL;
1632 } 1632 }
1633 GNUNET_free (cp); 1633 GNUNET_free (cp);
1634} 1634}