diff options
Diffstat (limited to 'src/util/resolver_api.c')
-rw-r--r-- | src/util/resolver_api.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/util/resolver_api.c b/src/util/resolver_api.c index f3988c7c5..8ddaafa0a 100644 --- a/src/util/resolver_api.c +++ b/src/util/resolver_api.c | |||
@@ -78,13 +78,13 @@ static struct GNUNET_TIME_Relative backoff; | |||
78 | /** | 78 | /** |
79 | * Task for reconnecting. | 79 | * Task for reconnecting. |
80 | */ | 80 | */ |
81 | static GNUNET_SCHEDULER_TaskIdentifier r_task; | 81 | static struct GNUNET_SCHEDULER_Task * r_task; |
82 | 82 | ||
83 | /** | 83 | /** |
84 | * Task ID of shutdown task; only present while we have a | 84 | * Task ID of shutdown task; only present while we have a |
85 | * connection to the resolver service. | 85 | * connection to the resolver service. |
86 | */ | 86 | */ |
87 | static GNUNET_SCHEDULER_TaskIdentifier s_task; | 87 | static struct GNUNET_SCHEDULER_Task * s_task; |
88 | 88 | ||
89 | 89 | ||
90 | /** | 90 | /** |
@@ -131,7 +131,7 @@ struct GNUNET_RESOLVER_RequestHandle | |||
131 | * Task handle for making reply callbacks in numeric lookups | 131 | * Task handle for making reply callbacks in numeric lookups |
132 | * asynchronous, and for timeout handling. | 132 | * asynchronous, and for timeout handling. |
133 | */ | 133 | */ |
134 | GNUNET_SCHEDULER_TaskIdentifier task; | 134 | struct GNUNET_SCHEDULER_Task * task; |
135 | 135 | ||
136 | /** | 136 | /** |
137 | * Desired address family. | 137 | * Desired address family. |
@@ -256,15 +256,15 @@ GNUNET_RESOLVER_disconnect () | |||
256 | GNUNET_CLIENT_disconnect (client); | 256 | GNUNET_CLIENT_disconnect (client); |
257 | client = NULL; | 257 | client = NULL; |
258 | } | 258 | } |
259 | if (GNUNET_SCHEDULER_NO_TASK != r_task) | 259 | if (NULL != r_task) |
260 | { | 260 | { |
261 | GNUNET_SCHEDULER_cancel (r_task); | 261 | GNUNET_SCHEDULER_cancel (r_task); |
262 | r_task = GNUNET_SCHEDULER_NO_TASK; | 262 | r_task = NULL; |
263 | } | 263 | } |
264 | if (GNUNET_SCHEDULER_NO_TASK != s_task) | 264 | if (NULL != s_task) |
265 | { | 265 | { |
266 | GNUNET_SCHEDULER_cancel (s_task); | 266 | GNUNET_SCHEDULER_cancel (s_task); |
267 | s_task = GNUNET_SCHEDULER_NO_TASK; | 267 | s_task = NULL; |
268 | } | 268 | } |
269 | } | 269 | } |
270 | 270 | ||
@@ -381,7 +381,7 @@ handle_response (void *cls, | |||
381 | rh->addr_callback (rh->cls, NULL, 0); | 381 | rh->addr_callback (rh->cls, NULL, 0); |
382 | } | 382 | } |
383 | GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh); | 383 | GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh); |
384 | if (GNUNET_SCHEDULER_NO_TASK != rh->task) | 384 | if (NULL != rh->task) |
385 | GNUNET_SCHEDULER_cancel (rh->task); | 385 | GNUNET_SCHEDULER_cancel (rh->task); |
386 | GNUNET_free (rh); | 386 | GNUNET_free (rh); |
387 | GNUNET_CLIENT_disconnect (client); | 387 | GNUNET_CLIENT_disconnect (client); |
@@ -410,7 +410,7 @@ handle_response (void *cls, | |||
410 | rh->addr_callback (rh->cls, NULL, 0); | 410 | rh->addr_callback (rh->cls, NULL, 0); |
411 | } | 411 | } |
412 | GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh); | 412 | GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh); |
413 | if (GNUNET_SCHEDULER_NO_TASK != rh->task) | 413 | if (NULL != rh->task) |
414 | GNUNET_SCHEDULER_cancel (rh->task); | 414 | GNUNET_SCHEDULER_cancel (rh->task); |
415 | GNUNET_free (rh); | 415 | GNUNET_free (rh); |
416 | process_requests (); | 416 | process_requests (); |
@@ -428,7 +428,7 @@ handle_response (void *cls, | |||
428 | if (GNUNET_SYSERR != rh->was_transmitted) | 428 | if (GNUNET_SYSERR != rh->was_transmitted) |
429 | rh->name_callback (rh->cls, NULL); | 429 | rh->name_callback (rh->cls, NULL); |
430 | GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh); | 430 | GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh); |
431 | if (GNUNET_SCHEDULER_NO_TASK != rh->task) | 431 | if (NULL != rh->task) |
432 | GNUNET_SCHEDULER_cancel (rh->task); | 432 | GNUNET_SCHEDULER_cancel (rh->task); |
433 | GNUNET_free (rh); | 433 | GNUNET_free (rh); |
434 | GNUNET_CLIENT_disconnect (client); | 434 | GNUNET_CLIENT_disconnect (client); |
@@ -485,7 +485,7 @@ handle_response (void *cls, | |||
485 | if (GNUNET_SYSERR != rh->was_transmitted) | 485 | if (GNUNET_SYSERR != rh->was_transmitted) |
486 | rh->addr_callback (rh->cls, NULL, 0); | 486 | rh->addr_callback (rh->cls, NULL, 0); |
487 | GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh); | 487 | GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh); |
488 | if (GNUNET_SCHEDULER_NO_TASK != rh->task) | 488 | if (NULL != rh->task) |
489 | GNUNET_SCHEDULER_cancel (rh->task); | 489 | GNUNET_SCHEDULER_cancel (rh->task); |
490 | GNUNET_free (rh); | 490 | GNUNET_free (rh); |
491 | GNUNET_CLIENT_disconnect (client); | 491 | GNUNET_CLIENT_disconnect (client); |
@@ -519,7 +519,7 @@ numeric_resolution (void *cls, | |||
519 | struct sockaddr_in6 v6; | 519 | struct sockaddr_in6 v6; |
520 | const char *hostname; | 520 | const char *hostname; |
521 | 521 | ||
522 | rh->task = GNUNET_SCHEDULER_NO_TASK; | 522 | rh->task = NULL; |
523 | memset (&v4, 0, sizeof (v4)); | 523 | memset (&v4, 0, sizeof (v4)); |
524 | v4.sin_family = AF_INET; | 524 | v4.sin_family = AF_INET; |
525 | #if HAVE_SOCKADDR_IN_SIN_LEN | 525 | #if HAVE_SOCKADDR_IN_SIN_LEN |
@@ -582,7 +582,7 @@ loopback_resolution (void *cls, | |||
582 | struct sockaddr_in v4; | 582 | struct sockaddr_in v4; |
583 | struct sockaddr_in6 v6; | 583 | struct sockaddr_in6 v6; |
584 | 584 | ||
585 | rh->task = GNUNET_SCHEDULER_NO_TASK; | 585 | rh->task = NULL; |
586 | memset (&v4, 0, sizeof (v4)); | 586 | memset (&v4, 0, sizeof (v4)); |
587 | v4.sin_addr.s_addr = htonl (INADDR_LOOPBACK); | 587 | v4.sin_addr.s_addr = htonl (INADDR_LOOPBACK); |
588 | v4.sin_family = AF_INET; | 588 | v4.sin_family = AF_INET; |
@@ -625,7 +625,7 @@ static void | |||
625 | shutdown_task (void *cls, | 625 | shutdown_task (void *cls, |
626 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 626 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
627 | { | 627 | { |
628 | s_task = GNUNET_SCHEDULER_NO_TASK; | 628 | s_task = NULL; |
629 | GNUNET_RESOLVER_disconnect (); | 629 | GNUNET_RESOLVER_disconnect (); |
630 | backoff = GNUNET_TIME_UNIT_MILLISECONDS; | 630 | backoff = GNUNET_TIME_UNIT_MILLISECONDS; |
631 | } | 631 | } |
@@ -694,7 +694,7 @@ static void | |||
694 | reconnect_task (void *cls, | 694 | reconnect_task (void *cls, |
695 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 695 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
696 | { | 696 | { |
697 | r_task = GNUNET_SCHEDULER_NO_TASK; | 697 | r_task = NULL; |
698 | if (NULL == req_head) | 698 | if (NULL == req_head) |
699 | return; /* no work pending */ | 699 | return; /* no work pending */ |
700 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 700 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
@@ -721,7 +721,7 @@ reconnect () | |||
721 | { | 721 | { |
722 | struct GNUNET_RESOLVER_RequestHandle *rh; | 722 | struct GNUNET_RESOLVER_RequestHandle *rh; |
723 | 723 | ||
724 | if (GNUNET_SCHEDULER_NO_TASK != r_task) | 724 | if (NULL != r_task) |
725 | return; | 725 | return; |
726 | GNUNET_assert (NULL == client); | 726 | GNUNET_assert (NULL == client); |
727 | if (NULL != (rh = req_head)) | 727 | if (NULL != (rh = req_head)) |
@@ -766,7 +766,7 @@ handle_lookup_timeout (void *cls, | |||
766 | { | 766 | { |
767 | struct GNUNET_RESOLVER_RequestHandle *rh = cls; | 767 | struct GNUNET_RESOLVER_RequestHandle *rh = cls; |
768 | 768 | ||
769 | rh->task = GNUNET_SCHEDULER_NO_TASK; | 769 | rh->task = NULL; |
770 | rh->addr_callback (rh->cls, | 770 | rh->addr_callback (rh->cls, |
771 | NULL, | 771 | NULL, |
772 | 0); | 772 | 0); |
@@ -837,10 +837,10 @@ GNUNET_RESOLVER_ip_get (const char *hostname, int af, | |||
837 | rh); | 837 | rh); |
838 | GNUNET_CONTAINER_DLL_insert_tail (req_head, req_tail, rh); | 838 | GNUNET_CONTAINER_DLL_insert_tail (req_head, req_tail, rh); |
839 | rh->was_queued = GNUNET_YES; | 839 | rh->was_queued = GNUNET_YES; |
840 | if (s_task != GNUNET_SCHEDULER_NO_TASK) | 840 | if (s_task != NULL) |
841 | { | 841 | { |
842 | GNUNET_SCHEDULER_cancel (s_task); | 842 | GNUNET_SCHEDULER_cancel (s_task); |
843 | s_task = GNUNET_SCHEDULER_NO_TASK; | 843 | s_task = NULL; |
844 | } | 844 | } |
845 | process_requests (); | 845 | process_requests (); |
846 | return rh; | 846 | return rh; |
@@ -863,7 +863,7 @@ numeric_reverse (void *cls, | |||
863 | struct GNUNET_RESOLVER_RequestHandle *rh = cls; | 863 | struct GNUNET_RESOLVER_RequestHandle *rh = cls; |
864 | char *result; | 864 | char *result; |
865 | 865 | ||
866 | rh->task = GNUNET_SCHEDULER_NO_TASK; | 866 | rh->task = NULL; |
867 | result = no_resolve (rh->af, | 867 | result = no_resolve (rh->af, |
868 | &rh[1], | 868 | &rh[1], |
869 | rh->data_len); | 869 | rh->data_len); |
@@ -937,10 +937,10 @@ GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa, | |||
937 | req_tail, | 937 | req_tail, |
938 | rh); | 938 | rh); |
939 | rh->was_queued = GNUNET_YES; | 939 | rh->was_queued = GNUNET_YES; |
940 | if (s_task != GNUNET_SCHEDULER_NO_TASK) | 940 | if (s_task != NULL) |
941 | { | 941 | { |
942 | GNUNET_SCHEDULER_cancel (s_task); | 942 | GNUNET_SCHEDULER_cancel (s_task); |
943 | s_task = GNUNET_SCHEDULER_NO_TASK; | 943 | s_task = NULL; |
944 | } | 944 | } |
945 | process_requests (); | 945 | process_requests (); |
946 | return rh; | 946 | return rh; |
@@ -1024,10 +1024,10 @@ GNUNET_RESOLVER_hostname_resolve (int af, | |||
1024 | void | 1024 | void |
1025 | GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh) | 1025 | GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh) |
1026 | { | 1026 | { |
1027 | if (rh->task != GNUNET_SCHEDULER_NO_TASK) | 1027 | if (rh->task != NULL) |
1028 | { | 1028 | { |
1029 | GNUNET_SCHEDULER_cancel (rh->task); | 1029 | GNUNET_SCHEDULER_cancel (rh->task); |
1030 | rh->task = GNUNET_SCHEDULER_NO_TASK; | 1030 | rh->task = NULL; |
1031 | } | 1031 | } |
1032 | if (GNUNET_NO == rh->was_transmitted) | 1032 | if (GNUNET_NO == rh->was_transmitted) |
1033 | { | 1033 | { |