summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/common_allocation.c2
-rw-r--r--src/util/connection.c22
-rw-r--r--src/util/resolver_api.c26
-rw-r--r--src/util/scheduler.c1
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)
* Dup partially a string (same semantics as strndup).
*
* @param str the string to dup
- * @param len the lenght of the string to dup
+ * @param len the length of the string to dup
* @param filename where in the code was the call to GNUNET_strndup
* @param linenumber where in the code was the call to GNUNET_strndup
* @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,
void
GNUNET_CONNECTION_notify_transmit_ready_cancel (struct
GNUNET_CONNECTION_TransmitHandle
- *h)
+ *th)
{
- GNUNET_assert (h->notify_ready != NULL);
- if (0 != (h->sh->ccs & COCO_TRANSMIT_READY))
+ GNUNET_assert (th->notify_ready != NULL);
+ if (0 != (th->sh->ccs & COCO_TRANSMIT_READY))
{
#if DEBUG_CONNECTION
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "notify_transmit_ready_cancel cancels timeout_task (%p)\n", h);
+ "notify_transmit_ready_cancel cancels timeout_task (%p)\n", th);
#endif
- GNUNET_SCHEDULER_cancel (h->timeout_task);
- h->timeout_task = GNUNET_SCHEDULER_NO_TASK;
- h->sh->ccs -= COCO_TRANSMIT_READY;
+ GNUNET_SCHEDULER_cancel (th->timeout_task);
+ th->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ th->sh->ccs -= COCO_TRANSMIT_READY;
}
else
{
- if (h->sh->write_task != GNUNET_SCHEDULER_NO_TASK)
+ if (th->sh->write_task != GNUNET_SCHEDULER_NO_TASK)
{
- GNUNET_SCHEDULER_cancel (h->sh->write_task);
- h->sh->write_task = GNUNET_SCHEDULER_NO_TASK;
+ GNUNET_SCHEDULER_cancel (th->sh->write_task);
+ th->sh->write_task = GNUNET_SCHEDULER_NO_TASK;
}
}
- h->notify_ready = NULL;
+ th->notify_ready = NULL;
}
/* 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[] = {
/**
* Configuration.
*/
-static const struct GNUNET_CONFIGURATION_Handle *cfg;
+static const struct GNUNET_CONFIGURATION_Handle *resolver_cfg;
/**
* Our connection to the resolver service, created on-demand, but then
@@ -172,7 +172,7 @@ struct GNUNET_RESOLVER_RequestHandle
* (or equivalent).
*/
static void
-check_config (const struct GNUNET_CONFIGURATION_Handle *cfg)
+check_config ()
{
char *hostname;
unsigned int i;
@@ -191,8 +191,8 @@ check_config (const struct GNUNET_CONFIGURATION_Handle *cfg)
v6.sin6_len = sizeof (v6);
#endif
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg, "resolver", "HOSTNAME",
- &hostname))
+ GNUNET_CONFIGURATION_get_value_string (resolver_cfg, "resolver",
+ "HOSTNAME", &hostname))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Must specify `%s' for `%s' in configuration!\n"), "HOSTNAME",
@@ -224,15 +224,15 @@ check_config (const struct GNUNET_CONFIGURATION_Handle *cfg)
/**
* Create the connection to the resolver service.
*
- * @param c configuration to use
+ * @param cfg configuration to use
*/
void
-GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *c)
+GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
{
- GNUNET_assert (NULL != c);
- check_config (c);
+ GNUNET_assert (NULL != cfg);
backoff = GNUNET_TIME_UNIT_MILLISECONDS;
- cfg = c;
+ resolver_cfg = cfg;
+ check_config ();
}
@@ -324,8 +324,6 @@ reconnect ();
/**
* Process pending requests to the resolver.
- *
- * @param h handle to the resolver
*/
static void
process_requests ();
@@ -654,7 +652,7 @@ reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
#if DEBUG_RESOLVER
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to connect to DNS service\n");
#endif
- client = GNUNET_CLIENT_connect ("resolver", cfg);
+ client = GNUNET_CLIENT_connect ("resolver", resolver_cfg);
if (NULL == client)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -703,7 +701,7 @@ reconnect ()
"Will try to connect to DNS service in %llu ms\n",
(unsigned long long) backoff.rel_value);
#endif
- GNUNET_assert (NULL != cfg);
+ GNUNET_assert (NULL != resolver_cfg);
r_task = GNUNET_SCHEDULER_add_delayed (backoff, &reconnect_task, NULL);
backoff = GNUNET_TIME_relative_multiply (backoff, 2);
}
@@ -823,7 +821,7 @@ GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa, socklen_t salen,
{
struct GNUNET_RESOLVER_RequestHandle *rh;
- check_config (cfg);
+ check_config ();
rh = GNUNET_malloc (sizeof (struct GNUNET_RESOLVER_RequestHandle) + salen);
rh->name_callback = callback;
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;
* Sets the select function to use in the scheduler (scheduler_select).
*
* @param new_select new select function to use
+ * @param new_select_cls closure for 'new_select'
* @return previously used select function, NULL for default
*/
void