diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-09-02 14:44:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-09-02 14:44:42 +0000 |
commit | e1fda8a5d8674328afa61cc50842fdbd2a7044ba (patch) | |
tree | b36e7c638c5b0cb94a693376419959f12d84b84c /src/util | |
parent | 012cb16a93acbfca1119966d5b4679b99e5c9125 (diff) | |
download | gnunet-e1fda8a5d8674328afa61cc50842fdbd2a7044ba.tar.gz gnunet-e1fda8a5d8674328afa61cc50842fdbd2a7044ba.zip |
doxygen
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/common_allocation.c | 2 | ||||
-rw-r--r-- | src/util/connection.c | 22 | ||||
-rw-r--r-- | src/util/resolver_api.c | 26 | ||||
-rw-r--r-- | src/util/scheduler.c | 1 |
4 files changed, 25 insertions, 26 deletions
diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c index 71aa15add..ad74727bc 100644 --- a/src/util/common_allocation.c +++ b/src/util/common_allocation.c | |||
@@ -222,7 +222,7 @@ GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber) | |||
222 | * Dup partially a string (same semantics as strndup). | 222 | * Dup partially a string (same semantics as strndup). |
223 | * | 223 | * |
224 | * @param str the string to dup | 224 | * @param str the string to dup |
225 | * @param len the lenght of the string to dup | 225 | * @param len the length of the string to dup |
226 | * @param filename where in the code was the call to GNUNET_strndup | 226 | * @param filename where in the code was the call to GNUNET_strndup |
227 | * @param linenumber where in the code was the call to GNUNET_strndup | 227 | * @param linenumber where in the code was the call to GNUNET_strndup |
228 | * @return strndup(str,len) | 228 | * @return strndup(str,len) |
diff --git a/src/util/connection.c b/src/util/connection.c index 8639d2416..2c32923c2 100644 --- a/src/util/connection.c +++ b/src/util/connection.c | |||
@@ -1685,28 +1685,28 @@ GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle *sock, | |||
1685 | void | 1685 | void |
1686 | GNUNET_CONNECTION_notify_transmit_ready_cancel (struct | 1686 | GNUNET_CONNECTION_notify_transmit_ready_cancel (struct |
1687 | GNUNET_CONNECTION_TransmitHandle | 1687 | GNUNET_CONNECTION_TransmitHandle |
1688 | *h) | 1688 | *th) |
1689 | { | 1689 | { |
1690 | GNUNET_assert (h->notify_ready != NULL); | 1690 | GNUNET_assert (th->notify_ready != NULL); |
1691 | if (0 != (h->sh->ccs & COCO_TRANSMIT_READY)) | 1691 | if (0 != (th->sh->ccs & COCO_TRANSMIT_READY)) |
1692 | { | 1692 | { |
1693 | #if DEBUG_CONNECTION | 1693 | #if DEBUG_CONNECTION |
1694 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1694 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1695 | "notify_transmit_ready_cancel cancels timeout_task (%p)\n", h); | 1695 | "notify_transmit_ready_cancel cancels timeout_task (%p)\n", th); |
1696 | #endif | 1696 | #endif |
1697 | GNUNET_SCHEDULER_cancel (h->timeout_task); | 1697 | GNUNET_SCHEDULER_cancel (th->timeout_task); |
1698 | h->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 1698 | th->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
1699 | h->sh->ccs -= COCO_TRANSMIT_READY; | 1699 | th->sh->ccs -= COCO_TRANSMIT_READY; |
1700 | } | 1700 | } |
1701 | else | 1701 | else |
1702 | { | 1702 | { |
1703 | if (h->sh->write_task != GNUNET_SCHEDULER_NO_TASK) | 1703 | if (th->sh->write_task != GNUNET_SCHEDULER_NO_TASK) |
1704 | { | 1704 | { |
1705 | GNUNET_SCHEDULER_cancel (h->sh->write_task); | 1705 | GNUNET_SCHEDULER_cancel (th->sh->write_task); |
1706 | h->sh->write_task = GNUNET_SCHEDULER_NO_TASK; | 1706 | th->sh->write_task = GNUNET_SCHEDULER_NO_TASK; |
1707 | } | 1707 | } |
1708 | } | 1708 | } |
1709 | h->notify_ready = NULL; | 1709 | th->notify_ready = NULL; |
1710 | } | 1710 | } |
1711 | 1711 | ||
1712 | /* end of connection.c */ | 1712 | /* end of connection.c */ |
diff --git a/src/util/resolver_api.c b/src/util/resolver_api.c index 69c49d1e8..87b7bbd46 100644 --- a/src/util/resolver_api.c +++ b/src/util/resolver_api.c | |||
@@ -52,7 +52,7 @@ static const char *loopback[] = { | |||
52 | /** | 52 | /** |
53 | * Configuration. | 53 | * Configuration. |
54 | */ | 54 | */ |
55 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | 55 | static const struct GNUNET_CONFIGURATION_Handle *resolver_cfg; |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * Our connection to the resolver service, created on-demand, but then | 58 | * Our connection to the resolver service, created on-demand, but then |
@@ -172,7 +172,7 @@ struct GNUNET_RESOLVER_RequestHandle | |||
172 | * (or equivalent). | 172 | * (or equivalent). |
173 | */ | 173 | */ |
174 | static void | 174 | static void |
175 | check_config (const struct GNUNET_CONFIGURATION_Handle *cfg) | 175 | check_config () |
176 | { | 176 | { |
177 | char *hostname; | 177 | char *hostname; |
178 | unsigned int i; | 178 | unsigned int i; |
@@ -191,8 +191,8 @@ check_config (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
191 | v6.sin6_len = sizeof (v6); | 191 | v6.sin6_len = sizeof (v6); |
192 | #endif | 192 | #endif |
193 | if (GNUNET_OK != | 193 | if (GNUNET_OK != |
194 | GNUNET_CONFIGURATION_get_value_string (cfg, "resolver", "HOSTNAME", | 194 | GNUNET_CONFIGURATION_get_value_string (resolver_cfg, "resolver", |
195 | &hostname)) | 195 | "HOSTNAME", &hostname)) |
196 | { | 196 | { |
197 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 197 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
198 | _("Must specify `%s' for `%s' in configuration!\n"), "HOSTNAME", | 198 | _("Must specify `%s' for `%s' in configuration!\n"), "HOSTNAME", |
@@ -224,15 +224,15 @@ check_config (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
224 | /** | 224 | /** |
225 | * Create the connection to the resolver service. | 225 | * Create the connection to the resolver service. |
226 | * | 226 | * |
227 | * @param c configuration to use | 227 | * @param cfg configuration to use |
228 | */ | 228 | */ |
229 | void | 229 | void |
230 | GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *c) | 230 | GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg) |
231 | { | 231 | { |
232 | GNUNET_assert (NULL != c); | 232 | GNUNET_assert (NULL != cfg); |
233 | check_config (c); | ||
234 | backoff = GNUNET_TIME_UNIT_MILLISECONDS; | 233 | backoff = GNUNET_TIME_UNIT_MILLISECONDS; |
235 | cfg = c; | 234 | resolver_cfg = cfg; |
235 | check_config (); | ||
236 | } | 236 | } |
237 | 237 | ||
238 | 238 | ||
@@ -324,8 +324,6 @@ reconnect (); | |||
324 | 324 | ||
325 | /** | 325 | /** |
326 | * Process pending requests to the resolver. | 326 | * Process pending requests to the resolver. |
327 | * | ||
328 | * @param h handle to the resolver | ||
329 | */ | 327 | */ |
330 | static void | 328 | static void |
331 | process_requests (); | 329 | process_requests (); |
@@ -654,7 +652,7 @@ reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
654 | #if DEBUG_RESOLVER | 652 | #if DEBUG_RESOLVER |
655 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to connect to DNS service\n"); | 653 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to connect to DNS service\n"); |
656 | #endif | 654 | #endif |
657 | client = GNUNET_CLIENT_connect ("resolver", cfg); | 655 | client = GNUNET_CLIENT_connect ("resolver", resolver_cfg); |
658 | if (NULL == client) | 656 | if (NULL == client) |
659 | { | 657 | { |
660 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 658 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -703,7 +701,7 @@ reconnect () | |||
703 | "Will try to connect to DNS service in %llu ms\n", | 701 | "Will try to connect to DNS service in %llu ms\n", |
704 | (unsigned long long) backoff.rel_value); | 702 | (unsigned long long) backoff.rel_value); |
705 | #endif | 703 | #endif |
706 | GNUNET_assert (NULL != cfg); | 704 | GNUNET_assert (NULL != resolver_cfg); |
707 | r_task = GNUNET_SCHEDULER_add_delayed (backoff, &reconnect_task, NULL); | 705 | r_task = GNUNET_SCHEDULER_add_delayed (backoff, &reconnect_task, NULL); |
708 | backoff = GNUNET_TIME_relative_multiply (backoff, 2); | 706 | backoff = GNUNET_TIME_relative_multiply (backoff, 2); |
709 | } | 707 | } |
@@ -823,7 +821,7 @@ GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa, socklen_t salen, | |||
823 | { | 821 | { |
824 | struct GNUNET_RESOLVER_RequestHandle *rh; | 822 | struct GNUNET_RESOLVER_RequestHandle *rh; |
825 | 823 | ||
826 | check_config (cfg); | 824 | check_config (); |
827 | rh = GNUNET_malloc (sizeof (struct GNUNET_RESOLVER_RequestHandle) + salen); | 825 | rh = GNUNET_malloc (sizeof (struct GNUNET_RESOLVER_RequestHandle) + salen); |
828 | rh->name_callback = callback; | 826 | rh->name_callback = callback; |
829 | rh->cls = cls; | 827 | rh->cls = cls; |
diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 0ed48e793..e2f6700e4 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c | |||
@@ -260,6 +260,7 @@ static void *scheduler_select_cls; | |||
260 | * Sets the select function to use in the scheduler (scheduler_select). | 260 | * Sets the select function to use in the scheduler (scheduler_select). |
261 | * | 261 | * |
262 | * @param new_select new select function to use | 262 | * @param new_select new select function to use |
263 | * @param new_select_cls closure for 'new_select' | ||
263 | * @return previously used select function, NULL for default | 264 | * @return previously used select function, NULL for default |
264 | */ | 265 | */ |
265 | void | 266 | void |