diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-08 21:21:16 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-08 21:21:16 +0000 |
commit | ad919f61587435cf184aba68caf68d65482c884e (patch) | |
tree | 86c5ce35eaefb9af6aa2dd812b5e932a254a39f7 /src/core | |
parent | 35174cafe6f286e9773ed449bc8e3e610c40e1f4 (diff) | |
download | gnunet-ad919f61587435cf184aba68caf68d65482c884e.tar.gz gnunet-ad919f61587435cf184aba68caf68d65482c884e.zip |
-minor code cleanup and doxygen/style fixes
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/core_api.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c index f07d1ca47..c69e3fe1d 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c | |||
@@ -341,7 +341,7 @@ reconnect (struct GNUNET_CORE_Handle *h); | |||
341 | /** | 341 | /** |
342 | * Task schedule to try to re-connect to core. | 342 | * Task schedule to try to re-connect to core. |
343 | * | 343 | * |
344 | * @param cls the 'struct GNUNET_CORE_Handle' | 344 | * @param cls the `struct GNUNET_CORE_Handle` |
345 | * @param tc task context | 345 | * @param tc task context |
346 | */ | 346 | */ |
347 | static void | 347 | static void |
@@ -350,7 +350,8 @@ reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
350 | struct GNUNET_CORE_Handle *h = cls; | 350 | struct GNUNET_CORE_Handle *h = cls; |
351 | 351 | ||
352 | h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; | 352 | h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; |
353 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to CORE service after delay\n"); | 353 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
354 | "Connecting to CORE service after delay\n"); | ||
354 | reconnect (h); | 355 | reconnect (h); |
355 | } | 356 | } |
356 | 357 | ||
@@ -359,9 +360,9 @@ reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
359 | * Notify clients about disconnect and free | 360 | * Notify clients about disconnect and free |
360 | * the entry for connected peer. | 361 | * the entry for connected peer. |
361 | * | 362 | * |
362 | * @param cls the 'struct GNUNET_CORE_Handle*' | 363 | * @param cls the `struct GNUNET_CORE_Handle *` |
363 | * @param key the peer identity (not used) | 364 | * @param key the peer identity (not used) |
364 | * @param value the 'struct PeerRecord' to free. | 365 | * @param value the `struct PeerRecord` to free. |
365 | * @return #GNUNET_YES (continue) | 366 | * @return #GNUNET_YES (continue) |
366 | */ | 367 | */ |
367 | static int | 368 | static int |
@@ -433,7 +434,8 @@ reconnect_later (struct GNUNET_CORE_Handle *h) | |||
433 | h->currently_down = GNUNET_YES; | 434 | h->currently_down = GNUNET_YES; |
434 | GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); | 435 | GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); |
435 | h->reconnect_task = | 436 | h->reconnect_task = |
436 | GNUNET_SCHEDULER_add_delayed (h->retry_backoff, &reconnect_task, h); | 437 | GNUNET_SCHEDULER_add_delayed (h->retry_backoff, |
438 | &reconnect_task, h); | ||
437 | while (NULL != (cm = h->control_pending_head)) | 439 | while (NULL != (cm = h->control_pending_head)) |
438 | { | 440 | { |
439 | GNUNET_CONTAINER_DLL_remove (h->control_pending_head, | 441 | GNUNET_CONTAINER_DLL_remove (h->control_pending_head, |
@@ -472,7 +474,8 @@ trigger_next_request (struct GNUNET_CORE_Handle *h, int ignore_currently_down); | |||
472 | * @param tc context, can be NULL (!) | 474 | * @param tc context, can be NULL (!) |
473 | */ | 475 | */ |
474 | static void | 476 | static void |
475 | transmission_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 477 | transmission_timeout (void *cls, |
478 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
476 | 479 | ||
477 | 480 | ||
478 | /** | 481 | /** |
@@ -537,7 +540,8 @@ request_next_transmission (struct PeerRecord *pr) | |||
537 | * @param tc context, can be NULL (!) | 540 | * @param tc context, can be NULL (!) |
538 | */ | 541 | */ |
539 | static void | 542 | static void |
540 | transmission_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 543 | transmission_timeout (void *cls, |
544 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
541 | { | 545 | { |
542 | struct PeerRecord *pr = cls; | 546 | struct PeerRecord *pr = cls; |
543 | struct GNUNET_CORE_Handle *h = pr->ch; | 547 | struct GNUNET_CORE_Handle *h = pr->ch; |
@@ -577,10 +581,10 @@ transmission_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
577 | /** | 581 | /** |
578 | * Transmit the next message to the core service. | 582 | * Transmit the next message to the core service. |
579 | * | 583 | * |
580 | * @param cls closure with the 'struct GNUNET_CORE_Handle' | 584 | * @param cls closure with the `struct GNUNET_CORE_Handle` |
581 | * @param size number of bytes available in @a buf | 585 | * @param size number of bytes available in @a buf |
582 | * @param buf where the callee should write the message | 586 | * @param buf where the callee should write the message |
583 | * @return number of bytes written to buf | 587 | * @return number of bytes written to @a buf |
584 | */ | 588 | */ |
585 | static size_t | 589 | static size_t |
586 | transmit_message (void *cls, size_t size, void *buf) | 590 | transmit_message (void *cls, size_t size, void *buf) |
@@ -734,7 +738,7 @@ trigger_next_request (struct GNUNET_CORE_Handle *h, int ignore_currently_down) | |||
734 | /** | 738 | /** |
735 | * Handler for notification messages received from the core. | 739 | * Handler for notification messages received from the core. |
736 | * | 740 | * |
737 | * @param cls our "struct GNUNET_CORE_Handle" | 741 | * @param cls our `struct GNUNET_CORE_Handle` |
738 | * @param msg the message received from the core service | 742 | * @param msg the message received from the core service |
739 | */ | 743 | */ |
740 | static void | 744 | static void |
@@ -1072,7 +1076,8 @@ reconnect (struct GNUNET_CORE_Handle *h) | |||
1072 | unsigned int hpos; | 1076 | unsigned int hpos; |
1073 | 1077 | ||
1074 | GNUNET_assert (NULL == h->client); | 1078 | GNUNET_assert (NULL == h->client); |
1075 | GNUNET_assert (h->currently_down == GNUNET_YES); | 1079 | GNUNET_assert (GNUNET_YES == h->currently_down); |
1080 | GNUNET_assert (NULL != h->cfg); | ||
1076 | h->client = GNUNET_CLIENT_connect ("core", h->cfg); | 1081 | h->client = GNUNET_CLIENT_connect ("core", h->cfg); |
1077 | if (NULL == h->client) | 1082 | if (NULL == h->client) |
1078 | { | 1083 | { |
@@ -1173,7 +1178,8 @@ GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1173 | GNUNET_assert (h->hcnt < | 1178 | GNUNET_assert (h->hcnt < |
1174 | (GNUNET_SERVER_MAX_MESSAGE_SIZE - | 1179 | (GNUNET_SERVER_MAX_MESSAGE_SIZE - |
1175 | sizeof (struct InitMessage)) / sizeof (uint16_t)); | 1180 | sizeof (struct InitMessage)) / sizeof (uint16_t)); |
1176 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to CORE service\n"); | 1181 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1182 | "Connecting to CORE service\n"); | ||
1177 | reconnect (h); | 1183 | reconnect (h); |
1178 | return h; | 1184 | return h; |
1179 | } | 1185 | } |