diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-07-24 22:04:41 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-07-24 22:04:41 +0000 |
commit | 70e6847205a9f9b9b660be2a173d5bc309eaa58d (patch) | |
tree | e2649865fbff3e7cbb2e85e381a6268b9aa01e0d | |
parent | 0722614037876469e205546db5ab5fc892b5cf8c (diff) | |
download | gnunet-70e6847205a9f9b9b660be2a173d5bc309eaa58d.tar.gz gnunet-70e6847205a9f9b9b660be2a173d5bc309eaa58d.zip |
quota management and better name for NO_TASK'
'
34 files changed, 446 insertions, 197 deletions
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index 1953bffeb..a84445271 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c | |||
@@ -561,7 +561,7 @@ maint (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
561 | GNUNET_SCHEDULER_add_delayed (tc->sched, | 561 | GNUNET_SCHEDULER_add_delayed (tc->sched, |
562 | GNUNET_YES, | 562 | GNUNET_YES, |
563 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 563 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
564 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 564 | GNUNET_SCHEDULER_NO_TASK, |
565 | MAINT_FREQUENCY, &maint, cfg); | 565 | MAINT_FREQUENCY, &maint, cfg); |
566 | 566 | ||
567 | /* check for services that died (WAITPID) */ | 567 | /* check for services that died (WAITPID) */ |
@@ -723,7 +723,7 @@ run (void *cls, | |||
723 | GNUNET_SCHEDULER_add_delayed (sched, | 723 | GNUNET_SCHEDULER_add_delayed (sched, |
724 | GNUNET_YES, | 724 | GNUNET_YES, |
725 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 725 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
726 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 726 | GNUNET_SCHEDULER_NO_TASK, |
727 | MAINT_FREQUENCY, &maint, NULL); | 727 | MAINT_FREQUENCY, &maint, NULL); |
728 | } | 728 | } |
729 | 729 | ||
diff --git a/src/core/core_api.c b/src/core/core_api.c index a995eb27f..67b21ca26 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c | |||
@@ -277,7 +277,7 @@ timeout_request (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
277 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 277 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
278 | "Transmission request timed out.\n"); | 278 | "Transmission request timed out.\n"); |
279 | h = th->ch; | 279 | h = th->ch; |
280 | th->timeout_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 280 | th->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
281 | GNUNET_assert (0 == th->get_message (th->get_message_cls, 0, NULL)); | 281 | GNUNET_assert (0 == th->get_message (th->get_message_cls, 0, NULL)); |
282 | GNUNET_CORE_notify_transmit_ready_cancel (th); | 282 | GNUNET_CORE_notify_transmit_ready_cancel (th); |
283 | } | 283 | } |
@@ -310,7 +310,7 @@ request_start (void *cls, size_t size, void *buf) | |||
310 | th->timeout_task = GNUNET_SCHEDULER_add_delayed (h->sched, | 310 | th->timeout_task = GNUNET_SCHEDULER_add_delayed (h->sched, |
311 | GNUNET_NO, | 311 | GNUNET_NO, |
312 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 312 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
313 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 313 | GNUNET_SCHEDULER_NO_TASK, |
314 | GNUNET_TIME_absolute_get_remaining | 314 | GNUNET_TIME_absolute_get_remaining |
315 | (th->timeout), | 315 | (th->timeout), |
316 | &timeout_request, th); | 316 | &timeout_request, th); |
@@ -344,7 +344,7 @@ trigger_next_request (struct GNUNET_CORE_Handle *h) | |||
344 | return; /* no requests pending */ | 344 | return; /* no requests pending */ |
345 | GNUNET_assert (NULL == h->th); | 345 | GNUNET_assert (NULL == h->th); |
346 | GNUNET_SCHEDULER_cancel (h->sched, th->timeout_task); | 346 | GNUNET_SCHEDULER_cancel (h->sched, th->timeout_task); |
347 | th->timeout_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 347 | th->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
348 | h->th = GNUNET_CLIENT_notify_transmit_ready (h->client, | 348 | h->th = GNUNET_CLIENT_notify_transmit_ready (h->client, |
349 | th->msize, | 349 | th->msize, |
350 | GNUNET_TIME_absolute_get_remaining | 350 | GNUNET_TIME_absolute_get_remaining |
@@ -660,7 +660,7 @@ static void | |||
660 | reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 660 | reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
661 | { | 661 | { |
662 | struct GNUNET_CORE_Handle *h = cls; | 662 | struct GNUNET_CORE_Handle *h = cls; |
663 | h->reconnect_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 663 | h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; |
664 | reconnect (h); | 664 | reconnect (h); |
665 | } | 665 | } |
666 | 666 | ||
@@ -702,7 +702,7 @@ transmit_start (void *cls, size_t size, void *buf) | |||
702 | h->reconnect_task = | 702 | h->reconnect_task = |
703 | GNUNET_SCHEDULER_add_delayed (h->sched, GNUNET_NO, | 703 | GNUNET_SCHEDULER_add_delayed (h->sched, GNUNET_NO, |
704 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 704 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
705 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 705 | GNUNET_SCHEDULER_NO_TASK, |
706 | delay, &reconnect_task, h); | 706 | delay, &reconnect_task, h); |
707 | return 0; | 707 | return 0; |
708 | } | 708 | } |
@@ -837,7 +837,7 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle) | |||
837 | { | 837 | { |
838 | if (handle->th != NULL) | 838 | if (handle->th != NULL) |
839 | GNUNET_NETWORK_notify_transmit_ready_cancel (handle->th); | 839 | GNUNET_NETWORK_notify_transmit_ready_cancel (handle->th); |
840 | if (handle->reconnect_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 840 | if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK) |
841 | GNUNET_SCHEDULER_cancel (handle->sched, handle->reconnect_task); | 841 | GNUNET_SCHEDULER_cancel (handle->sched, handle->reconnect_task); |
842 | GNUNET_CLIENT_disconnect (handle->client); | 842 | GNUNET_CLIENT_disconnect (handle->client); |
843 | GNUNET_free (handle); | 843 | GNUNET_free (handle); |
@@ -858,7 +858,7 @@ produce_configure_message (void *cls, size_t size, void *buf) | |||
858 | /* communicate handle timeout/error! */ | 858 | /* communicate handle timeout/error! */ |
859 | if (th->info != NULL) | 859 | if (th->info != NULL) |
860 | th->info (th->info_cls, NULL, 0, 0, GNUNET_TIME_UNIT_ZERO, 0, 0.0); | 860 | th->info (th->info_cls, NULL, 0, 0, GNUNET_TIME_UNIT_ZERO, 0, 0.0); |
861 | if (th->timeout_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 861 | if (th->timeout_task != GNUNET_SCHEDULER_NO_TASK) |
862 | GNUNET_CORE_notify_transmit_ready_cancel (th); | 862 | GNUNET_CORE_notify_transmit_ready_cancel (th); |
863 | if (ch->submitted == th) | 863 | if (ch->submitted == th) |
864 | ch->submitted = NULL; | 864 | ch->submitted = NULL; |
@@ -934,7 +934,7 @@ GNUNET_CORE_peer_configure (struct GNUNET_CORE_Handle *handle, | |||
934 | th->timeout_task = GNUNET_SCHEDULER_add_delayed (handle->sched, | 934 | th->timeout_task = GNUNET_SCHEDULER_add_delayed (handle->sched, |
935 | GNUNET_NO, | 935 | GNUNET_NO, |
936 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 936 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
937 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 937 | GNUNET_SCHEDULER_NO_TASK, |
938 | timeout, | 938 | timeout, |
939 | &timeout_request, th); | 939 | &timeout_request, th); |
940 | th->msize = sizeof (struct RequestConfigureMessage); | 940 | th->msize = sizeof (struct RequestConfigureMessage); |
@@ -974,7 +974,7 @@ produce_send (void *cls, size_t size, void *buf) | |||
974 | GNUNET_i2s(&th->peer)); | 974 | GNUNET_i2s(&th->peer)); |
975 | #endif | 975 | #endif |
976 | GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL)); | 976 | GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL)); |
977 | if (th->timeout_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 977 | if (th->timeout_task != GNUNET_SCHEDULER_NO_TASK) |
978 | GNUNET_CORE_notify_transmit_ready_cancel (th); | 978 | GNUNET_CORE_notify_transmit_ready_cancel (th); |
979 | trigger_next_request (h); | 979 | trigger_next_request (h); |
980 | return 0; | 980 | return 0; |
@@ -984,7 +984,7 @@ produce_send (void *cls, size_t size, void *buf) | |||
984 | "Preparing for P2P transmission to `%4s'.\n", | 984 | "Preparing for P2P transmission to `%4s'.\n", |
985 | GNUNET_i2s(&th->peer)); | 985 | GNUNET_i2s(&th->peer)); |
986 | #endif | 986 | #endif |
987 | GNUNET_assert (th->timeout_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); | 987 | GNUNET_assert (th->timeout_task != GNUNET_SCHEDULER_NO_TASK); |
988 | sm = (struct SendMessage *) buf; | 988 | sm = (struct SendMessage *) buf; |
989 | sm->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_SEND); | 989 | sm->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_SEND); |
990 | sm->priority = htonl (th->priority); | 990 | sm->priority = htonl (th->priority); |
@@ -1050,7 +1050,7 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, | |||
1050 | th->timeout_task = GNUNET_SCHEDULER_add_delayed (handle->sched, | 1050 | th->timeout_task = GNUNET_SCHEDULER_add_delayed (handle->sched, |
1051 | GNUNET_NO, | 1051 | GNUNET_NO, |
1052 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 1052 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
1053 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1053 | GNUNET_SCHEDULER_NO_TASK, |
1054 | maxdelay, | 1054 | maxdelay, |
1055 | &timeout_request, th); | 1055 | &timeout_request, th); |
1056 | th->priority = priority; | 1056 | th->priority = priority; |
@@ -1088,7 +1088,7 @@ GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle | |||
1088 | else | 1088 | else |
1089 | h->next->prev = h->prev; | 1089 | h->next->prev = h->prev; |
1090 | } | 1090 | } |
1091 | if (h->timeout_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 1091 | if (h->timeout_task != GNUNET_SCHEDULER_NO_TASK) |
1092 | GNUNET_SCHEDULER_cancel (handle->sched, h->timeout_task); | 1092 | GNUNET_SCHEDULER_cancel (handle->sched, h->timeout_task); |
1093 | GNUNET_free (h); | 1093 | GNUNET_free (h); |
1094 | } | 1094 | } |
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index c4de03350..0a96d8288 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c | |||
@@ -1595,7 +1595,7 @@ retry_plaintext_processing (void *cls, | |||
1595 | { | 1595 | { |
1596 | struct Neighbour *n = cls; | 1596 | struct Neighbour *n = cls; |
1597 | 1597 | ||
1598 | n->retry_plaintext_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1598 | n->retry_plaintext_task = GNUNET_SCHEDULER_NO_TASK; |
1599 | process_plaintext_neighbour_queue (n); | 1599 | process_plaintext_neighbour_queue (n); |
1600 | } | 1600 | } |
1601 | 1601 | ||
@@ -1628,10 +1628,10 @@ process_plaintext_neighbour_queue (struct Neighbour *n) | |||
1628 | struct GNUNET_TIME_Absolute deadline; | 1628 | struct GNUNET_TIME_Absolute deadline; |
1629 | struct GNUNET_TIME_Relative retry_time; | 1629 | struct GNUNET_TIME_Relative retry_time; |
1630 | 1630 | ||
1631 | if (n->retry_plaintext_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 1631 | if (n->retry_plaintext_task != GNUNET_SCHEDULER_NO_TASK) |
1632 | { | 1632 | { |
1633 | GNUNET_SCHEDULER_cancel (sched, n->retry_plaintext_task); | 1633 | GNUNET_SCHEDULER_cancel (sched, n->retry_plaintext_task); |
1634 | n->retry_plaintext_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1634 | n->retry_plaintext_task = GNUNET_SCHEDULER_NO_TASK; |
1635 | } | 1635 | } |
1636 | switch (n->status) | 1636 | switch (n->status) |
1637 | { | 1637 | { |
@@ -1645,7 +1645,7 @@ process_plaintext_neighbour_queue (struct Neighbour *n) | |||
1645 | return; | 1645 | return; |
1646 | case PEER_STATE_KEY_SENT: | 1646 | case PEER_STATE_KEY_SENT: |
1647 | GNUNET_assert (n->retry_set_key_task != | 1647 | GNUNET_assert (n->retry_set_key_task != |
1648 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); | 1648 | GNUNET_SCHEDULER_NO_TASK); |
1649 | #if DEBUG_CORE | 1649 | #if DEBUG_CORE |
1650 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1650 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1651 | "Not yet connected to `%4s', deferring processing of plaintext messages.\n", | 1651 | "Not yet connected to `%4s', deferring processing of plaintext messages.\n", |
@@ -1654,7 +1654,7 @@ process_plaintext_neighbour_queue (struct Neighbour *n) | |||
1654 | return; | 1654 | return; |
1655 | case PEER_STATE_KEY_RECEIVED: | 1655 | case PEER_STATE_KEY_RECEIVED: |
1656 | GNUNET_assert (n->retry_set_key_task != | 1656 | GNUNET_assert (n->retry_set_key_task != |
1657 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); | 1657 | GNUNET_SCHEDULER_NO_TASK); |
1658 | #if DEBUG_CORE | 1658 | #if DEBUG_CORE |
1659 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1659 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1660 | "Not yet connected to `%4s', deferring processing of plaintext messages.\n", | 1660 | "Not yet connected to `%4s', deferring processing of plaintext messages.\n", |
@@ -1705,7 +1705,7 @@ process_plaintext_neighbour_queue (struct Neighbour *n) | |||
1705 | GNUNET_SCHEDULER_add_delayed (sched, | 1705 | GNUNET_SCHEDULER_add_delayed (sched, |
1706 | GNUNET_NO, | 1706 | GNUNET_NO, |
1707 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 1707 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
1708 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1708 | GNUNET_SCHEDULER_NO_TASK, |
1709 | retry_time, | 1709 | retry_time, |
1710 | &retry_plaintext_processing, n); | 1710 | &retry_plaintext_processing, n); |
1711 | return; | 1711 | return; |
@@ -2021,7 +2021,7 @@ set_key_retry_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
2021 | struct Neighbour *n = cls; | 2021 | struct Neighbour *n = cls; |
2022 | 2022 | ||
2023 | GNUNET_assert (n->status != PEER_STATE_KEY_CONFIRMED); | 2023 | GNUNET_assert (n->status != PEER_STATE_KEY_CONFIRMED); |
2024 | n->retry_set_key_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 2024 | n->retry_set_key_task = GNUNET_SCHEDULER_NO_TASK; |
2025 | n->set_key_retry_frequency = | 2025 | n->set_key_retry_frequency = |
2026 | GNUNET_TIME_relative_multiply (n->set_key_retry_frequency, 2); | 2026 | GNUNET_TIME_relative_multiply (n->set_key_retry_frequency, 2); |
2027 | send_key (n); | 2027 | send_key (n); |
@@ -2148,7 +2148,7 @@ send_key (struct Neighbour *n) | |||
2148 | = GNUNET_SCHEDULER_add_delayed (sched, | 2148 | = GNUNET_SCHEDULER_add_delayed (sched, |
2149 | GNUNET_NO, | 2149 | GNUNET_NO, |
2150 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 2150 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
2151 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 2151 | GNUNET_SCHEDULER_NO_TASK, |
2152 | n->set_key_retry_frequency, | 2152 | n->set_key_retry_frequency, |
2153 | &set_key_retry_task, n); | 2153 | &set_key_retry_task, n); |
2154 | } | 2154 | } |
@@ -2484,10 +2484,10 @@ handle_pong (struct Neighbour *n, const struct PingMessage *m) | |||
2484 | return; | 2484 | return; |
2485 | case PEER_STATE_KEY_RECEIVED: | 2485 | case PEER_STATE_KEY_RECEIVED: |
2486 | n->status = PEER_STATE_KEY_CONFIRMED; | 2486 | n->status = PEER_STATE_KEY_CONFIRMED; |
2487 | if (n->retry_set_key_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 2487 | if (n->retry_set_key_task != GNUNET_SCHEDULER_NO_TASK) |
2488 | { | 2488 | { |
2489 | GNUNET_SCHEDULER_cancel (sched, n->retry_set_key_task); | 2489 | GNUNET_SCHEDULER_cancel (sched, n->retry_set_key_task); |
2490 | n->retry_set_key_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 2490 | n->retry_set_key_task = GNUNET_SCHEDULER_NO_TASK; |
2491 | } | 2491 | } |
2492 | process_encrypted_neighbour_queue (n); | 2492 | process_encrypted_neighbour_queue (n); |
2493 | break; | 2493 | break; |
@@ -2883,12 +2883,12 @@ static void | |||
2883 | schedule_quota_update (struct Neighbour *n) | 2883 | schedule_quota_update (struct Neighbour *n) |
2884 | { | 2884 | { |
2885 | GNUNET_assert (n->quota_update_task == | 2885 | GNUNET_assert (n->quota_update_task == |
2886 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); | 2886 | GNUNET_SCHEDULER_NO_TASK); |
2887 | n->quota_update_task | 2887 | n->quota_update_task |
2888 | = GNUNET_SCHEDULER_add_delayed (sched, | 2888 | = GNUNET_SCHEDULER_add_delayed (sched, |
2889 | GNUNET_NO, | 2889 | GNUNET_NO, |
2890 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 2890 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
2891 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 2891 | GNUNET_SCHEDULER_NO_TASK, |
2892 | QUOTA_UPDATE_FREQUENCY, | 2892 | QUOTA_UPDATE_FREQUENCY, |
2893 | &neighbour_quota_update, | 2893 | &neighbour_quota_update, |
2894 | n); | 2894 | n); |
@@ -2912,7 +2912,7 @@ neighbour_quota_update (void *cls, | |||
2912 | double share; | 2912 | double share; |
2913 | unsigned long long distributable; | 2913 | unsigned long long distributable; |
2914 | 2914 | ||
2915 | n->quota_update_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 2915 | n->quota_update_task = GNUNET_SCHEDULER_NO_TASK; |
2916 | /* calculate relative preference among all neighbours; | 2916 | /* calculate relative preference among all neighbours; |
2917 | divides by a bit more to avoid division by zero AND to | 2917 | divides by a bit more to avoid division by zero AND to |
2918 | account for possibility of new neighbours joining any time | 2918 | account for possibility of new neighbours joining any time |
@@ -3022,11 +3022,11 @@ free_neighbour (struct Neighbour *n) | |||
3022 | } | 3022 | } |
3023 | if (NULL != n->th) | 3023 | if (NULL != n->th) |
3024 | GNUNET_TRANSPORT_notify_transmit_ready_cancel (n->th); | 3024 | GNUNET_TRANSPORT_notify_transmit_ready_cancel (n->th); |
3025 | if (n->retry_plaintext_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 3025 | if (n->retry_plaintext_task != GNUNET_SCHEDULER_NO_TASK) |
3026 | GNUNET_SCHEDULER_cancel (sched, n->retry_plaintext_task); | 3026 | GNUNET_SCHEDULER_cancel (sched, n->retry_plaintext_task); |
3027 | if (n->retry_set_key_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 3027 | if (n->retry_set_key_task != GNUNET_SCHEDULER_NO_TASK) |
3028 | GNUNET_SCHEDULER_cancel (sched, n->retry_set_key_task); | 3028 | GNUNET_SCHEDULER_cancel (sched, n->retry_set_key_task); |
3029 | if (n->quota_update_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 3029 | if (n->quota_update_task != GNUNET_SCHEDULER_NO_TASK) |
3030 | GNUNET_SCHEDULER_cancel (sched, n->quota_update_task); | 3030 | GNUNET_SCHEDULER_cancel (sched, n->quota_update_task); |
3031 | GNUNET_free_non_null (n->public_key); | 3031 | GNUNET_free_non_null (n->public_key); |
3032 | GNUNET_free_non_null (n->pending_ping); | 3032 | GNUNET_free_non_null (n->pending_ping); |
@@ -3192,7 +3192,7 @@ run (void *cls, | |||
3192 | GNUNET_SCHEDULER_add_delayed (sched, | 3192 | GNUNET_SCHEDULER_add_delayed (sched, |
3193 | GNUNET_YES, | 3193 | GNUNET_YES, |
3194 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 3194 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
3195 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 3195 | GNUNET_SCHEDULER_NO_TASK, |
3196 | GNUNET_TIME_UNIT_FOREVER_REL, | 3196 | GNUNET_TIME_UNIT_FOREVER_REL, |
3197 | &cleaning_task, NULL); | 3197 | &cleaning_task, NULL); |
3198 | /* process client requests */ | 3198 | /* process client requests */ |
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c index df354a856..f2095025f 100644 --- a/src/core/test_core_api.c +++ b/src/core/test_core_api.c | |||
@@ -173,7 +173,7 @@ process_mtype (void *cls, | |||
173 | GNUNET_SCHEDULER_add_delayed (sched, | 173 | GNUNET_SCHEDULER_add_delayed (sched, |
174 | GNUNET_NO, | 174 | GNUNET_NO, |
175 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 175 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
176 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 176 | GNUNET_SCHEDULER_NO_TASK, |
177 | GNUNET_TIME_UNIT_ZERO, &terminate_task, NULL); | 177 | GNUNET_TIME_UNIT_ZERO, &terminate_task, NULL); |
178 | return GNUNET_OK; | 178 | return GNUNET_OK; |
179 | } | 179 | } |
@@ -202,7 +202,7 @@ transmit_ready (void *cls, size_t size, void *buf) | |||
202 | GNUNET_SCHEDULER_add_delayed (sched, | 202 | GNUNET_SCHEDULER_add_delayed (sched, |
203 | GNUNET_NO, | 203 | GNUNET_NO, |
204 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 204 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
205 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 205 | GNUNET_SCHEDULER_NO_TASK, |
206 | GNUNET_TIME_UNIT_MINUTES, &terminate_task_error, NULL); | 206 | GNUNET_TIME_UNIT_MINUTES, &terminate_task_error, NULL); |
207 | 207 | ||
208 | return sizeof (struct GNUNET_MessageHeader); | 208 | return sizeof (struct GNUNET_MessageHeader); |
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c index 89c5d6af8..cedad3649 100644 --- a/src/datastore/gnunet-service-datastore.c +++ b/src/datastore/gnunet-service-datastore.c | |||
@@ -22,13 +22,6 @@ | |||
22 | * @file datastore/gnunet-service-datastore.c | 22 | * @file datastore/gnunet-service-datastore.c |
23 | * @brief Management for the datastore for files stored on a GNUnet node | 23 | * @brief Management for the datastore for files stored on a GNUnet node |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | * | ||
26 | * TODO: | ||
27 | * quota management code: | ||
28 | * - track storage use | ||
29 | * - refuse above-quota | ||
30 | * - content expiration job | ||
31 | * - near-quota low-priority content discard job | ||
32 | */ | 25 | */ |
33 | 26 | ||
34 | #include "platform.h" | 27 | #include "platform.h" |
@@ -42,6 +35,13 @@ | |||
42 | */ | 35 | */ |
43 | #define MAX_PENDING 1024 | 36 | #define MAX_PENDING 1024 |
44 | 37 | ||
38 | /** | ||
39 | * How long are we at most keeping "expired" content | ||
40 | * past the expiration date in the database? | ||
41 | */ | ||
42 | #define MAX_EXPIRE_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15) | ||
43 | |||
44 | |||
45 | 45 | ||
46 | /** | 46 | /** |
47 | * Our datastore plugin. | 47 | * Our datastore plugin. |
@@ -134,10 +134,34 @@ static int reservation_gen; | |||
134 | static unsigned long long quota; | 134 | static unsigned long long quota; |
135 | 135 | ||
136 | /** | 136 | /** |
137 | * How much space are we using for the cache? | ||
138 | * (space available for insertions that will be | ||
139 | * instantly reclaimed by discarding less | ||
140 | * important content --- or possibly whatever | ||
141 | * we just inserted into the "cache"). | ||
142 | */ | ||
143 | static unsigned long long cache_size; | ||
144 | |||
145 | /** | ||
137 | * How much space have we currently reserved? | 146 | * How much space have we currently reserved? |
138 | */ | 147 | */ |
139 | static unsigned long long reserved; | 148 | static unsigned long long reserved; |
140 | 149 | ||
150 | /** | ||
151 | * Identity of the task that is used to delete | ||
152 | * expired content. | ||
153 | */ | ||
154 | static GNUNET_SCHEDULER_TaskIdentifier expired_kill_task; | ||
155 | |||
156 | /** | ||
157 | * Our configuration. | ||
158 | */ | ||
159 | struct GNUNET_CONFIGURATION_Handle *cfg; | ||
160 | |||
161 | /** | ||
162 | * Our scheduler. | ||
163 | */ | ||
164 | struct GNUNET_SCHEDULER_Handle *sched; | ||
141 | 165 | ||
142 | /** | 166 | /** |
143 | * Function called once the transmit operation has | 167 | * Function called once the transmit operation has |
@@ -149,6 +173,7 @@ static unsigned long long reserved; | |||
149 | typedef void (*TransmitContinuation)(void *cls, | 173 | typedef void (*TransmitContinuation)(void *cls, |
150 | int status); | 174 | int status); |
151 | 175 | ||
176 | |||
152 | struct TransmitCallbackContext | 177 | struct TransmitCallbackContext |
153 | { | 178 | { |
154 | /** | 179 | /** |
@@ -181,6 +206,176 @@ struct TransmitCallbackContext | |||
181 | 206 | ||
182 | 207 | ||
183 | /** | 208 | /** |
209 | * Task that is used to remove expired entries from | ||
210 | * the datastore. This task will schedule itself | ||
211 | * again automatically to always delete all expired | ||
212 | * content quickly. | ||
213 | * | ||
214 | * @param cls not used | ||
215 | * @param tc task context | ||
216 | */ | ||
217 | static void | ||
218 | delete_expired (void *cls, | ||
219 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
220 | |||
221 | |||
222 | /** | ||
223 | * Iterate over the expired items stored in the datastore. | ||
224 | * Delete all expired items; once we have processed all | ||
225 | * expired items, re-schedule the "delete_expired" task. | ||
226 | * | ||
227 | * @param cls not used | ||
228 | * @param next_cls closure to pass to the "next" function. | ||
229 | * @param key key for the content | ||
230 | * @param size number of bytes in data | ||
231 | * @param data content stored | ||
232 | * @param type type of the content | ||
233 | * @param priority priority of the content | ||
234 | * @param anonymity anonymity-level for the content | ||
235 | * @param expiration expiration time for the content | ||
236 | * @param uid unique identifier for the datum; | ||
237 | * maybe 0 if no unique identifier is available | ||
238 | * | ||
239 | * @return GNUNET_SYSERR to abort the iteration, GNUNET_OK to continue | ||
240 | * (continue on call to "next", of course), | ||
241 | * GNUNET_NO to delete the item and continue (if supported) | ||
242 | */ | ||
243 | static int | ||
244 | expired_processor (void *cls, | ||
245 | void *next_cls, | ||
246 | const GNUNET_HashCode * key, | ||
247 | uint32_t size, | ||
248 | const void *data, | ||
249 | uint32_t type, | ||
250 | uint32_t priority, | ||
251 | uint32_t anonymity, | ||
252 | struct GNUNET_TIME_Absolute | ||
253 | expiration, | ||
254 | uint64_t uid) | ||
255 | { | ||
256 | struct GNUNET_TIME_Absolute now; | ||
257 | |||
258 | expired_kill_task = GNUNET_SCHEDULER_NO_TASK; | ||
259 | if (key == NULL) | ||
260 | { | ||
261 | expired_kill_task | ||
262 | = GNUNET_SCHEDULER_add_delayed (sched, | ||
263 | GNUNET_NO, | ||
264 | GNUNET_SCHEDULER_PRIORITY_IDLE, | ||
265 | GNUNET_SCHEDULER_NO_TASK, | ||
266 | MAX_EXPIRE_DELAY, | ||
267 | &delete_expired, | ||
268 | NULL); | ||
269 | return GNUNET_SYSERR; | ||
270 | } | ||
271 | now = GNUNET_TIME_absolute_get (); | ||
272 | if (expiration.value > now.value) | ||
273 | { | ||
274 | /* finished processing */ | ||
275 | plugin->api->next_request (next_cls, GNUNET_YES); | ||
276 | return GNUNET_SYSERR; | ||
277 | } | ||
278 | plugin->api->next_request (next_cls, GNUNET_NO); | ||
279 | return GNUNET_NO; /* delete */ | ||
280 | } | ||
281 | |||
282 | |||
283 | /** | ||
284 | * Task that is used to remove expired entries from | ||
285 | * the datastore. This task will schedule itself | ||
286 | * again automatically to always delete all expired | ||
287 | * content quickly. | ||
288 | * | ||
289 | * @param cls not used | ||
290 | * @param tc task context | ||
291 | */ | ||
292 | static void | ||
293 | delete_expired (void *cls, | ||
294 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
295 | { | ||
296 | plugin->api->iter_ascending_expiration (plugin->api->cls, | ||
297 | 0, | ||
298 | &expired_processor, | ||
299 | NULL); | ||
300 | } | ||
301 | |||
302 | |||
303 | /** | ||
304 | * An iterator over a set of items stored in the datastore. | ||
305 | * | ||
306 | * @param cls closure | ||
307 | * @param next_cls closure to pass to the "next" function. | ||
308 | * @param key key for the content | ||
309 | * @param size number of bytes in data | ||
310 | * @param data content stored | ||
311 | * @param type type of the content | ||
312 | * @param priority priority of the content | ||
313 | * @param anonymity anonymity-level for the content | ||
314 | * @param expiration expiration time for the content | ||
315 | * @param uid unique identifier for the datum; | ||
316 | * maybe 0 if no unique identifier is available | ||
317 | * | ||
318 | * @return GNUNET_SYSERR to abort the iteration, GNUNET_OK to continue | ||
319 | * (continue on call to "next", of course), | ||
320 | * GNUNET_NO to delete the item and continue (if supported) | ||
321 | */ | ||
322 | static int | ||
323 | manage (void *cls, | ||
324 | void *next_cls, | ||
325 | const GNUNET_HashCode * key, | ||
326 | uint32_t size, | ||
327 | const void *data, | ||
328 | uint32_t type, | ||
329 | uint32_t priority, | ||
330 | uint32_t anonymity, | ||
331 | struct GNUNET_TIME_Absolute | ||
332 | expiration, | ||
333 | uint64_t uid) | ||
334 | { | ||
335 | unsigned long long *need = cls; | ||
336 | |||
337 | if (NULL == key) | ||
338 | { | ||
339 | GNUNET_free (need); | ||
340 | return GNUNET_SYSERR; | ||
341 | } | ||
342 | if (size + GNUNET_DATASTORE_ENTRY_OVERHEAD > *need) | ||
343 | *need = 0; | ||
344 | else | ||
345 | *need -= size + GNUNET_DATASTORE_ENTRY_OVERHEAD; | ||
346 | plugin->api->next_request (next_cls, | ||
347 | (0 == *need) ? GNUNET_YES : GNUNET_NO); | ||
348 | return GNUNET_NO; | ||
349 | } | ||
350 | |||
351 | |||
352 | /** | ||
353 | * Manage available disk space by running tasks | ||
354 | * that will discard content if necessary. This | ||
355 | * function will be run whenever a request for | ||
356 | * "need" bytes of storage could only be satisfied | ||
357 | * by eating into the "cache" (and we want our cache | ||
358 | * space back). | ||
359 | * | ||
360 | * @param need number of bytes of content that were | ||
361 | * placed into the "cache" (and hence the | ||
362 | * number of bytes that should be removed). | ||
363 | */ | ||
364 | static void | ||
365 | manage_space (unsigned long long need) | ||
366 | { | ||
367 | unsigned long long *n; | ||
368 | |||
369 | n = GNUNET_malloc (sizeof(unsigned long long)); | ||
370 | *n = need; | ||
371 | plugin->api->iter_low_priority (plugin->api->cls, | ||
372 | 0, | ||
373 | &manage, | ||
374 | n); | ||
375 | } | ||
376 | |||
377 | |||
378 | /** | ||
184 | * Function called to notify a client about the socket | 379 | * Function called to notify a client about the socket |
185 | * begin ready to queue more data. "buf" will be | 380 | * begin ready to queue more data. "buf" will be |
186 | * NULL and "size" zero if the socket was closed for | 381 | * NULL and "size" zero if the socket was closed for |
@@ -446,13 +641,32 @@ handle_reserve (void *cls, | |||
446 | if (used + req > quota) | 641 | if (used + req > quota) |
447 | { | 642 | { |
448 | if (quota < used) | 643 | if (quota < used) |
449 | used = quota; /* cheat a bit */ | 644 | used = quota; /* cheat a bit for error message (to avoid negative numbers) */ |
450 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 645 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
451 | _("Insufficient space (%llu bytes are available) to satisfy `%s' request for %llu bytes\n"), | 646 | _("Insufficient space (%llu bytes are available) to satisfy `%s' request for %llu bytes\n"), |
452 | quota - used, | 647 | quota - used, |
453 | "RESERVE", | 648 | "RESERVE", |
454 | req); | 649 | req); |
455 | transmit_status (client, 0, gettext_noop ("Insufficient space to satisfy request")); | 650 | if (cache_size < req) |
651 | { | ||
652 | /* TODO: document this in the FAQ; essentially, if this | ||
653 | message happens, the insertion request could be blocked | ||
654 | by less-important content from migration because it is | ||
655 | larger than 1/8th of the overall available space, and | ||
656 | we only reserve 1/8th for "fresh" insertions */ | ||
657 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
658 | _("The requested amount (%llu bytes) is larger than the cache size (%llu bytes)\n"), | ||
659 | req, | ||
660 | cache_size); | ||
661 | transmit_status (client, 0, | ||
662 | gettext_noop ("Insufficient space to satisfy request and " | ||
663 | "requested amount is larger than cache size")); | ||
664 | } | ||
665 | else | ||
666 | { | ||
667 | transmit_status (client, 0, | ||
668 | gettext_noop ("Insufficient space to satisfy request")); | ||
669 | } | ||
456 | return; | 670 | return; |
457 | } | 671 | } |
458 | reserved += req; | 672 | reserved += req; |
@@ -623,6 +837,8 @@ handle_put (void *cls, | |||
623 | (GNUNET_SYSERR == ret) ? GNUNET_SYSERR : GNUNET_OK, | 837 | (GNUNET_SYSERR == ret) ? GNUNET_SYSERR : GNUNET_OK, |
624 | msg); | 838 | msg); |
625 | GNUNET_free_non_null (msg); | 839 | GNUNET_free_non_null (msg); |
840 | if (quota - reserved - cache_size < plugin->api->get_size (plugin->api->cls)) | ||
841 | manage_space (size + GNUNET_DATASTORE_ENTRY_OVERHEAD); | ||
626 | } | 842 | } |
627 | 843 | ||
628 | 844 | ||
@@ -894,8 +1110,7 @@ static struct GNUNET_SERVER_MessageHandler handlers[] = { | |||
894 | * Load the datastore plugin. | 1110 | * Load the datastore plugin. |
895 | */ | 1111 | */ |
896 | static struct DatastorePlugin * | 1112 | static struct DatastorePlugin * |
897 | load_plugin (struct GNUNET_CONFIGURATION_Handle *cfg, | 1113 | load_plugin () |
898 | struct GNUNET_SCHEDULER_Handle *sched) | ||
899 | { | 1114 | { |
900 | struct DatastorePlugin *ret; | 1115 | struct DatastorePlugin *ret; |
901 | char *libname; | 1116 | char *libname; |
@@ -978,7 +1193,30 @@ cleanup_reservations (void *cls, | |||
978 | struct GNUNET_SERVER_Client | 1193 | struct GNUNET_SERVER_Client |
979 | * client) | 1194 | * client) |
980 | { | 1195 | { |
981 | /* FIXME */ | 1196 | struct ReservationList *pos; |
1197 | struct ReservationList *prev; | ||
1198 | struct ReservationList *next; | ||
1199 | |||
1200 | prev = NULL; | ||
1201 | pos = reservations; | ||
1202 | while (NULL != pos) | ||
1203 | { | ||
1204 | next = pos->next; | ||
1205 | if (pos->client == client) | ||
1206 | { | ||
1207 | if (prev == NULL) | ||
1208 | reservations = next; | ||
1209 | else | ||
1210 | prev->next = next; | ||
1211 | reserved -= pos->amount + pos->entries * GNUNET_DATASTORE_ENTRY_OVERHEAD; | ||
1212 | GNUNET_free (pos); | ||
1213 | } | ||
1214 | else | ||
1215 | { | ||
1216 | prev = pos; | ||
1217 | } | ||
1218 | pos = next; | ||
1219 | } | ||
982 | } | 1220 | } |
983 | 1221 | ||
984 | 1222 | ||
@@ -986,19 +1224,21 @@ cleanup_reservations (void *cls, | |||
986 | * Process datastore requests. | 1224 | * Process datastore requests. |
987 | * | 1225 | * |
988 | * @param cls closure | 1226 | * @param cls closure |
989 | * @param sched scheduler to use | 1227 | * @param s scheduler to use |
990 | * @param server the initialized server | 1228 | * @param server the initialized server |
991 | * @param cfg configuration to use | 1229 | * @param c configuration to use |
992 | */ | 1230 | */ |
993 | static void | 1231 | static void |
994 | run (void *cls, | 1232 | run (void *cls, |
995 | struct GNUNET_SCHEDULER_Handle *sched, | 1233 | struct GNUNET_SCHEDULER_Handle *s, |
996 | struct GNUNET_SERVER_Handle *server, | 1234 | struct GNUNET_SERVER_Handle *server, |
997 | struct GNUNET_CONFIGURATION_Handle *cfg) | 1235 | struct GNUNET_CONFIGURATION_Handle *c) |
998 | { | 1236 | { |
999 | char *fn; | 1237 | char *fn; |
1000 | unsigned int bf_size; | 1238 | unsigned int bf_size; |
1001 | 1239 | ||
1240 | sched = s; | ||
1241 | cfg = c; | ||
1002 | if (GNUNET_OK != | 1242 | if (GNUNET_OK != |
1003 | GNUNET_CONFIGURATION_get_value_number (cfg, | 1243 | GNUNET_CONFIGURATION_get_value_number (cfg, |
1004 | "DATASTORE", "QUOTA", "a)) | 1244 | "DATASTORE", "QUOTA", "a)) |
@@ -1009,6 +1249,7 @@ run (void *cls, | |||
1009 | "DATASTORE"); | 1249 | "DATASTORE"); |
1010 | return; | 1250 | return; |
1011 | } | 1251 | } |
1252 | cache_size = quota / 8; /* Or should we make this an option? */ | ||
1012 | bf_size = quota / 32; /* 8 bit per entry, 1 bit per 32 kb in DB */ | 1253 | bf_size = quota / 32; /* 8 bit per entry, 1 bit per 32 kb in DB */ |
1013 | fn = NULL; | 1254 | fn = NULL; |
1014 | if ( (GNUNET_OK != | 1255 | if ( (GNUNET_OK != |
@@ -1033,7 +1274,7 @@ run (void *cls, | |||
1033 | _("Failed to initialize bloomfilter.\n")); | 1274 | _("Failed to initialize bloomfilter.\n")); |
1034 | return; | 1275 | return; |
1035 | } | 1276 | } |
1036 | plugin = load_plugin (cfg, sched); | 1277 | plugin = load_plugin (); |
1037 | if (NULL == plugin) | 1278 | if (NULL == plugin) |
1038 | { | 1279 | { |
1039 | GNUNET_CONTAINER_bloomfilter_free (filter); | 1280 | GNUNET_CONTAINER_bloomfilter_free (filter); |
@@ -1041,12 +1282,20 @@ run (void *cls, | |||
1041 | } | 1282 | } |
1042 | GNUNET_SERVER_disconnect_notify (server, &cleanup_reservations, NULL); | 1283 | GNUNET_SERVER_disconnect_notify (server, &cleanup_reservations, NULL); |
1043 | GNUNET_SERVER_add_handlers (server, handlers); | 1284 | GNUNET_SERVER_add_handlers (server, handlers); |
1285 | expired_kill_task | ||
1286 | = GNUNET_SCHEDULER_add_delayed (sched, | ||
1287 | GNUNET_NO, | ||
1288 | GNUNET_SCHEDULER_PRIORITY_IDLE, | ||
1289 | GNUNET_SCHEDULER_NO_TASK, | ||
1290 | GNUNET_TIME_UNIT_ZERO, | ||
1291 | &delete_expired, NULL); | ||
1044 | GNUNET_SCHEDULER_add_delayed (sched, | 1292 | GNUNET_SCHEDULER_add_delayed (sched, |
1045 | GNUNET_YES, | 1293 | GNUNET_YES, |
1046 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 1294 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
1047 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1295 | GNUNET_SCHEDULER_NO_TASK, |
1048 | GNUNET_TIME_UNIT_FOREVER_REL, | 1296 | GNUNET_TIME_UNIT_FOREVER_REL, |
1049 | &cleaning_task, NULL); | 1297 | &cleaning_task, NULL); |
1298 | |||
1050 | } | 1299 | } |
1051 | 1300 | ||
1052 | 1301 | ||
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c index 948097e9c..d488cef4c 100644 --- a/src/datastore/perf_datastore_api.c +++ b/src/datastore/perf_datastore_api.c | |||
@@ -223,7 +223,7 @@ delete_value (void *cls, | |||
223 | GNUNET_SCHEDULER_add_after (crc->sched, | 223 | GNUNET_SCHEDULER_add_after (crc->sched, |
224 | GNUNET_NO, | 224 | GNUNET_NO, |
225 | GNUNET_SCHEDULER_PRIORITY_HIGH, | 225 | GNUNET_SCHEDULER_PRIORITY_HIGH, |
226 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 226 | GNUNET_SCHEDULER_NO_TASK, |
227 | &do_delete, | 227 | &do_delete, |
228 | crc); | 228 | crc); |
229 | return; | 229 | return; |
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c index 6b5ae9a28..dae8e7432 100644 --- a/src/datastore/perf_plugin_datastore.c +++ b/src/datastore/perf_plugin_datastore.c | |||
@@ -170,7 +170,7 @@ iterateDummy (void *cls, | |||
170 | GNUNET_SCHEDULER_add_after (crc->sched, | 170 | GNUNET_SCHEDULER_add_after (crc->sched, |
171 | GNUNET_NO, | 171 | GNUNET_NO, |
172 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 172 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
173 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 173 | GNUNET_SCHEDULER_NO_TASK, |
174 | &test, crc); | 174 | &test, crc); |
175 | return GNUNET_OK; | 175 | return GNUNET_OK; |
176 | } | 176 | } |
@@ -255,7 +255,7 @@ test (void *cls, | |||
255 | GNUNET_SCHEDULER_add_after (crc->sched, | 255 | GNUNET_SCHEDULER_add_after (crc->sched, |
256 | GNUNET_NO, | 256 | GNUNET_NO, |
257 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 257 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
258 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 258 | GNUNET_SCHEDULER_NO_TASK, |
259 | &test, crc); | 259 | &test, crc); |
260 | break; | 260 | break; |
261 | case RP_LP_GET: | 261 | case RP_LP_GET: |
@@ -303,7 +303,7 @@ test (void *cls, | |||
303 | GNUNET_SCHEDULER_add_delayed (crc->sched, | 303 | GNUNET_SCHEDULER_add_delayed (crc->sched, |
304 | GNUNET_YES, | 304 | GNUNET_YES, |
305 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 305 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
306 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 306 | GNUNET_SCHEDULER_NO_TASK, |
307 | GNUNET_TIME_UNIT_ZERO, | 307 | GNUNET_TIME_UNIT_ZERO, |
308 | &cleaning_task, crc); | 308 | &cleaning_task, crc); |
309 | break; | 309 | break; |
@@ -365,7 +365,7 @@ run (void *cls, | |||
365 | GNUNET_SCHEDULER_add_after (s, | 365 | GNUNET_SCHEDULER_add_after (s, |
366 | GNUNET_YES, | 366 | GNUNET_YES, |
367 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 367 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
368 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 368 | GNUNET_SCHEDULER_NO_TASK, |
369 | &test, crc); | 369 | &test, crc); |
370 | } | 370 | } |
371 | 371 | ||
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c index ce92d3882..9a807463a 100644 --- a/src/datastore/plugin_datastore_sqlite.c +++ b/src/datastore/plugin_datastore_sqlite.c | |||
@@ -632,7 +632,7 @@ sqlite_next_request (void *next_cls, | |||
632 | if (GNUNET_YES == end_it) | 632 | if (GNUNET_YES == end_it) |
633 | nc->end_it = GNUNET_YES; | 633 | nc->end_it = GNUNET_YES; |
634 | GNUNET_SCHEDULER_add_continuation (nc->plugin->env->sched, | 634 | GNUNET_SCHEDULER_add_continuation (nc->plugin->env->sched, |
635 | GNUNET_NO, | 635 | GNUNET_NO, |
636 | &sqlite_next_request_cont, | 636 | &sqlite_next_request_cont, |
637 | nc, | 637 | nc, |
638 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 638 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c index ceb3415d5..281459b75 100644 --- a/src/hostlist/gnunet-daemon-hostlist.c +++ b/src/hostlist/gnunet-daemon-hostlist.c | |||
@@ -178,7 +178,7 @@ run (void *cls, | |||
178 | GNUNET_SCHEDULER_add_delayed (sched, | 178 | GNUNET_SCHEDULER_add_delayed (sched, |
179 | GNUNET_YES, | 179 | GNUNET_YES, |
180 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 180 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
181 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 181 | GNUNET_SCHEDULER_NO_TASK, |
182 | GNUNET_TIME_UNIT_FOREVER_REL, | 182 | GNUNET_TIME_UNIT_FOREVER_REL, |
183 | &cleaning_task, NULL); | 183 | &cleaning_task, NULL); |
184 | } | 184 | } |
diff --git a/src/hostlist/hostlist-client.c b/src/hostlist/hostlist-client.c index 5008b41fc..785e189ab 100644 --- a/src/hostlist/hostlist-client.c +++ b/src/hostlist/hostlist-client.c | |||
@@ -399,7 +399,7 @@ run_multi () | |||
399 | = GNUNET_SCHEDULER_add_select (sched, | 399 | = GNUNET_SCHEDULER_add_select (sched, |
400 | GNUNET_NO, | 400 | GNUNET_NO, |
401 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, | 401 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, |
402 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 402 | GNUNET_SCHEDULER_NO_TASK, |
403 | GNUNET_TIME_UNIT_MINUTES, | 403 | GNUNET_TIME_UNIT_MINUTES, |
404 | max, | 404 | max, |
405 | &rs, | 405 | &rs, |
@@ -543,7 +543,7 @@ schedule_hostlist_task () | |||
543 | current_task = GNUNET_SCHEDULER_add_delayed (sched, | 543 | current_task = GNUNET_SCHEDULER_add_delayed (sched, |
544 | GNUNET_NO, | 544 | GNUNET_NO, |
545 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 545 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
546 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 546 | GNUNET_SCHEDULER_NO_TASK, |
547 | delay, | 547 | delay, |
548 | &check_task, | 548 | &check_task, |
549 | NULL); | 549 | NULL); |
diff --git a/src/hostlist/hostlist-server.c b/src/hostlist/hostlist-server.c index dabc40d03..6139283ed 100644 --- a/src/hostlist/hostlist-server.c +++ b/src/hostlist/hostlist-server.c | |||
@@ -94,7 +94,7 @@ finish_response (struct HostSet *results) | |||
94 | GNUNET_SCHEDULER_add_delayed (sched, | 94 | GNUNET_SCHEDULER_add_delayed (sched, |
95 | GNUNET_NO, | 95 | GNUNET_NO, |
96 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 96 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
97 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 97 | GNUNET_SCHEDULER_NO_TASK, |
98 | RESPONSE_UPDATE_FREQUENCY, | 98 | RESPONSE_UPDATE_FREQUENCY, |
99 | &update_response, | 99 | &update_response, |
100 | NULL); | 100 | NULL); |
@@ -242,7 +242,7 @@ prepare_daemon () | |||
242 | = GNUNET_SCHEDULER_add_select (sched, | 242 | = GNUNET_SCHEDULER_add_select (sched, |
243 | GNUNET_NO, | 243 | GNUNET_NO, |
244 | GNUNET_SCHEDULER_PRIORITY_HIGH, | 244 | GNUNET_SCHEDULER_PRIORITY_HIGH, |
245 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 245 | GNUNET_SCHEDULER_NO_TASK, |
246 | tv, | 246 | tv, |
247 | max, | 247 | max, |
248 | &rs, | 248 | &rs, |
@@ -301,7 +301,7 @@ void | |||
301 | GNUNET_HOSTLIST_server_stop () | 301 | GNUNET_HOSTLIST_server_stop () |
302 | { | 302 | { |
303 | GNUNET_SCHEDULER_cancel (sched, hostlist_task); | 303 | GNUNET_SCHEDULER_cancel (sched, hostlist_task); |
304 | hostlist_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 304 | hostlist_task = GNUNET_SCHEDULER_NO_TASK; |
305 | MHD_stop_daemon (daemon_handle); | 305 | MHD_stop_daemon (daemon_handle); |
306 | daemon_handle = NULL; | 306 | daemon_handle = NULL; |
307 | } | 307 | } |
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index 8731eacec..26a39d575 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h | |||
@@ -202,7 +202,7 @@ void GNUNET_NETWORK_socket_destroy (struct GNUNET_NETWORK_SocketHandle *sock); | |||
202 | * @param timeout maximum amount of time to wait | 202 | * @param timeout maximum amount of time to wait |
203 | * @param receiver function to call with received data | 203 | * @param receiver function to call with received data |
204 | * @param receiver_cls closure for receiver | 204 | * @param receiver_cls closure for receiver |
205 | * @return scheduler task ID used for receiving, GNUNET_SCHEDULER_NO_PREREQUISITE_TASK on error | 205 | * @return scheduler task ID used for receiving, GNUNET_SCHEDULER_NO_TASK on error |
206 | */ | 206 | */ |
207 | GNUNET_SCHEDULER_TaskIdentifier | 207 | GNUNET_SCHEDULER_TaskIdentifier |
208 | GNUNET_NETWORK_receive (struct GNUNET_NETWORK_SocketHandle *sock, | 208 | GNUNET_NETWORK_receive (struct GNUNET_NETWORK_SocketHandle *sock, |
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h index aa5830942..d4013e630 100644 --- a/src/include/gnunet_scheduler_lib.h +++ b/src/include/gnunet_scheduler_lib.h | |||
@@ -54,7 +54,7 @@ typedef unsigned long long GNUNET_SCHEDULER_TaskIdentifier; | |||
54 | * Constant used to indicate that the scheduled | 54 | * Constant used to indicate that the scheduled |
55 | * task has no others as prerequisites. | 55 | * task has no others as prerequisites. |
56 | */ | 56 | */ |
57 | #define GNUNET_SCHEDULER_NO_PREREQUISITE_TASK ((GNUNET_SCHEDULER_TaskIdentifier) 0) | 57 | #define GNUNET_SCHEDULER_NO_TASK ((GNUNET_SCHEDULER_TaskIdentifier) 0) |
58 | 58 | ||
59 | /** | 59 | /** |
60 | * Reasons why the schedule may have triggered | 60 | * Reasons why the schedule may have triggered |
@@ -272,7 +272,7 @@ GNUNET_SCHEDULER_add_continuation (struct GNUNET_SCHEDULER_Handle *sched, | |||
272 | * @param prerequisite_task run this task after the task with the given | 272 | * @param prerequisite_task run this task after the task with the given |
273 | * task identifier completes (and any of our other | 273 | * task identifier completes (and any of our other |
274 | * conditions, such as delay, read or write-readyness | 274 | * conditions, such as delay, read or write-readyness |
275 | * are satisfied). Use GNUNET_SCHEDULER_NO_PREREQUISITE_TASK to not have any dependency | 275 | * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency |
276 | * on completion of other tasks. | 276 | * on completion of other tasks. |
277 | * @param main main function of the task | 277 | * @param main main function of the task |
278 | * @param cls closure of task | 278 | * @param cls closure of task |
@@ -302,7 +302,7 @@ GNUNET_SCHEDULER_add_after (struct GNUNET_SCHEDULER_Handle *sched, | |||
302 | * @param prerequisite_task run this task after the task with the given | 302 | * @param prerequisite_task run this task after the task with the given |
303 | * task identifier completes (and any of our other | 303 | * task identifier completes (and any of our other |
304 | * conditions, such as delay, read or write-readyness | 304 | * conditions, such as delay, read or write-readyness |
305 | * are satisfied). Use GNUNET_SCHEDULER_NO_PREREQUISITE_TASK to not have any dependency | 305 | * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency |
306 | * on completion of other tasks. | 306 | * on completion of other tasks. |
307 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" | 307 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" |
308 | * @param main main function of the task | 308 | * @param main main function of the task |
@@ -335,7 +335,7 @@ GNUNET_SCHEDULER_add_delayed (struct GNUNET_SCHEDULER_Handle *sched, | |||
335 | * @param prerequisite_task run this task after the task with the given | 335 | * @param prerequisite_task run this task after the task with the given |
336 | * task identifier completes (and any of our other | 336 | * task identifier completes (and any of our other |
337 | * conditions, such as delay, read or write-readyness | 337 | * conditions, such as delay, read or write-readyness |
338 | * are satisfied). Use GNUNET_SCHEDULER_NO_PREREQUISITE_TASK to not have any dependency | 338 | * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency |
339 | * on completion of other tasks. | 339 | * on completion of other tasks. |
340 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" | 340 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" |
341 | * @param rfd read file-descriptor | 341 | * @param rfd read file-descriptor |
@@ -368,7 +368,7 @@ GNUNET_SCHEDULER_add_read (struct GNUNET_SCHEDULER_Handle *sched, | |||
368 | * @param prerequisite_task run this task after the task with the given | 368 | * @param prerequisite_task run this task after the task with the given |
369 | * task identifier completes (and any of our other | 369 | * task identifier completes (and any of our other |
370 | * conditions, such as delay, read or write-readyness | 370 | * conditions, such as delay, read or write-readyness |
371 | * are satisfied). Use GNUNET_SCHEDULER_NO_PREREQUISITE_TASK to not have any dependency | 371 | * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency |
372 | * on completion of other tasks. | 372 | * on completion of other tasks. |
373 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" | 373 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" |
374 | * @param wfd write file-descriptor | 374 | * @param wfd write file-descriptor |
@@ -411,7 +411,7 @@ GNUNET_SCHEDULER_add_write (struct GNUNET_SCHEDULER_Handle *sched, | |||
411 | * @param prerequisite_task run this task after the task with the given | 411 | * @param prerequisite_task run this task after the task with the given |
412 | * task identifier completes (and any of our other | 412 | * task identifier completes (and any of our other |
413 | * conditions, such as delay, read or write-readyness | 413 | * conditions, such as delay, read or write-readyness |
414 | * are satisfied). Use GNUNET_SCHEDULER_NO_PREREQUISITE_TASK to not have any dependency | 414 | * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency |
415 | * on completion of other tasks. | 415 | * on completion of other tasks. |
416 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" | 416 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" |
417 | * @param nfds highest-numbered file descriptor in any of the two sets plus one | 417 | * @param nfds highest-numbered file descriptor in any of the two sets plus one |
diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h index 44db9ce70..aa79d7833 100644 --- a/src/include/gnunet_server_lib.h +++ b/src/include/gnunet_server_lib.h | |||
@@ -254,7 +254,7 @@ struct GNUNET_SERVER_Client *GNUNET_SERVER_connect_socket (struct | |||
254 | * @param receiver function to call with received data | 254 | * @param receiver function to call with received data |
255 | * @param receiver_cls closure for receiver | 255 | * @param receiver_cls closure for receiver |
256 | * @return task identifier that can be used to cancel the receive, | 256 | * @return task identifier that can be used to cancel the receive, |
257 | * GNUNET_SCHEDULER_NO_PREREQUISITE_TASK should be returned | 257 | * GNUNET_SCHEDULER_NO_TASK should be returned |
258 | * if the receiver function was already called | 258 | * if the receiver function was already called |
259 | */ | 259 | */ |
260 | typedef GNUNET_SCHEDULER_TaskIdentifier | 260 | typedef GNUNET_SCHEDULER_TaskIdentifier |
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c index 752629cb5..6b709e84a 100644 --- a/src/peerinfo/gnunet-service-peerinfo.c +++ b/src/peerinfo/gnunet-service-peerinfo.c | |||
@@ -336,7 +336,7 @@ cron_scan_directory_data_hosts (void *cls, | |||
336 | GNUNET_SCHEDULER_add_delayed (tc->sched, | 336 | GNUNET_SCHEDULER_add_delayed (tc->sched, |
337 | GNUNET_NO, | 337 | GNUNET_NO, |
338 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 338 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
339 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 339 | GNUNET_SCHEDULER_NO_TASK, |
340 | DATA_HOST_FREQ, | 340 | DATA_HOST_FREQ, |
341 | &cron_scan_directory_data_hosts, NULL); | 341 | &cron_scan_directory_data_hosts, NULL); |
342 | } | 342 | } |
@@ -485,7 +485,7 @@ cron_flush_trust (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
485 | GNUNET_SCHEDULER_add_delayed (tc->sched, | 485 | GNUNET_SCHEDULER_add_delayed (tc->sched, |
486 | GNUNET_YES, | 486 | GNUNET_YES, |
487 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 487 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
488 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 488 | GNUNET_SCHEDULER_NO_TASK, |
489 | TRUST_FLUSH_FREQ, &cron_flush_trust, NULL); | 489 | TRUST_FLUSH_FREQ, &cron_flush_trust, NULL); |
490 | } | 490 | } |
491 | 491 | ||
@@ -545,7 +545,7 @@ cron_clean_data_hosts (void *cls, | |||
545 | GNUNET_SCHEDULER_add_delayed (tc->sched, | 545 | GNUNET_SCHEDULER_add_delayed (tc->sched, |
546 | GNUNET_NO, | 546 | GNUNET_NO, |
547 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 547 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
548 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 548 | GNUNET_SCHEDULER_NO_TASK, |
549 | DATA_HOST_CLEAN_FREQ, | 549 | DATA_HOST_CLEAN_FREQ, |
550 | &cron_clean_data_hosts, NULL); | 550 | &cron_clean_data_hosts, NULL); |
551 | } | 551 | } |
@@ -669,18 +669,18 @@ run (void *cls, | |||
669 | GNUNET_SCHEDULER_add_delayed (sched, | 669 | GNUNET_SCHEDULER_add_delayed (sched, |
670 | GNUNET_NO, | 670 | GNUNET_NO, |
671 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 671 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
672 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 672 | GNUNET_SCHEDULER_NO_TASK, |
673 | GNUNET_TIME_UNIT_MILLISECONDS, | 673 | GNUNET_TIME_UNIT_MILLISECONDS, |
674 | &cron_scan_directory_data_hosts, NULL); | 674 | &cron_scan_directory_data_hosts, NULL); |
675 | GNUNET_SCHEDULER_add_delayed (sched, | 675 | GNUNET_SCHEDULER_add_delayed (sched, |
676 | GNUNET_YES, | 676 | GNUNET_YES, |
677 | GNUNET_SCHEDULER_PRIORITY_HIGH, | 677 | GNUNET_SCHEDULER_PRIORITY_HIGH, |
678 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 678 | GNUNET_SCHEDULER_NO_TASK, |
679 | TRUST_FLUSH_FREQ, &cron_flush_trust, NULL); | 679 | TRUST_FLUSH_FREQ, &cron_flush_trust, NULL); |
680 | GNUNET_SCHEDULER_add_delayed (sched, | 680 | GNUNET_SCHEDULER_add_delayed (sched, |
681 | GNUNET_NO, | 681 | GNUNET_NO, |
682 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 682 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
683 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 683 | GNUNET_SCHEDULER_NO_TASK, |
684 | DATA_HOST_CLEAN_FREQ, | 684 | DATA_HOST_CLEAN_FREQ, |
685 | &cron_clean_data_hosts, NULL); | 685 | &cron_clean_data_hosts, NULL); |
686 | GNUNET_SERVER_add_handlers (server, handlers); | 686 | GNUNET_SERVER_add_handlers (server, handlers); |
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index 73fb84981..04d9d8801 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c | |||
@@ -463,7 +463,7 @@ schedule_peer_search () | |||
463 | GNUNET_SCHEDULER_add_delayed (sched, | 463 | GNUNET_SCHEDULER_add_delayed (sched, |
464 | GNUNET_NO, | 464 | GNUNET_NO, |
465 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, | 465 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, |
466 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 466 | GNUNET_SCHEDULER_NO_TASK, |
467 | delay, | 467 | delay, |
468 | &find_more_peers, | 468 | &find_more_peers, |
469 | NULL); | 469 | NULL); |
@@ -706,7 +706,7 @@ core_init (void *cls, | |||
706 | GNUNET_SCHEDULER_add_delayed (sched, | 706 | GNUNET_SCHEDULER_add_delayed (sched, |
707 | GNUNET_NO, | 707 | GNUNET_NO, |
708 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, | 708 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, |
709 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 709 | GNUNET_SCHEDULER_NO_TASK, |
710 | GNUNET_TIME_UNIT_SECONDS /* give core time to tell us about existing connections */, | 710 | GNUNET_TIME_UNIT_SECONDS /* give core time to tell us about existing connections */, |
711 | &find_more_peers, | 711 | &find_more_peers, |
712 | NULL); | 712 | NULL); |
@@ -1053,7 +1053,7 @@ run (void *cls, | |||
1053 | GNUNET_SCHEDULER_add_delayed (sched, | 1053 | GNUNET_SCHEDULER_add_delayed (sched, |
1054 | GNUNET_YES, | 1054 | GNUNET_YES, |
1055 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 1055 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
1056 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1056 | GNUNET_SCHEDULER_NO_TASK, |
1057 | GNUNET_TIME_UNIT_FOREVER_REL, | 1057 | GNUNET_TIME_UNIT_FOREVER_REL, |
1058 | &cleaning_task, NULL); | 1058 | &cleaning_task, NULL); |
1059 | } | 1059 | } |
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 445fb4315..96d2001aa 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -1172,9 +1172,9 @@ update_addresses (struct TransportPlugin *plugin, int fresh) | |||
1172 | struct AddressList *next; | 1172 | struct AddressList *next; |
1173 | int expired; | 1173 | int expired; |
1174 | 1174 | ||
1175 | if (plugin->address_update_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 1175 | if (plugin->address_update_task != GNUNET_SCHEDULER_NO_TASK) |
1176 | GNUNET_SCHEDULER_cancel (plugin->env.sched, plugin->address_update_task); | 1176 | GNUNET_SCHEDULER_cancel (plugin->env.sched, plugin->address_update_task); |
1177 | plugin->address_update_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1177 | plugin->address_update_task = GNUNET_SCHEDULER_NO_TASK; |
1178 | now = GNUNET_TIME_absolute_get (); | 1178 | now = GNUNET_TIME_absolute_get (); |
1179 | min_remaining = GNUNET_TIME_UNIT_FOREVER_REL; | 1179 | min_remaining = GNUNET_TIME_UNIT_FOREVER_REL; |
1180 | expired = GNUNET_NO; | 1180 | expired = GNUNET_NO; |
@@ -1209,7 +1209,7 @@ update_addresses (struct TransportPlugin *plugin, int fresh) | |||
1209 | = GNUNET_SCHEDULER_add_delayed (plugin->env.sched, | 1209 | = GNUNET_SCHEDULER_add_delayed (plugin->env.sched, |
1210 | GNUNET_NO, | 1210 | GNUNET_NO, |
1211 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 1211 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
1212 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1212 | GNUNET_SCHEDULER_NO_TASK, |
1213 | min_remaining, | 1213 | min_remaining, |
1214 | &expire_address_task, plugin); | 1214 | &expire_address_task, plugin); |
1215 | 1215 | ||
@@ -1226,7 +1226,7 @@ static void | |||
1226 | expire_address_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 1226 | expire_address_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
1227 | { | 1227 | { |
1228 | struct TransportPlugin *plugin = cls; | 1228 | struct TransportPlugin *plugin = cls; |
1229 | plugin->address_update_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1229 | plugin->address_update_task = GNUNET_SCHEDULER_NO_TASK; |
1230 | update_addresses (plugin, GNUNET_NO); | 1230 | update_addresses (plugin, GNUNET_NO); |
1231 | } | 1231 | } |
1232 | 1232 | ||
@@ -1513,7 +1513,7 @@ cleanup_validation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1513 | GNUNET_SCHEDULER_add_delayed (sched, | 1513 | GNUNET_SCHEDULER_add_delayed (sched, |
1514 | GNUNET_NO, | 1514 | GNUNET_NO, |
1515 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 1515 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
1516 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1516 | GNUNET_SCHEDULER_NO_TASK, |
1517 | GNUNET_TIME_absolute_get_remaining | 1517 | GNUNET_TIME_absolute_get_remaining |
1518 | (pos->timeout), &cleanup_validation, NULL); | 1518 | (pos->timeout), &cleanup_validation, NULL); |
1519 | } | 1519 | } |
@@ -1608,7 +1608,7 @@ plugin_env_notify_validation (void *cls, | |||
1608 | GNUNET_SCHEDULER_add_delayed (sched, | 1608 | GNUNET_SCHEDULER_add_delayed (sched, |
1609 | GNUNET_NO, | 1609 | GNUNET_NO, |
1610 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 1610 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
1611 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1611 | GNUNET_SCHEDULER_NO_TASK, |
1612 | GNUNET_TIME_UNIT_ZERO, | 1612 | GNUNET_TIME_UNIT_ZERO, |
1613 | &cleanup_validation, NULL); | 1613 | &cleanup_validation, NULL); |
1614 | } | 1614 | } |
@@ -1757,7 +1757,7 @@ check_hello_validated (void *cls, | |||
1757 | GNUNET_SCHEDULER_add_delayed (sched, | 1757 | GNUNET_SCHEDULER_add_delayed (sched, |
1758 | GNUNET_NO, | 1758 | GNUNET_NO, |
1759 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 1759 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
1760 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1760 | GNUNET_SCHEDULER_NO_TASK, |
1761 | GNUNET_TIME_absolute_get_remaining | 1761 | GNUNET_TIME_absolute_get_remaining |
1762 | (chvc->e->timeout), &cleanup_validation, | 1762 | (chvc->e->timeout), &cleanup_validation, |
1763 | NULL); | 1763 | NULL); |
@@ -1920,7 +1920,7 @@ disconnect_neighbour (struct NeighbourList *n, | |||
1920 | GNUNET_assert (mq->neighbour == n); | 1920 | GNUNET_assert (mq->neighbour == n); |
1921 | GNUNET_free (mq); | 1921 | GNUNET_free (mq); |
1922 | } | 1922 | } |
1923 | if (n->timeout_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 1923 | if (n->timeout_task != GNUNET_SCHEDULER_NO_TASK) |
1924 | GNUNET_SCHEDULER_cancel (sched, | 1924 | GNUNET_SCHEDULER_cancel (sched, |
1925 | n->timeout_task); | 1925 | n->timeout_task); |
1926 | /* finally, free n itself */ | 1926 | /* finally, free n itself */ |
@@ -1971,7 +1971,7 @@ neighbour_timeout_task (void *cls, | |||
1971 | "Neighbour `%4s' has timed out!\n", | 1971 | "Neighbour `%4s' has timed out!\n", |
1972 | GNUNET_i2s(&n->id)); | 1972 | GNUNET_i2s(&n->id)); |
1973 | #endif | 1973 | #endif |
1974 | n->timeout_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1974 | n->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
1975 | disconnect_neighbour (n, GNUNET_NO); | 1975 | disconnect_neighbour (n, GNUNET_NO); |
1976 | } | 1976 | } |
1977 | 1977 | ||
@@ -2007,7 +2007,7 @@ setup_new_neighbour (const struct GNUNET_PeerIdentity *peer) | |||
2007 | n->timeout_task = GNUNET_SCHEDULER_add_delayed (sched, | 2007 | n->timeout_task = GNUNET_SCHEDULER_add_delayed (sched, |
2008 | GNUNET_NO, | 2008 | GNUNET_NO, |
2009 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 2009 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
2010 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 2010 | GNUNET_SCHEDULER_NO_TASK, |
2011 | GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, | 2011 | GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, |
2012 | &neighbour_timeout_task, n); | 2012 | &neighbour_timeout_task, n); |
2013 | transmit_to_peer (NULL, 0, | 2013 | transmit_to_peer (NULL, 0, |
@@ -2120,7 +2120,7 @@ plugin_env_receive (void *cls, | |||
2120 | n->timeout_task = | 2120 | n->timeout_task = |
2121 | GNUNET_SCHEDULER_add_delayed (sched, GNUNET_NO, | 2121 | GNUNET_SCHEDULER_add_delayed (sched, GNUNET_NO, |
2122 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 2122 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
2123 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 2123 | GNUNET_SCHEDULER_NO_TASK, |
2124 | GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, | 2124 | GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, |
2125 | &neighbour_timeout_task, n); | 2125 | &neighbour_timeout_task, n); |
2126 | update_quota (n); | 2126 | update_quota (n); |
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 3ed20d4fa..76d980621 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -1886,7 +1886,7 @@ handle_tcp_data (void *cls, | |||
1886 | GNUNET_SCHEDULER_add_delayed (session->plugin->env->sched, | 1886 | GNUNET_SCHEDULER_add_delayed (session->plugin->env->sched, |
1887 | GNUNET_NO, | 1887 | GNUNET_NO, |
1888 | GNUNET_SCHEDULER_PRIORITY_HIGH, | 1888 | GNUNET_SCHEDULER_PRIORITY_HIGH, |
1889 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1889 | GNUNET_SCHEDULER_NO_TASK, |
1890 | delay, &delayed_done, session); | 1890 | delay, &delayed_done, session); |
1891 | } | 1891 | } |
1892 | 1892 | ||
diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c index 9cc9f2853..ef6c8a76a 100644 --- a/src/transport/test_plugin_transport.c +++ b/src/transport/test_plugin_transport.c | |||
@@ -157,10 +157,10 @@ validation_notification (void *cls, | |||
157 | /* Sailor: 'test_validation' should get here | 157 | /* Sailor: 'test_validation' should get here |
158 | if the validation worked; so we cancel the | 158 | if the validation worked; so we cancel the |
159 | "delayed" task that will cause failure */ | 159 | "delayed" task that will cause failure */ |
160 | if (validation_timeout_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 160 | if (validation_timeout_task != GNUNET_SCHEDULER_NO_TASK) |
161 | { | 161 | { |
162 | GNUNET_SCHEDULER_cancel (sched, validation_timeout_task); | 162 | GNUNET_SCHEDULER_cancel (sched, validation_timeout_task); |
163 | validation_timeout_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 163 | validation_timeout_task = GNUNET_SCHEDULER_NO_TASK; |
164 | } | 164 | } |
165 | 165 | ||
166 | GNUNET_assert (challenge == 42); | 166 | GNUNET_assert (challenge == 42); |
@@ -176,7 +176,7 @@ static void | |||
176 | validation_failed (void *cls, | 176 | validation_failed (void *cls, |
177 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 177 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
178 | { | 178 | { |
179 | validation_timeout_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 179 | validation_timeout_task = GNUNET_SCHEDULER_NO_TASK; |
180 | GNUNET_break (0); /* output error */ | 180 | GNUNET_break (0); /* output error */ |
181 | /* the "validation_notification" was not called | 181 | /* the "validation_notification" was not called |
182 | in a timely fashion; we should set an error | 182 | in a timely fashion; we should set an error |
@@ -221,7 +221,7 @@ test_validation () | |||
221 | GNUNET_SCHEDULER_add_delayed (sched, | 221 | GNUNET_SCHEDULER_add_delayed (sched, |
222 | GNUNET_NO, | 222 | GNUNET_NO, |
223 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 223 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
224 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 224 | GNUNET_SCHEDULER_NO_TASK, |
225 | TIMEOUT, | 225 | TIMEOUT, |
226 | &validation_failed, | 226 | &validation_failed, |
227 | NULL); | 227 | NULL); |
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index dab244e45..eef0ede5e 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -405,13 +405,13 @@ transport_notify_ready (void *cls, size_t size, void *buf) | |||
405 | do | 405 | do |
406 | { | 406 | { |
407 | th = h->connect_ready_head; | 407 | th = h->connect_ready_head; |
408 | if (th->notify_delay_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 408 | if (th->notify_delay_task != GNUNET_SCHEDULER_NO_TASK) |
409 | { | 409 | { |
410 | /* remove existing time out task (only applies if | 410 | /* remove existing time out task (only applies if |
411 | this is not the first iteration of the loop) */ | 411 | this is not the first iteration of the loop) */ |
412 | GNUNET_SCHEDULER_cancel (h->sched, | 412 | GNUNET_SCHEDULER_cancel (h->sched, |
413 | th->notify_delay_task); | 413 | th->notify_delay_task); |
414 | th->notify_delay_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 414 | th->notify_delay_task = GNUNET_SCHEDULER_NO_TASK; |
415 | } | 415 | } |
416 | GNUNET_assert (th->notify_size <= size); | 416 | GNUNET_assert (th->notify_size <= size); |
417 | if (th->next != NULL) | 417 | if (th->next != NULL) |
@@ -459,13 +459,13 @@ schedule_transmission (struct GNUNET_TRANSPORT_Handle *h) | |||
459 | th = h->connect_ready_head; | 459 | th = h->connect_ready_head; |
460 | if (th == NULL) | 460 | if (th == NULL) |
461 | return; /* no request pending */ | 461 | return; /* no request pending */ |
462 | if (th->notify_delay_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 462 | if (th->notify_delay_task != GNUNET_SCHEDULER_NO_TASK) |
463 | { | 463 | { |
464 | /* remove existing time out task, will be integrated | 464 | /* remove existing time out task, will be integrated |
465 | with transmit_ready notification! */ | 465 | with transmit_ready notification! */ |
466 | GNUNET_SCHEDULER_cancel (h->sched, | 466 | GNUNET_SCHEDULER_cancel (h->sched, |
467 | th->notify_delay_task); | 467 | th->notify_delay_task); |
468 | th->notify_delay_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 468 | th->notify_delay_task = GNUNET_SCHEDULER_NO_TASK; |
469 | } | 469 | } |
470 | h->transmission_scheduled = GNUNET_YES; | 470 | h->transmission_scheduled = GNUNET_YES; |
471 | h->network_handle = GNUNET_CLIENT_notify_transmit_ready (h->client, | 471 | h->network_handle = GNUNET_CLIENT_notify_transmit_ready (h->client, |
@@ -529,10 +529,10 @@ remove_from_any_list (struct GNUNET_TRANSPORT_TransmitHandle *th) | |||
529 | struct GNUNET_TRANSPORT_Handle *h; | 529 | struct GNUNET_TRANSPORT_Handle *h; |
530 | 530 | ||
531 | h = th->handle; | 531 | h = th->handle; |
532 | if (th->notify_delay_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 532 | if (th->notify_delay_task != GNUNET_SCHEDULER_NO_TASK) |
533 | { | 533 | { |
534 | GNUNET_SCHEDULER_cancel (h->sched, th->notify_delay_task); | 534 | GNUNET_SCHEDULER_cancel (h->sched, th->notify_delay_task); |
535 | th->notify_delay_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 535 | th->notify_delay_task = GNUNET_SCHEDULER_NO_TASK; |
536 | } | 536 | } |
537 | if (th->prev == NULL) | 537 | if (th->prev == NULL) |
538 | { | 538 | { |
@@ -573,7 +573,7 @@ transmit_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
573 | { | 573 | { |
574 | struct GNUNET_TRANSPORT_TransmitHandle *th = cls; | 574 | struct GNUNET_TRANSPORT_TransmitHandle *th = cls; |
575 | 575 | ||
576 | th->notify_delay_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 576 | th->notify_delay_task = GNUNET_SCHEDULER_NO_TASK; |
577 | if (th->neighbour != NULL) | 577 | if (th->neighbour != NULL) |
578 | th->neighbour->transmit_handle = NULL; | 578 | th->neighbour->transmit_handle = NULL; |
579 | #if DEBUG_TRANSPORT | 579 | #if DEBUG_TRANSPORT |
@@ -620,7 +620,7 @@ schedule_control_transmit (struct GNUNET_TRANSPORT_Handle *h, | |||
620 | = GNUNET_SCHEDULER_add_delayed (h->sched, | 620 | = GNUNET_SCHEDULER_add_delayed (h->sched, |
621 | GNUNET_NO, | 621 | GNUNET_NO, |
622 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 622 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
623 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 623 | GNUNET_SCHEDULER_NO_TASK, |
624 | timeout, | 624 | timeout, |
625 | &transmit_timeout, th); | 625 | &transmit_timeout, th); |
626 | if (at_head) | 626 | if (at_head) |
@@ -785,7 +785,7 @@ hello_wait_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
785 | struct HelloWaitList *pos; | 785 | struct HelloWaitList *pos; |
786 | struct HelloWaitList *prev; | 786 | struct HelloWaitList *prev; |
787 | 787 | ||
788 | hwl->task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 788 | hwl->task = GNUNET_SCHEDULER_NO_TASK; |
789 | if (GNUNET_TIME_absolute_get_remaining (hwl->timeout).value > 0) | 789 | if (GNUNET_TIME_absolute_get_remaining (hwl->timeout).value > 0) |
790 | { | 790 | { |
791 | #if DEBUG_TRANSPORT | 791 | #if DEBUG_TRANSPORT |
@@ -797,7 +797,7 @@ hello_wait_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
797 | hwl->task = GNUNET_SCHEDULER_add_delayed (hwl->handle->sched, | 797 | hwl->task = GNUNET_SCHEDULER_add_delayed (hwl->handle->sched, |
798 | GNUNET_YES, | 798 | GNUNET_YES, |
799 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 799 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
800 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 800 | GNUNET_SCHEDULER_NO_TASK, |
801 | GNUNET_TIME_absolute_get_remaining (hwl->timeout), | 801 | GNUNET_TIME_absolute_get_remaining (hwl->timeout), |
802 | &hello_wait_timeout, hwl); | 802 | &hello_wait_timeout, hwl); |
803 | return; | 803 | return; |
@@ -857,7 +857,7 @@ GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle, | |||
857 | hwl->task = GNUNET_SCHEDULER_add_delayed (handle->sched, | 857 | hwl->task = GNUNET_SCHEDULER_add_delayed (handle->sched, |
858 | GNUNET_YES, | 858 | GNUNET_YES, |
859 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 859 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
860 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 860 | GNUNET_SCHEDULER_NO_TASK, |
861 | timeout, | 861 | timeout, |
862 | &hello_wait_timeout, hwl); | 862 | &hello_wait_timeout, hwl); |
863 | return; | 863 | return; |
@@ -979,7 +979,7 @@ request_connect (void *cls, size_t size, void *buf) | |||
979 | struct TryConnectMessage *tcm; | 979 | struct TryConnectMessage *tcm; |
980 | struct GNUNET_TRANSPORT_Handle *h; | 980 | struct GNUNET_TRANSPORT_Handle *h; |
981 | 981 | ||
982 | GNUNET_assert (th->notify_delay_task == GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); | 982 | GNUNET_assert (th->notify_delay_task == GNUNET_SCHEDULER_NO_TASK); |
983 | h = th->handle; | 983 | h = th->handle; |
984 | if (buf == NULL) | 984 | if (buf == NULL) |
985 | { | 985 | { |
@@ -1008,7 +1008,7 @@ request_connect (void *cls, size_t size, void *buf) | |||
1008 | = GNUNET_SCHEDULER_add_delayed (h->sched, | 1008 | = GNUNET_SCHEDULER_add_delayed (h->sched, |
1009 | GNUNET_NO, | 1009 | GNUNET_NO, |
1010 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 1010 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
1011 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1011 | GNUNET_SCHEDULER_NO_TASK, |
1012 | GNUNET_TIME_absolute_get_remaining | 1012 | GNUNET_TIME_absolute_get_remaining |
1013 | (th->timeout), | 1013 | (th->timeout), |
1014 | &transmit_timeout, th); | 1014 | &transmit_timeout, th); |
@@ -1028,7 +1028,7 @@ request_connect (void *cls, size_t size, void *buf) | |||
1028 | static void | 1028 | static void |
1029 | try_connect (struct GNUNET_TRANSPORT_TransmitHandle *th) | 1029 | try_connect (struct GNUNET_TRANSPORT_TransmitHandle *th) |
1030 | { | 1030 | { |
1031 | GNUNET_assert (th->notify_delay_task == GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); | 1031 | GNUNET_assert (th->notify_delay_task == GNUNET_SCHEDULER_NO_TASK); |
1032 | schedule_control_transmit (th->handle, | 1032 | schedule_control_transmit (th->handle, |
1033 | sizeof (struct TryConnectMessage), | 1033 | sizeof (struct TryConnectMessage), |
1034 | GNUNET_NO, | 1034 | GNUNET_NO, |
@@ -1050,7 +1050,7 @@ try_connect_task (void *cls, | |||
1050 | { | 1050 | { |
1051 | struct GNUNET_TRANSPORT_TransmitHandle *th = cls; | 1051 | struct GNUNET_TRANSPORT_TransmitHandle *th = cls; |
1052 | 1052 | ||
1053 | th->notify_delay_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1053 | th->notify_delay_task = GNUNET_SCHEDULER_NO_TASK; |
1054 | try_connect (th); | 1054 | try_connect (th); |
1055 | } | 1055 | } |
1056 | 1056 | ||
@@ -1103,18 +1103,18 @@ remove_neighbour (struct GNUNET_TRANSPORT_Handle *h, | |||
1103 | if (GNUNET_TIME_absolute_get_remaining (th->timeout).value <= CONNECT_RETRY_TIMEOUT.value) | 1103 | if (GNUNET_TIME_absolute_get_remaining (th->timeout).value <= CONNECT_RETRY_TIMEOUT.value) |
1104 | { | 1104 | { |
1105 | /* signal error */ | 1105 | /* signal error */ |
1106 | GNUNET_assert (GNUNET_SCHEDULER_NO_PREREQUISITE_TASK == th->notify_delay_task); | 1106 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == th->notify_delay_task); |
1107 | transmit_timeout (th, NULL); | 1107 | transmit_timeout (th, NULL); |
1108 | } | 1108 | } |
1109 | else | 1109 | else |
1110 | { | 1110 | { |
1111 | /* try again in a bit */ | 1111 | /* try again in a bit */ |
1112 | GNUNET_assert (GNUNET_SCHEDULER_NO_PREREQUISITE_TASK == th->notify_delay_task); | 1112 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == th->notify_delay_task); |
1113 | th->notify_delay_task | 1113 | th->notify_delay_task |
1114 | = GNUNET_SCHEDULER_add_delayed (h->sched, | 1114 | = GNUNET_SCHEDULER_add_delayed (h->sched, |
1115 | GNUNET_NO, | 1115 | GNUNET_NO, |
1116 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 1116 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
1117 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1117 | GNUNET_SCHEDULER_NO_TASK, |
1118 | CONNECT_RETRY_TIMEOUT, | 1118 | CONNECT_RETRY_TIMEOUT, |
1119 | &try_connect_task, | 1119 | &try_connect_task, |
1120 | th); | 1120 | th); |
@@ -1144,7 +1144,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1144 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting to transport service.\n"); | 1144 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting to transport service.\n"); |
1145 | #endif | 1145 | #endif |
1146 | GNUNET_assert (h->client == NULL); | 1146 | GNUNET_assert (h->client == NULL); |
1147 | h->reconnect_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1147 | h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; |
1148 | h->client = GNUNET_CLIENT_connect (h->sched, "transport", h->cfg); | 1148 | h->client = GNUNET_CLIENT_connect (h->sched, "transport", h->cfg); |
1149 | GNUNET_assert (h->client != NULL); | 1149 | GNUNET_assert (h->client != NULL); |
1150 | /* make sure we don't send "START" twice, | 1150 | /* make sure we don't send "START" twice, |
@@ -1189,12 +1189,12 @@ schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h) | |||
1189 | h->reconnect_delay.value); | 1189 | h->reconnect_delay.value); |
1190 | #endif | 1190 | #endif |
1191 | GNUNET_assert (h->client == NULL); | 1191 | GNUNET_assert (h->client == NULL); |
1192 | GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); | 1192 | GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); |
1193 | h->reconnect_task | 1193 | h->reconnect_task |
1194 | = GNUNET_SCHEDULER_add_delayed (h->sched, | 1194 | = GNUNET_SCHEDULER_add_delayed (h->sched, |
1195 | GNUNET_NO, | 1195 | GNUNET_NO, |
1196 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, | 1196 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, |
1197 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1197 | GNUNET_SCHEDULER_NO_TASK, |
1198 | h->reconnect_delay, &reconnect, h); | 1198 | h->reconnect_delay, &reconnect, h); |
1199 | h->reconnect_delay = GNUNET_TIME_UNIT_SECONDS; | 1199 | h->reconnect_delay = GNUNET_TIME_UNIT_SECONDS; |
1200 | } | 1200 | } |
@@ -1217,7 +1217,7 @@ transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1217 | { | 1217 | { |
1218 | struct GNUNET_TRANSPORT_TransmitHandle *th = cls; | 1218 | struct GNUNET_TRANSPORT_TransmitHandle *th = cls; |
1219 | 1219 | ||
1220 | th->notify_delay_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1220 | th->notify_delay_task = GNUNET_SCHEDULER_NO_TASK; |
1221 | schedule_request (th); | 1221 | schedule_request (th); |
1222 | } | 1222 | } |
1223 | 1223 | ||
@@ -1252,10 +1252,10 @@ schedule_request (struct GNUNET_TRANSPORT_TransmitHandle *th) | |||
1252 | 1252 | ||
1253 | h = th->handle; | 1253 | h = th->handle; |
1254 | n = th->neighbour; | 1254 | n = th->neighbour; |
1255 | if (th->notify_delay_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 1255 | if (th->notify_delay_task != GNUNET_SCHEDULER_NO_TASK) |
1256 | { | 1256 | { |
1257 | GNUNET_SCHEDULER_cancel (h->sched, th->notify_delay_task); | 1257 | GNUNET_SCHEDULER_cancel (h->sched, th->notify_delay_task); |
1258 | th->notify_delay_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1258 | th->notify_delay_task = GNUNET_SCHEDULER_NO_TASK; |
1259 | } | 1259 | } |
1260 | /* check outgoing quota */ | 1260 | /* check outgoing quota */ |
1261 | duration = GNUNET_TIME_absolute_get_duration (n->last_quota_update); | 1261 | duration = GNUNET_TIME_absolute_get_duration (n->last_quota_update); |
@@ -1298,7 +1298,7 @@ schedule_request (struct GNUNET_TRANSPORT_TransmitHandle *th) | |||
1298 | = GNUNET_SCHEDULER_add_delayed (h->sched, | 1298 | = GNUNET_SCHEDULER_add_delayed (h->sched, |
1299 | GNUNET_NO, | 1299 | GNUNET_NO, |
1300 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 1300 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
1301 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1301 | GNUNET_SCHEDULER_NO_TASK, |
1302 | duration, &transmit_ready, th); | 1302 | duration, &transmit_ready, th); |
1303 | return; | 1303 | return; |
1304 | } | 1304 | } |
@@ -1320,7 +1320,7 @@ schedule_request (struct GNUNET_TRANSPORT_TransmitHandle *th) | |||
1320 | = GNUNET_SCHEDULER_add_delayed (h->sched, | 1320 | = GNUNET_SCHEDULER_add_delayed (h->sched, |
1321 | GNUNET_NO, | 1321 | GNUNET_NO, |
1322 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 1322 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
1323 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1323 | GNUNET_SCHEDULER_NO_TASK, |
1324 | GNUNET_TIME_absolute_get_remaining | 1324 | GNUNET_TIME_absolute_get_remaining |
1325 | (th->timeout), &transmit_timeout, th); | 1325 | (th->timeout), &transmit_timeout, th); |
1326 | return; | 1326 | return; |
@@ -1392,10 +1392,10 @@ add_neighbour (struct GNUNET_TRANSPORT_Handle *h, | |||
1392 | "Found pending request for `%4s' will trigger it now.\n", | 1392 | "Found pending request for `%4s' will trigger it now.\n", |
1393 | GNUNET_i2s (&pos->target)); | 1393 | GNUNET_i2s (&pos->target)); |
1394 | #endif | 1394 | #endif |
1395 | if (pos->notify_delay_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 1395 | if (pos->notify_delay_task != GNUNET_SCHEDULER_NO_TASK) |
1396 | { | 1396 | { |
1397 | GNUNET_SCHEDULER_cancel (h->sched, pos->notify_delay_task); | 1397 | GNUNET_SCHEDULER_cancel (h->sched, pos->notify_delay_task); |
1398 | pos->notify_delay_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1398 | pos->notify_delay_task = GNUNET_SCHEDULER_NO_TASK; |
1399 | } | 1399 | } |
1400 | schedule_request (pos); | 1400 | schedule_request (pos); |
1401 | } | 1401 | } |
@@ -1495,10 +1495,10 @@ GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle) | |||
1495 | while (NULL != (th = handle->connect_wait_head)) | 1495 | while (NULL != (th = handle->connect_wait_head)) |
1496 | { | 1496 | { |
1497 | handle->connect_wait_head = th->next; | 1497 | handle->connect_wait_head = th->next; |
1498 | if (th->notify_delay_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 1498 | if (th->notify_delay_task != GNUNET_SCHEDULER_NO_TASK) |
1499 | { | 1499 | { |
1500 | GNUNET_SCHEDULER_cancel (handle->sched, th->notify_delay_task); | 1500 | GNUNET_SCHEDULER_cancel (handle->sched, th->notify_delay_task); |
1501 | th->notify_delay_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1501 | th->notify_delay_task = GNUNET_SCHEDULER_NO_TASK; |
1502 | } | 1502 | } |
1503 | th->notify (th->notify_cls, 0, NULL); | 1503 | th->notify (th->notify_cls, 0, NULL); |
1504 | GNUNET_free (th); | 1504 | GNUNET_free (th); |
@@ -1519,10 +1519,10 @@ GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle) | |||
1519 | hwl->rec (hwl->rec_cls, GNUNET_TIME_UNIT_ZERO, NULL, NULL); | 1519 | hwl->rec (hwl->rec_cls, GNUNET_TIME_UNIT_ZERO, NULL, NULL); |
1520 | GNUNET_free (hwl); | 1520 | GNUNET_free (hwl); |
1521 | } | 1521 | } |
1522 | if (handle->reconnect_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 1522 | if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK) |
1523 | { | 1523 | { |
1524 | GNUNET_SCHEDULER_cancel (handle->sched, handle->reconnect_task); | 1524 | GNUNET_SCHEDULER_cancel (handle->sched, handle->reconnect_task); |
1525 | handle->reconnect_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1525 | handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK; |
1526 | } | 1526 | } |
1527 | GNUNET_free_non_null (handle->my_hello); | 1527 | GNUNET_free_non_null (handle->my_hello); |
1528 | handle->my_hello = NULL; | 1528 | handle->my_hello = NULL; |
@@ -1578,12 +1578,12 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1578 | h->transmission_scheduled = GNUNET_NO; | 1578 | h->transmission_scheduled = GNUNET_NO; |
1579 | th = h->connect_ready_head; | 1579 | th = h->connect_ready_head; |
1580 | /* add timeout again, we cancelled the transmit_ready task! */ | 1580 | /* add timeout again, we cancelled the transmit_ready task! */ |
1581 | GNUNET_assert (th->notify_delay_task == GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); | 1581 | GNUNET_assert (th->notify_delay_task == GNUNET_SCHEDULER_NO_TASK); |
1582 | th->notify_delay_task | 1582 | th->notify_delay_task |
1583 | = GNUNET_SCHEDULER_add_delayed (h->sched, | 1583 | = GNUNET_SCHEDULER_add_delayed (h->sched, |
1584 | GNUNET_NO, | 1584 | GNUNET_NO, |
1585 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 1585 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
1586 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1586 | GNUNET_SCHEDULER_NO_TASK, |
1587 | GNUNET_TIME_absolute_get_remaining(th->timeout), | 1587 | GNUNET_TIME_absolute_get_remaining(th->timeout), |
1588 | &transmit_timeout, | 1588 | &transmit_timeout, |
1589 | th); | 1589 | th); |
@@ -1692,7 +1692,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1692 | GNUNET_SCHEDULER_cancel (h->sched, | 1692 | GNUNET_SCHEDULER_cancel (h->sched, |
1693 | n->transmit_handle->notify_delay_task); | 1693 | n->transmit_handle->notify_delay_task); |
1694 | n->transmit_handle->notify_delay_task = | 1694 | n->transmit_handle->notify_delay_task = |
1695 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1695 | GNUNET_SCHEDULER_NO_TASK; |
1696 | GNUNET_assert (GNUNET_YES == n->received_ack); | 1696 | GNUNET_assert (GNUNET_YES == n->received_ack); |
1697 | schedule_request (n->transmit_handle); | 1697 | schedule_request (n->transmit_handle); |
1698 | } | 1698 | } |
@@ -1927,7 +1927,7 @@ GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle | |||
1927 | = GNUNET_SCHEDULER_add_delayed (handle->sched, | 1927 | = GNUNET_SCHEDULER_add_delayed (handle->sched, |
1928 | GNUNET_NO, | 1928 | GNUNET_NO, |
1929 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 1929 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
1930 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1930 | GNUNET_SCHEDULER_NO_TASK, |
1931 | timeout, &transmit_timeout, th); | 1931 | timeout, &transmit_timeout, th); |
1932 | return th; | 1932 | return th; |
1933 | } | 1933 | } |
diff --git a/src/util/client.c b/src/util/client.c index 487f3f8e8..7d380fa5c 100644 --- a/src/util/client.c +++ b/src/util/client.c | |||
@@ -230,7 +230,7 @@ receive_helper (void *cls, | |||
230 | struct GNUNET_TIME_Relative remaining; | 230 | struct GNUNET_TIME_Relative remaining; |
231 | 231 | ||
232 | GNUNET_assert (conn->msg_complete == GNUNET_NO); | 232 | GNUNET_assert (conn->msg_complete == GNUNET_NO); |
233 | conn->receiver_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 233 | conn->receiver_task = GNUNET_SCHEDULER_NO_TASK; |
234 | 234 | ||
235 | if ((available == 0) || (conn->sock == NULL) || (errCode != 0)) | 235 | if ((available == 0) || (conn->sock == NULL) || (errCode != 0)) |
236 | { | 236 | { |
@@ -284,7 +284,7 @@ receive_task (void *scls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
284 | struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader*) mbuf; | 284 | struct GNUNET_MessageHeader *msg = (struct GNUNET_MessageHeader*) mbuf; |
285 | 285 | ||
286 | GNUNET_assert (GNUNET_YES == sock->msg_complete); | 286 | GNUNET_assert (GNUNET_YES == sock->msg_complete); |
287 | sock->receiver_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 287 | sock->receiver_task = GNUNET_SCHEDULER_NO_TASK; |
288 | GNUNET_assert (sock->received_pos >= msize); | 288 | GNUNET_assert (sock->received_pos >= msize); |
289 | memcpy (msg, cmsg, msize); | 289 | memcpy (msg, cmsg, msize); |
290 | memmove (sock->received_buf, | 290 | memmove (sock->received_buf, |
@@ -320,7 +320,7 @@ GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock, | |||
320 | return; | 320 | return; |
321 | } | 321 | } |
322 | GNUNET_assert (sock->receiver_task == | 322 | GNUNET_assert (sock->receiver_task == |
323 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); | 323 | GNUNET_SCHEDULER_NO_TASK); |
324 | sock->receiver_handler = handler; | 324 | sock->receiver_handler = handler; |
325 | sock->receiver_handler_cls = cls; | 325 | sock->receiver_handler_cls = cls; |
326 | sock->receive_timeout = GNUNET_TIME_relative_to_absolute (timeout); | 326 | sock->receive_timeout = GNUNET_TIME_relative_to_absolute (timeout); |
@@ -328,7 +328,7 @@ GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock, | |||
328 | sock->receiver_task = GNUNET_SCHEDULER_add_after (sock->sched, | 328 | sock->receiver_task = GNUNET_SCHEDULER_add_after (sock->sched, |
329 | GNUNET_YES, | 329 | GNUNET_YES, |
330 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 330 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
331 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 331 | GNUNET_SCHEDULER_NO_TASK, |
332 | &receive_task, sock); | 332 | &receive_task, sock); |
333 | else | 333 | else |
334 | sock->receiver_task = GNUNET_NETWORK_receive (sock->sock, | 334 | sock->receiver_task = GNUNET_NETWORK_receive (sock->sock, |
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c index 8df4cc8f4..fc4d24320 100644 --- a/src/util/crypto_hash.c +++ b/src/util/crypto_hash.c | |||
@@ -484,7 +484,7 @@ file_hash_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
484 | GNUNET_SCHEDULER_add_after (tc->sched, | 484 | GNUNET_SCHEDULER_add_after (tc->sched, |
485 | fhc->run_on_shutdown, | 485 | fhc->run_on_shutdown, |
486 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 486 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
487 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 487 | GNUNET_SCHEDULER_NO_TASK, |
488 | &file_hash_task, fhc); | 488 | &file_hash_task, fhc); |
489 | } | 489 | } |
490 | 490 | ||
@@ -536,7 +536,7 @@ GNUNET_CRYPTO_hash_file (struct GNUNET_SCHEDULER_Handle *sched, | |||
536 | GNUNET_SCHEDULER_add_after (sched, | 536 | GNUNET_SCHEDULER_add_after (sched, |
537 | run_on_shutdown, | 537 | run_on_shutdown, |
538 | priority, | 538 | priority, |
539 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 539 | GNUNET_SCHEDULER_NO_TASK, |
540 | &file_hash_task, fhc); | 540 | &file_hash_task, fhc); |
541 | } | 541 | } |
542 | 542 | ||
diff --git a/src/util/disk.c b/src/util/disk.c index c70f2cc2b..b0f92c7f2 100644 --- a/src/util/disk.c +++ b/src/util/disk.c | |||
@@ -735,7 +735,7 @@ GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator | |||
735 | GNUNET_SCHEDULER_add_after (iter->sched, | 735 | GNUNET_SCHEDULER_add_after (iter->sched, |
736 | GNUNET_YES, | 736 | GNUNET_YES, |
737 | iter->priority, | 737 | iter->priority, |
738 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 738 | GNUNET_SCHEDULER_NO_TASK, |
739 | &directory_iterator_task, iter); | 739 | &directory_iterator_task, iter); |
740 | return GNUNET_YES; | 740 | return GNUNET_YES; |
741 | } | 741 | } |
diff --git a/src/util/network.c b/src/util/network.c index cb8542329..9b61bd8c2 100644 --- a/src/util/network.c +++ b/src/util/network.c | |||
@@ -541,7 +541,7 @@ connect_continuation (void *cls, | |||
541 | int error; | 541 | int error; |
542 | 542 | ||
543 | /* nobody needs to wait for us anymore... */ | 543 | /* nobody needs to wait for us anymore... */ |
544 | sock->connect_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 544 | sock->connect_task = GNUNET_SCHEDULER_NO_TASK; |
545 | /* Note: write-ready does NOT mean connect succeeded, | 545 | /* Note: write-ready does NOT mean connect succeeded, |
546 | we need to use getsockopt to be sure */ | 546 | we need to use getsockopt to be sure */ |
547 | len = sizeof (error); | 547 | len = sizeof (error); |
@@ -574,7 +574,7 @@ connect_continuation (void *cls, | |||
574 | } | 574 | } |
575 | sock->connect_task = GNUNET_SCHEDULER_add_write (tc->sched, GNUNET_NO, /* abort on shutdown */ | 575 | sock->connect_task = GNUNET_SCHEDULER_add_write (tc->sched, GNUNET_NO, /* abort on shutdown */ |
576 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 576 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
577 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 577 | GNUNET_SCHEDULER_NO_TASK, |
578 | GNUNET_NETWORK_CONNECT_RETRY_TIMEOUT, | 578 | GNUNET_NETWORK_CONNECT_RETRY_TIMEOUT, |
579 | sock->sock, | 579 | sock->sock, |
580 | &connect_continuation, | 580 | &connect_continuation, |
@@ -630,7 +630,7 @@ GNUNET_NETWORK_socket_create_from_connect (struct GNUNET_SCHEDULER_Handle | |||
630 | } | 630 | } |
631 | ret->connect_task = GNUNET_SCHEDULER_add_write (sched, GNUNET_NO, /* abort on shutdown */ | 631 | ret->connect_task = GNUNET_SCHEDULER_add_write (sched, GNUNET_NO, /* abort on shutdown */ |
632 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 632 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
633 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 633 | GNUNET_SCHEDULER_NO_TASK, |
634 | GNUNET_NETWORK_CONNECT_RETRY_TIMEOUT, | 634 | GNUNET_NETWORK_CONNECT_RETRY_TIMEOUT, |
635 | ret->sock, | 635 | ret->sock, |
636 | &connect_continuation, ret); | 636 | &connect_continuation, ret); |
@@ -727,7 +727,7 @@ destroy_continuation (void *cls, | |||
727 | struct GNUNET_NETWORK_SocketHandle *sock = cls; | 727 | struct GNUNET_NETWORK_SocketHandle *sock = cls; |
728 | GNUNET_NETWORK_TransmitReadyNotify notify; | 728 | GNUNET_NETWORK_TransmitReadyNotify notify; |
729 | 729 | ||
730 | if (sock->write_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 730 | if (sock->write_task != GNUNET_SCHEDULER_NO_TASK) |
731 | { | 731 | { |
732 | GNUNET_SCHEDULER_add_after (sock->sched, | 732 | GNUNET_SCHEDULER_add_after (sock->sched, |
733 | GNUNET_YES, | 733 | GNUNET_YES, |
@@ -743,7 +743,7 @@ destroy_continuation (void *cls, | |||
743 | #endif | 743 | #endif |
744 | SHUTDOWN (sock->sock, SHUT_RDWR); | 744 | SHUTDOWN (sock->sock, SHUT_RDWR); |
745 | } | 745 | } |
746 | if (sock->read_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 746 | if (sock->read_task != GNUNET_SCHEDULER_NO_TASK) |
747 | { | 747 | { |
748 | GNUNET_SCHEDULER_add_after (sock->sched, | 748 | GNUNET_SCHEDULER_add_after (sock->sched, |
749 | GNUNET_YES, | 749 | GNUNET_YES, |
@@ -756,10 +756,10 @@ destroy_continuation (void *cls, | |||
756 | { | 756 | { |
757 | sock->nth.notify_ready = NULL; | 757 | sock->nth.notify_ready = NULL; |
758 | notify (sock->nth.notify_ready_cls, 0, NULL); | 758 | notify (sock->nth.notify_ready_cls, 0, NULL); |
759 | if (sock->nth.timeout_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 759 | if (sock->nth.timeout_task != GNUNET_SCHEDULER_NO_TASK) |
760 | { | 760 | { |
761 | GNUNET_SCHEDULER_cancel (sock->sched, sock->nth.timeout_task); | 761 | GNUNET_SCHEDULER_cancel (sock->sched, sock->nth.timeout_task); |
762 | sock->nth.timeout_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 762 | sock->nth.timeout_task = GNUNET_SCHEDULER_NO_TASK; |
763 | } | 763 | } |
764 | } | 764 | } |
765 | if (sock->sock != -1) | 765 | if (sock->sock != -1) |
@@ -837,7 +837,7 @@ receive_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
837 | ssize_t ret; | 837 | ssize_t ret; |
838 | GNUNET_NETWORK_Receiver receiver; | 838 | GNUNET_NETWORK_Receiver receiver; |
839 | 839 | ||
840 | sh->read_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 840 | sh->read_task = GNUNET_SCHEDULER_NO_TASK; |
841 | now = GNUNET_TIME_absolute_get (); | 841 | now = GNUNET_TIME_absolute_get (); |
842 | if ((now.value > sh->receive_timeout.value) || | 842 | if ((now.value > sh->receive_timeout.value) || |
843 | (0 != (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT)) || | 843 | (0 != (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT)) || |
@@ -907,9 +907,9 @@ receive_again (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
907 | struct GNUNET_NETWORK_SocketHandle *sh = cls; | 907 | struct GNUNET_NETWORK_SocketHandle *sh = cls; |
908 | struct GNUNET_TIME_Absolute now; | 908 | struct GNUNET_TIME_Absolute now; |
909 | 909 | ||
910 | sh->read_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 910 | sh->read_task = GNUNET_SCHEDULER_NO_TASK; |
911 | if ((sh->sock == -1) && | 911 | if ((sh->sock == -1) && |
912 | (sh->connect_task == GNUNET_SCHEDULER_NO_PREREQUISITE_TASK)) | 912 | (sh->connect_task == GNUNET_SCHEDULER_NO_TASK)) |
913 | { | 913 | { |
914 | /* not connected and no longer trying */ | 914 | /* not connected and no longer trying */ |
915 | #if DEBUG_NETWORK | 915 | #if DEBUG_NETWORK |
@@ -930,7 +930,7 @@ receive_again (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
930 | signal_timeout (sh); | 930 | signal_timeout (sh); |
931 | return; | 931 | return; |
932 | } | 932 | } |
933 | if (sh->connect_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 933 | if (sh->connect_task != GNUNET_SCHEDULER_NO_TASK) |
934 | { | 934 | { |
935 | /* connect was retried */ | 935 | /* connect was retried */ |
936 | sh->read_task = GNUNET_SCHEDULER_add_after (tc->sched, | 936 | sh->read_task = GNUNET_SCHEDULER_add_after (tc->sched, |
@@ -965,7 +965,7 @@ receive_again (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
965 | * @param timeout maximum amount of time to wait (use -1 for "forever") | 965 | * @param timeout maximum amount of time to wait (use -1 for "forever") |
966 | * @param receiver function to call with received data | 966 | * @param receiver function to call with received data |
967 | * @param receiver_cls closure for receiver | 967 | * @param receiver_cls closure for receiver |
968 | * @return scheduler task ID used for receiving, GNUNET_SCHEDULER_NO_PREREQUISITE_TASK on error | 968 | * @return scheduler task ID used for receiving, GNUNET_SCHEDULER_NO_TASK on error |
969 | */ | 969 | */ |
970 | GNUNET_SCHEDULER_TaskIdentifier | 970 | GNUNET_SCHEDULER_TaskIdentifier |
971 | GNUNET_NETWORK_receive (struct GNUNET_NETWORK_SocketHandle *sock, | 971 | GNUNET_NETWORK_receive (struct GNUNET_NETWORK_SocketHandle *sock, |
@@ -975,7 +975,7 @@ GNUNET_NETWORK_receive (struct GNUNET_NETWORK_SocketHandle *sock, | |||
975 | { | 975 | { |
976 | struct GNUNET_SCHEDULER_TaskContext tc; | 976 | struct GNUNET_SCHEDULER_TaskContext tc; |
977 | 977 | ||
978 | GNUNET_assert ((sock->read_task == GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) && | 978 | GNUNET_assert ((sock->read_task == GNUNET_SCHEDULER_NO_TASK) && |
979 | (sock->receiver == NULL)); | 979 | (sock->receiver == NULL)); |
980 | sock->receiver = receiver; | 980 | sock->receiver = receiver; |
981 | sock->receiver_cls = receiver_cls; | 981 | sock->receiver_cls = receiver_cls; |
@@ -1004,7 +1004,7 @@ GNUNET_NETWORK_receive_cancel (struct GNUNET_NETWORK_SocketHandle *sock, | |||
1004 | { | 1004 | { |
1005 | GNUNET_assert (sock->read_task == task); | 1005 | GNUNET_assert (sock->read_task == task); |
1006 | GNUNET_assert (sock == GNUNET_SCHEDULER_cancel (sock->sched, task)); | 1006 | GNUNET_assert (sock == GNUNET_SCHEDULER_cancel (sock->sched, task)); |
1007 | sock->read_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1007 | sock->read_task = GNUNET_SCHEDULER_NO_TASK; |
1008 | sock->receiver = NULL; | 1008 | sock->receiver = NULL; |
1009 | return sock->receiver_cls; | 1009 | return sock->receiver_cls; |
1010 | } | 1010 | } |
@@ -1025,7 +1025,7 @@ process_notify (struct GNUNET_NETWORK_SocketHandle *sock) | |||
1025 | size_t size; | 1025 | size_t size; |
1026 | GNUNET_NETWORK_TransmitReadyNotify notify; | 1026 | GNUNET_NETWORK_TransmitReadyNotify notify; |
1027 | 1027 | ||
1028 | GNUNET_assert (sock->write_task == GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); | 1028 | GNUNET_assert (sock->write_task == GNUNET_SCHEDULER_NO_TASK); |
1029 | if (NULL == (notify = sock->nth.notify_ready)) | 1029 | if (NULL == (notify = sock->nth.notify_ready)) |
1030 | return GNUNET_NO; | 1030 | return GNUNET_NO; |
1031 | used = sock->write_buffer_off - sock->write_buffer_pos; | 1031 | used = sock->write_buffer_off - sock->write_buffer_pos; |
@@ -1034,10 +1034,10 @@ process_notify (struct GNUNET_NETWORK_SocketHandle *sock) | |||
1034 | if (sock->nth.notify_size > avail) | 1034 | if (sock->nth.notify_size > avail) |
1035 | return GNUNET_NO; | 1035 | return GNUNET_NO; |
1036 | sock->nth.notify_ready = NULL; | 1036 | sock->nth.notify_ready = NULL; |
1037 | if (sock->nth.timeout_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 1037 | if (sock->nth.timeout_task != GNUNET_SCHEDULER_NO_TASK) |
1038 | { | 1038 | { |
1039 | GNUNET_SCHEDULER_cancel (sock->sched, sock->nth.timeout_task); | 1039 | GNUNET_SCHEDULER_cancel (sock->sched, sock->nth.timeout_task); |
1040 | sock->nth.timeout_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1040 | sock->nth.timeout_task = GNUNET_SCHEDULER_NO_TASK; |
1041 | } | 1041 | } |
1042 | if (sock->write_buffer_size - sock->write_buffer_off < size) | 1042 | if (sock->write_buffer_size - sock->write_buffer_off < size) |
1043 | { | 1043 | { |
@@ -1084,10 +1084,10 @@ transmit_error (struct GNUNET_NETWORK_SocketHandle *sock) | |||
1084 | { | 1084 | { |
1085 | if (sock->nth.notify_ready == NULL) | 1085 | if (sock->nth.notify_ready == NULL) |
1086 | return; /* nobody to tell about it */ | 1086 | return; /* nobody to tell about it */ |
1087 | if (sock->nth.timeout_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 1087 | if (sock->nth.timeout_task != GNUNET_SCHEDULER_NO_TASK) |
1088 | { | 1088 | { |
1089 | GNUNET_SCHEDULER_cancel (sock->sched, sock->nth.timeout_task); | 1089 | GNUNET_SCHEDULER_cancel (sock->sched, sock->nth.timeout_task); |
1090 | sock->nth.timeout_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1090 | sock->nth.timeout_task = GNUNET_SCHEDULER_NO_TASK; |
1091 | } | 1091 | } |
1092 | transmit_timeout (sock, NULL); | 1092 | transmit_timeout (sock, NULL); |
1093 | } | 1093 | } |
@@ -1105,13 +1105,13 @@ transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1105 | ssize_t ret; | 1105 | ssize_t ret; |
1106 | size_t have; | 1106 | size_t have; |
1107 | 1107 | ||
1108 | GNUNET_assert (sock->write_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); | 1108 | GNUNET_assert (sock->write_task != GNUNET_SCHEDULER_NO_TASK); |
1109 | sock->write_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1109 | sock->write_task = GNUNET_SCHEDULER_NO_TASK; |
1110 | if (sock->connect_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 1110 | if (sock->connect_task != GNUNET_SCHEDULER_NO_TASK) |
1111 | { | 1111 | { |
1112 | /* still waiting for connect */ | 1112 | /* still waiting for connect */ |
1113 | GNUNET_assert (sock->write_task == | 1113 | GNUNET_assert (sock->write_task == |
1114 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); | 1114 | GNUNET_SCHEDULER_NO_TASK); |
1115 | sock->write_task = | 1115 | sock->write_task = |
1116 | GNUNET_SCHEDULER_add_delayed (tc->sched, GNUNET_NO, | 1116 | GNUNET_SCHEDULER_add_delayed (tc->sched, GNUNET_NO, |
1117 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 1117 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
@@ -1195,12 +1195,12 @@ RETRY: | |||
1195 | return; /* all data sent! */ | 1195 | return; /* all data sent! */ |
1196 | /* not done writing, schedule more */ | 1196 | /* not done writing, schedule more */ |
1197 | SCHEDULE_WRITE: | 1197 | SCHEDULE_WRITE: |
1198 | if (sock->write_task == GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 1198 | if (sock->write_task == GNUNET_SCHEDULER_NO_TASK) |
1199 | sock->write_task = | 1199 | sock->write_task = |
1200 | GNUNET_SCHEDULER_add_write (tc->sched, | 1200 | GNUNET_SCHEDULER_add_write (tc->sched, |
1201 | GNUNET_NO, | 1201 | GNUNET_NO, |
1202 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 1202 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
1203 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1203 | GNUNET_SCHEDULER_NO_TASK, |
1204 | GNUNET_TIME_absolute_get_remaining (sock->nth.transmit_timeout), | 1204 | GNUNET_TIME_absolute_get_remaining (sock->nth.transmit_timeout), |
1205 | sock->sock, &transmit_ready, sock); | 1205 | sock->sock, &transmit_ready, sock); |
1206 | } | 1206 | } |
@@ -1233,7 +1233,7 @@ GNUNET_NETWORK_notify_transmit_ready (struct GNUNET_NETWORK_SocketHandle | |||
1233 | GNUNET_assert (sock->write_buffer_size >= size); | 1233 | GNUNET_assert (sock->write_buffer_size >= size); |
1234 | 1234 | ||
1235 | if ((sock->sock == -1) && | 1235 | if ((sock->sock == -1) && |
1236 | (sock->connect_task == GNUNET_SCHEDULER_NO_PREREQUISITE_TASK)) | 1236 | (sock->connect_task == GNUNET_SCHEDULER_NO_TASK)) |
1237 | { | 1237 | { |
1238 | #if DEBUG_NETWORK | 1238 | #if DEBUG_NETWORK |
1239 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1239 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -1254,17 +1254,17 @@ GNUNET_NETWORK_notify_transmit_ready (struct GNUNET_NETWORK_SocketHandle | |||
1254 | sock->nth.timeout_task = GNUNET_SCHEDULER_add_delayed (sock->sched, | 1254 | sock->nth.timeout_task = GNUNET_SCHEDULER_add_delayed (sock->sched, |
1255 | GNUNET_NO, | 1255 | GNUNET_NO, |
1256 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 1256 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
1257 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1257 | GNUNET_SCHEDULER_NO_TASK, |
1258 | timeout, | 1258 | timeout, |
1259 | &transmit_timeout, | 1259 | &transmit_timeout, |
1260 | sock); | 1260 | sock); |
1261 | if (sock->write_task == GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 1261 | if (sock->write_task == GNUNET_SCHEDULER_NO_TASK) |
1262 | { | 1262 | { |
1263 | if (sock->connect_task == GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 1263 | if (sock->connect_task == GNUNET_SCHEDULER_NO_TASK) |
1264 | sock->write_task = GNUNET_SCHEDULER_add_write (sock->sched, | 1264 | sock->write_task = GNUNET_SCHEDULER_add_write (sock->sched, |
1265 | GNUNET_NO, | 1265 | GNUNET_NO, |
1266 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 1266 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
1267 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 1267 | GNUNET_SCHEDULER_NO_TASK, |
1268 | GNUNET_TIME_absolute_get_remaining (sock->nth.transmit_timeout), | 1268 | GNUNET_TIME_absolute_get_remaining (sock->nth.transmit_timeout), |
1269 | sock->sock, | 1269 | sock->sock, |
1270 | &transmit_ready, sock); | 1270 | &transmit_ready, sock); |
@@ -1290,7 +1290,7 @@ GNUNET_NETWORK_notify_transmit_ready_cancel (struct | |||
1290 | { | 1290 | { |
1291 | GNUNET_assert (h->notify_ready != NULL); | 1291 | GNUNET_assert (h->notify_ready != NULL); |
1292 | GNUNET_SCHEDULER_cancel (h->sh->sched, h->timeout_task); | 1292 | GNUNET_SCHEDULER_cancel (h->sh->sched, h->timeout_task); |
1293 | h->timeout_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1293 | h->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
1294 | h->notify_ready = NULL; | 1294 | h->notify_ready = NULL; |
1295 | } | 1295 | } |
1296 | 1296 | ||
diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 4872eee41..0b5307290 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c | |||
@@ -255,7 +255,7 @@ update_sets (struct GNUNET_SCHEDULER_Handle *sched, | |||
255 | pos = sched->pending; | 255 | pos = sched->pending; |
256 | while (pos != NULL) | 256 | while (pos != NULL) |
257 | { | 257 | { |
258 | if ((pos->prereq_id != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) && | 258 | if ((pos->prereq_id != GNUNET_SCHEDULER_NO_TASK) && |
259 | (GNUNET_YES == is_pending (sched, pos->prereq_id))) | 259 | (GNUNET_YES == is_pending (sched, pos->prereq_id))) |
260 | { | 260 | { |
261 | pos = pos->next; | 261 | pos = pos->next; |
@@ -329,7 +329,7 @@ is_ready (struct GNUNET_SCHEDULER_Handle *sched, | |||
329 | task->reason |= GNUNET_SCHEDULER_REASON_WRITE_READY; | 329 | task->reason |= GNUNET_SCHEDULER_REASON_WRITE_READY; |
330 | if (task->reason == 0) | 330 | if (task->reason == 0) |
331 | return GNUNET_NO; /* not ready */ | 331 | return GNUNET_NO; /* not ready */ |
332 | if (task->prereq_id != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 332 | if (task->prereq_id != GNUNET_SCHEDULER_NO_TASK) |
333 | { | 333 | { |
334 | if (GNUNET_YES == is_pending (sched, task->prereq_id)) | 334 | if (GNUNET_YES == is_pending (sched, task->prereq_id)) |
335 | return GNUNET_NO; /* prereq waiting */ | 335 | return GNUNET_NO; /* prereq waiting */ |
@@ -671,7 +671,7 @@ GNUNET_SCHEDULER_add_continuation (struct GNUNET_SCHEDULER_Handle *sched, | |||
671 | * @param prerequisite_task run this task after the task with the given | 671 | * @param prerequisite_task run this task after the task with the given |
672 | * task identifier completes (and any of our other | 672 | * task identifier completes (and any of our other |
673 | * conditions, such as delay, read or write-readyness | 673 | * conditions, such as delay, read or write-readyness |
674 | * are satisfied). Use GNUNET_SCHEDULER_NO_PREREQUISITE_TASK to not have any dependency | 674 | * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency |
675 | * on completion of other tasks. | 675 | * on completion of other tasks. |
676 | * @param main main function of the task | 676 | * @param main main function of the task |
677 | * @param cls closure of task | 677 | * @param cls closure of task |
@@ -707,7 +707,7 @@ GNUNET_SCHEDULER_add_after (struct GNUNET_SCHEDULER_Handle *sched, | |||
707 | * @param prerequisite_task run this task after the task with the given | 707 | * @param prerequisite_task run this task after the task with the given |
708 | * task identifier completes (and any of our other | 708 | * task identifier completes (and any of our other |
709 | * conditions, such as delay, read or write-readyness | 709 | * conditions, such as delay, read or write-readyness |
710 | * are satisfied). Use GNUNET_SCHEDULER_NO_PREREQUISITE_TASK to not have any dependency | 710 | * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency |
711 | * on completion of other tasks. | 711 | * on completion of other tasks. |
712 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" | 712 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" |
713 | * @param main main function of the task | 713 | * @param main main function of the task |
@@ -745,7 +745,7 @@ GNUNET_SCHEDULER_add_delayed (struct GNUNET_SCHEDULER_Handle * sched, | |||
745 | * @param prerequisite_task run this task after the task with the given | 745 | * @param prerequisite_task run this task after the task with the given |
746 | * task identifier completes (and any of our other | 746 | * task identifier completes (and any of our other |
747 | * conditions, such as delay, read or write-readyness | 747 | * conditions, such as delay, read or write-readyness |
748 | * are satisfied). Use GNUNET_SCHEDULER_NO_PREREQUISITE_TASK to not have any dependency | 748 | * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency |
749 | * on completion of other tasks. | 749 | * on completion of other tasks. |
750 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" | 750 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" |
751 | * @param rfd read file-descriptor | 751 | * @param rfd read file-descriptor |
@@ -788,7 +788,7 @@ GNUNET_SCHEDULER_add_read (struct GNUNET_SCHEDULER_Handle * sched, | |||
788 | * @param prerequisite_task run this task after the task with the given | 788 | * @param prerequisite_task run this task after the task with the given |
789 | * task identifier completes (and any of our other | 789 | * task identifier completes (and any of our other |
790 | * conditions, such as delay, read or write-readyness | 790 | * conditions, such as delay, read or write-readyness |
791 | * are satisfied). Use GNUNET_SCHEDULER_NO_PREREQUISITE_TASK to not have any dependency | 791 | * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency |
792 | * on completion of other tasks. | 792 | * on completion of other tasks. |
793 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" | 793 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" |
794 | * @param wfd write file-descriptor | 794 | * @param wfd write file-descriptor |
@@ -841,7 +841,7 @@ GNUNET_SCHEDULER_add_write (struct GNUNET_SCHEDULER_Handle * sched, | |||
841 | * @param prerequisite_task run this task after the task with the given | 841 | * @param prerequisite_task run this task after the task with the given |
842 | * task identifier completes (and any of our other | 842 | * task identifier completes (and any of our other |
843 | * conditions, such as delay, read or write-readyness | 843 | * conditions, such as delay, read or write-readyness |
844 | * are satisfied). Use GNUNET_SCHEDULER_NO_PREREQUISITE_TASK to not have any dependency | 844 | * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency |
845 | * on completion of other tasks. | 845 | * on completion of other tasks. |
846 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" | 846 | * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" |
847 | * @param nfds highest-numbered file descriptor in any of the two sets plus one | 847 | * @param nfds highest-numbered file descriptor in any of the two sets plus one |
diff --git a/src/util/server.c b/src/util/server.c index f604fbc50..8ffc9c027 100644 --- a/src/util/server.c +++ b/src/util/server.c | |||
@@ -223,7 +223,7 @@ struct GNUNET_SERVER_Client | |||
223 | 223 | ||
224 | /** | 224 | /** |
225 | * Current task identifier for the receive call | 225 | * Current task identifier for the receive call |
226 | * (or GNUNET_SCHEDULER_NO_PREREQUISITE_TASK for none). | 226 | * (or GNUNET_SCHEDULER_NO_TASK for none). |
227 | */ | 227 | */ |
228 | GNUNET_SCHEDULER_TaskIdentifier my_receive; | 228 | GNUNET_SCHEDULER_TaskIdentifier my_receive; |
229 | 229 | ||
@@ -351,7 +351,7 @@ process_listen_socket (void *cls, | |||
351 | GNUNET_SCHEDULER_add_select (server->sched, | 351 | GNUNET_SCHEDULER_add_select (server->sched, |
352 | GNUNET_YES, | 352 | GNUNET_YES, |
353 | GNUNET_SCHEDULER_PRIORITY_HIGH, | 353 | GNUNET_SCHEDULER_PRIORITY_HIGH, |
354 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 354 | GNUNET_SCHEDULER_NO_TASK, |
355 | GNUNET_TIME_UNIT_FOREVER_REL, | 355 | GNUNET_TIME_UNIT_FOREVER_REL, |
356 | GNUNET_MAX (server->listen_socket, | 356 | GNUNET_MAX (server->listen_socket, |
357 | server->shutpipe[0]) + 1, &r, NULL, | 357 | server->shutpipe[0]) + 1, &r, NULL, |
@@ -483,7 +483,7 @@ GNUNET_SERVER_create (struct GNUNET_SCHEDULER_Handle *sched, | |||
483 | GNUNET_SCHEDULER_add_select (sched, | 483 | GNUNET_SCHEDULER_add_select (sched, |
484 | GNUNET_YES, | 484 | GNUNET_YES, |
485 | GNUNET_SCHEDULER_PRIORITY_HIGH, | 485 | GNUNET_SCHEDULER_PRIORITY_HIGH, |
486 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 486 | GNUNET_SCHEDULER_NO_TASK, |
487 | GNUNET_TIME_UNIT_FOREVER_REL, | 487 | GNUNET_TIME_UNIT_FOREVER_REL, |
488 | GNUNET_MAX (ret->listen_socket, | 488 | GNUNET_MAX (ret->listen_socket, |
489 | ret->shutpipe[0]) + 1, &r, | 489 | ret->shutpipe[0]) + 1, &r, |
@@ -621,7 +621,7 @@ shutdown_incoming_processing (struct GNUNET_SERVER_Client *client) | |||
621 | struct NotifyList *n; | 621 | struct NotifyList *n; |
622 | unsigned int rc; | 622 | unsigned int rc; |
623 | 623 | ||
624 | GNUNET_assert (client->my_receive == GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); | 624 | GNUNET_assert (client->my_receive == GNUNET_SCHEDULER_NO_TASK); |
625 | rc = client->reference_count; | 625 | rc = client->reference_count; |
626 | if (client->server != NULL) | 626 | if (client->server != NULL) |
627 | { | 627 | { |
@@ -740,7 +740,7 @@ process_incoming (void *cls, | |||
740 | const char *cbuf = buf; | 740 | const char *cbuf = buf; |
741 | size_t maxcpy; | 741 | size_t maxcpy; |
742 | 742 | ||
743 | client->my_receive = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 743 | client->my_receive = GNUNET_SCHEDULER_NO_TASK; |
744 | if ((buf == NULL) || | 744 | if ((buf == NULL) || |
745 | (available == 0) || | 745 | (available == 0) || |
746 | (errCode != 0) || | 746 | (errCode != 0) || |
@@ -1107,9 +1107,9 @@ GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client) | |||
1107 | { | 1107 | { |
1108 | if (client->server == NULL) | 1108 | if (client->server == NULL) |
1109 | return; /* already disconnected */ | 1109 | return; /* already disconnected */ |
1110 | GNUNET_assert (client->my_receive != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); | 1110 | GNUNET_assert (client->my_receive != GNUNET_SCHEDULER_NO_TASK); |
1111 | client->receive_cancel (client->client_closure, client->my_receive); | 1111 | client->receive_cancel (client->client_closure, client->my_receive); |
1112 | client->my_receive = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 1112 | client->my_receive = GNUNET_SCHEDULER_NO_TASK; |
1113 | shutdown_incoming_processing (client); | 1113 | shutdown_incoming_processing (client); |
1114 | } | 1114 | } |
1115 | 1115 | ||
diff --git a/src/util/test_network.c b/src/util/test_network.c index b55b346a7..02555c299 100644 --- a/src/util/test_network.c +++ b/src/util/test_network.c | |||
@@ -169,7 +169,7 @@ task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
169 | GNUNET_SCHEDULER_add_read (tc->sched, | 169 | GNUNET_SCHEDULER_add_read (tc->sched, |
170 | GNUNET_NO, | 170 | GNUNET_NO, |
171 | GNUNET_SCHEDULER_PRIORITY_HIGH, | 171 | GNUNET_SCHEDULER_PRIORITY_HIGH, |
172 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 172 | GNUNET_SCHEDULER_NO_TASK, |
173 | GNUNET_TIME_UNIT_FOREVER_REL, | 173 | GNUNET_TIME_UNIT_FOREVER_REL, |
174 | ls, &run_accept, cls); | 174 | ls, &run_accept, cls); |
175 | } | 175 | } |
diff --git a/src/util/test_network_addressing.c b/src/util/test_network_addressing.c index 4a571fff5..3c2a690d9 100644 --- a/src/util/test_network_addressing.c +++ b/src/util/test_network_addressing.c | |||
@@ -159,7 +159,7 @@ task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
159 | GNUNET_SCHEDULER_add_read (tc->sched, | 159 | GNUNET_SCHEDULER_add_read (tc->sched, |
160 | GNUNET_NO, | 160 | GNUNET_NO, |
161 | GNUNET_SCHEDULER_PRIORITY_HIGH, | 161 | GNUNET_SCHEDULER_PRIORITY_HIGH, |
162 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 162 | GNUNET_SCHEDULER_NO_TASK, |
163 | GNUNET_TIME_UNIT_FOREVER_REL, | 163 | GNUNET_TIME_UNIT_FOREVER_REL, |
164 | ls, &run_accept, cls); | 164 | ls, &run_accept, cls); |
165 | } | 165 | } |
diff --git a/src/util/test_network_receive_cancel.c b/src/util/test_network_receive_cancel.c index e22e24d8c..7eb31153c 100644 --- a/src/util/test_network_receive_cancel.c +++ b/src/util/test_network_receive_cancel.c | |||
@@ -123,13 +123,13 @@ task_receive_cancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
123 | GNUNET_SCHEDULER_add_read (tc->sched, | 123 | GNUNET_SCHEDULER_add_read (tc->sched, |
124 | GNUNET_NO, | 124 | GNUNET_NO, |
125 | GNUNET_SCHEDULER_PRIORITY_HIGH, | 125 | GNUNET_SCHEDULER_PRIORITY_HIGH, |
126 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 126 | GNUNET_SCHEDULER_NO_TASK, |
127 | GNUNET_TIME_UNIT_FOREVER_REL, | 127 | GNUNET_TIME_UNIT_FOREVER_REL, |
128 | ls, &run_accept_cancel, cls); | 128 | ls, &run_accept_cancel, cls); |
129 | GNUNET_SCHEDULER_add_delayed (tc->sched, | 129 | GNUNET_SCHEDULER_add_delayed (tc->sched, |
130 | GNUNET_NO, | 130 | GNUNET_NO, |
131 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 131 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
132 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 132 | GNUNET_SCHEDULER_NO_TASK, |
133 | GNUNET_TIME_UNIT_SECONDS, | 133 | GNUNET_TIME_UNIT_SECONDS, |
134 | &receive_cancel_task, cls); | 134 | &receive_cancel_task, cls); |
135 | } | 135 | } |
diff --git a/src/util/test_scheduler.c b/src/util/test_scheduler.c index 855b3a08a..d5a93ed7d 100644 --- a/src/util/test_scheduler.c +++ b/src/util/test_scheduler.c | |||
@@ -118,13 +118,13 @@ task5 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
118 | GNUNET_SCHEDULER_add_read (tc->sched, | 118 | GNUNET_SCHEDULER_add_read (tc->sched, |
119 | GNUNET_NO, | 119 | GNUNET_NO, |
120 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, | 120 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, |
121 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 121 | GNUNET_SCHEDULER_NO_TASK, |
122 | GNUNET_TIME_UNIT_FOREVER_REL, | 122 | GNUNET_TIME_UNIT_FOREVER_REL, |
123 | fds[0], &taskRd, cls); | 123 | fds[0], &taskRd, cls); |
124 | GNUNET_SCHEDULER_add_write (tc->sched, | 124 | GNUNET_SCHEDULER_add_write (tc->sched, |
125 | GNUNET_NO, | 125 | GNUNET_NO, |
126 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, | 126 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, |
127 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 127 | GNUNET_SCHEDULER_NO_TASK, |
128 | GNUNET_TIME_UNIT_FOREVER_REL, | 128 | GNUNET_TIME_UNIT_FOREVER_REL, |
129 | fds[1], &taskWrt, cls); | 129 | fds[1], &taskWrt, cls); |
130 | } | 130 | } |
@@ -144,7 +144,7 @@ task1 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
144 | t2 = GNUNET_SCHEDULER_add_after (tc->sched, | 144 | t2 = GNUNET_SCHEDULER_add_after (tc->sched, |
145 | GNUNET_NO, | 145 | GNUNET_NO, |
146 | GNUNET_SCHEDULER_PRIORITY_IDLE, | 146 | GNUNET_SCHEDULER_PRIORITY_IDLE, |
147 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 147 | GNUNET_SCHEDULER_NO_TASK, |
148 | &task2, cls); | 148 | &task2, cls); |
149 | /* t3 will go before t4: higher priority */ | 149 | /* t3 will go before t4: higher priority */ |
150 | t4 = GNUNET_SCHEDULER_add_after (tc->sched, | 150 | t4 = GNUNET_SCHEDULER_add_after (tc->sched, |
diff --git a/src/util/test_scheduler_delay.c b/src/util/test_scheduler_delay.c index 76cbf94d8..f5477fd4c 100644 --- a/src/util/test_scheduler_delay.c +++ b/src/util/test_scheduler_delay.c | |||
@@ -68,7 +68,7 @@ test_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
68 | GNUNET_SCHEDULER_add_delayed (tc->sched, | 68 | GNUNET_SCHEDULER_add_delayed (tc->sched, |
69 | GNUNET_NO, | 69 | GNUNET_NO, |
70 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, | 70 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, |
71 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 71 | GNUNET_SCHEDULER_NO_TASK, |
72 | GNUNET_TIME_relative_multiply | 72 | GNUNET_TIME_relative_multiply |
73 | (GNUNET_TIME_UNIT_MILLISECONDS, i), | 73 | (GNUNET_TIME_UNIT_MILLISECONDS, i), |
74 | &test_task, NULL); | 74 | &test_task, NULL); |
diff --git a/src/util/test_server.c b/src/util/test_server.c index c26d64270..0f2ea3ce7 100644 --- a/src/util/test_server.c +++ b/src/util/test_server.c | |||
@@ -77,7 +77,7 @@ my_receive (void *cls, | |||
77 | struct SignalTimeoutContext *stctx; | 77 | struct SignalTimeoutContext *stctx; |
78 | GNUNET_SCHEDULER_TaskIdentifier ret; | 78 | GNUNET_SCHEDULER_TaskIdentifier ret; |
79 | 79 | ||
80 | ret = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 80 | ret = GNUNET_SCHEDULER_NO_TASK; |
81 | switch (*ok) | 81 | switch (*ok) |
82 | { | 82 | { |
83 | case 1: | 83 | case 1: |
@@ -98,7 +98,7 @@ my_receive (void *cls, | |||
98 | ret = GNUNET_SCHEDULER_add_delayed (sched, | 98 | ret = GNUNET_SCHEDULER_add_delayed (sched, |
99 | GNUNET_NO, | 99 | GNUNET_NO, |
100 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 100 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
101 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 101 | GNUNET_SCHEDULER_NO_TASK, |
102 | timeout, &signal_timeout, stctx); | 102 | timeout, &signal_timeout, stctx); |
103 | break; | 103 | break; |
104 | default: | 104 | default: |
diff --git a/src/util/test_server_disconnect.c b/src/util/test_server_disconnect.c index 7eab48284..d737e92ec 100644 --- a/src/util/test_server_disconnect.c +++ b/src/util/test_server_disconnect.c | |||
@@ -94,7 +94,7 @@ recv_cb (void *cls, | |||
94 | GNUNET_SCHEDULER_add_delayed (sched, | 94 | GNUNET_SCHEDULER_add_delayed (sched, |
95 | GNUNET_YES, | 95 | GNUNET_YES, |
96 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 96 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
97 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 97 | GNUNET_SCHEDULER_NO_TASK, |
98 | GNUNET_TIME_relative_multiply | 98 | GNUNET_TIME_relative_multiply |
99 | (GNUNET_TIME_UNIT_MILLISECONDS, 50), | 99 | (GNUNET_TIME_UNIT_MILLISECONDS, 50), |
100 | &send_done, argclient); | 100 | &send_done, argclient); |
@@ -104,7 +104,7 @@ recv_cb (void *cls, | |||
104 | GNUNET_SCHEDULER_add_delayed (sched, | 104 | GNUNET_SCHEDULER_add_delayed (sched, |
105 | GNUNET_YES, | 105 | GNUNET_YES, |
106 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 106 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
107 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 107 | GNUNET_SCHEDULER_NO_TASK, |
108 | GNUNET_TIME_relative_multiply | 108 | GNUNET_TIME_relative_multiply |
109 | (GNUNET_TIME_UNIT_MILLISECONDS, 50), | 109 | (GNUNET_TIME_UNIT_MILLISECONDS, 50), |
110 | &server_disconnect, argclient); | 110 | &server_disconnect, argclient); |
diff --git a/src/util/test_server_with_client.c b/src/util/test_server_with_client.c index 22cf2cded..e5eb50d8e 100644 --- a/src/util/test_server_with_client.c +++ b/src/util/test_server_with_client.c | |||
@@ -86,7 +86,7 @@ recv_cb (void *cls, | |||
86 | GNUNET_SCHEDULER_add_delayed (sched, | 86 | GNUNET_SCHEDULER_add_delayed (sched, |
87 | GNUNET_YES, | 87 | GNUNET_YES, |
88 | GNUNET_SCHEDULER_PRIORITY_KEEP, | 88 | GNUNET_SCHEDULER_PRIORITY_KEEP, |
89 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | 89 | GNUNET_SCHEDULER_NO_TASK, |
90 | GNUNET_TIME_relative_multiply | 90 | GNUNET_TIME_relative_multiply |
91 | (GNUNET_TIME_UNIT_MILLISECONDS, 50), | 91 | (GNUNET_TIME_UNIT_MILLISECONDS, 50), |
92 | &send_done, argclient); | 92 | &send_done, argclient); |