diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-12-23 22:08:21 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-12-23 22:08:21 +0000 |
commit | 912d1dc85990d15f2ce7fcfb837dc37cd327833b (patch) | |
tree | e82c187f9ec24c205b4d23fca4d7866eabc7887c | |
parent | 996d1af584e8ea60a3e833d4e145bc866a3cba45 (diff) | |
download | gnunet-912d1dc85990d15f2ce7fcfb837dc37cd327833b.tar.gz gnunet-912d1dc85990d15f2ce7fcfb837dc37cd327833b.zip |
-doxygen, indentation
-rw-r--r-- | src/util/server.c | 28 | ||||
-rw-r--r-- | src/util/service.c | 12 | ||||
-rw-r--r-- | src/util/strings.c | 2 |
3 files changed, 24 insertions, 18 deletions
diff --git a/src/util/server.c b/src/util/server.c index 8883d212e..c6d887c31 100644 --- a/src/util/server.c +++ b/src/util/server.c | |||
@@ -175,7 +175,7 @@ struct GNUNET_SERVER_Handle | |||
175 | /** | 175 | /** |
176 | * Set to #GNUNET_YES once we are in 'soft' shutdown where we wait for | 176 | * Set to #GNUNET_YES once we are in 'soft' shutdown where we wait for |
177 | * all non-monitor clients to disconnect before we call | 177 | * all non-monitor clients to disconnect before we call |
178 | * #GNUNET_SERVER_destroy. See 'test_monitor_clients'. Set to | 178 | * #GNUNET_SERVER_destroy. See test_monitor_clients(). Set to |
179 | * #GNUNET_SYSERR once the final destroy task has been scheduled | 179 | * #GNUNET_SYSERR once the final destroy task has been scheduled |
180 | * (we cannot run it in the same task). | 180 | * (we cannot run it in the same task). |
181 | */ | 181 | */ |
@@ -632,20 +632,22 @@ GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck access, void *access_cls, | |||
632 | * their requests; however, monitor-clients are likely to 'never' | 632 | * their requests; however, monitor-clients are likely to 'never' |
633 | * disconnect during shutdown and thus will not be considered when | 633 | * disconnect during shutdown and thus will not be considered when |
634 | * determining if the server should continue to exist after | 634 | * determining if the server should continue to exist after |
635 | * 'GNUNET_SERVER_destroy' has been called. | 635 | * #GNUNET_SERVER_destroy() has been called. |
636 | * | 636 | * |
637 | * @param client the client to set the 'monitor' flag on | 637 | * @param client the client to set the 'monitor' flag on |
638 | */ | 638 | */ |
639 | void | 639 | void |
640 | GNUNET_SERVER_client_mark_monitor (struct GNUNET_SERVER_Client *client) | 640 | GNUNET_SERVER_client_mark_monitor (struct GNUNET_SERVER_Client *client) |
641 | { | 641 | { |
642 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
643 | "Marking client as monitor!\n"); | ||
642 | client->is_monitor = GNUNET_YES; | 644 | client->is_monitor = GNUNET_YES; |
643 | } | 645 | } |
644 | 646 | ||
645 | 647 | ||
646 | /** | 648 | /** |
647 | * Helper function for 'test_monitor_clients' to trigger | 649 | * Helper function for #test_monitor_clients() to trigger |
648 | * 'GNUNET_SERVER_destroy' after the stack has unwound. | 650 | * #GNUNET_SERVER_destroy() after the stack has unwound. |
649 | * | 651 | * |
650 | * @param cls the 'struct GNUNET_SERVER_Handle' to destroy | 652 | * @param cls the 'struct GNUNET_SERVER_Handle' to destroy |
651 | * @param tc unused | 653 | * @param tc unused |
@@ -655,6 +657,7 @@ do_destroy (void *cls, | |||
655 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 657 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
656 | { | 658 | { |
657 | struct GNUNET_SERVER_Handle *server = cls; | 659 | struct GNUNET_SERVER_Handle *server = cls; |
660 | |||
658 | GNUNET_SERVER_destroy (server); | 661 | GNUNET_SERVER_destroy (server); |
659 | } | 662 | } |
660 | 663 | ||
@@ -676,8 +679,7 @@ test_monitor_clients (struct GNUNET_SERVER_Handle *server) | |||
676 | if (GNUNET_NO == client->is_monitor) | 679 | if (GNUNET_NO == client->is_monitor) |
677 | return; /* not done yet */ | 680 | return; /* not done yet */ |
678 | server->in_soft_shutdown = GNUNET_SYSERR; | 681 | server->in_soft_shutdown = GNUNET_SYSERR; |
679 | GNUNET_SCHEDULER_add_continuation (&do_destroy, server, | 682 | GNUNET_SCHEDULER_add_now (&do_destroy, server); |
680 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
681 | } | 683 | } |
682 | 684 | ||
683 | 685 | ||
@@ -925,9 +927,9 @@ GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client *client) | |||
925 | * @param sender the "pretended" sender of the message | 927 | * @param sender the "pretended" sender of the message |
926 | * can be NULL! | 928 | * can be NULL! |
927 | * @param message message to transmit | 929 | * @param message message to transmit |
928 | * @return GNUNET_OK if the message was OK and the | 930 | * @return #GNUNET_OK if the message was OK and the |
929 | * connection can stay open | 931 | * connection can stay open |
930 | * GNUNET_SYSERR if the connection to the | 932 | * #GNUNET_SYSERR if the connection to the |
931 | * client should be shut down | 933 | * client should be shut down |
932 | */ | 934 | */ |
933 | int | 935 | int |
@@ -1318,8 +1320,8 @@ GNUNET_SERVER_client_drop (struct GNUNET_SERVER_Client *client) | |||
1318 | * | 1320 | * |
1319 | * @param client the client to get the address for | 1321 | * @param client the client to get the address for |
1320 | * @param addr where to store the address | 1322 | * @param addr where to store the address |
1321 | * @param addrlen where to store the length of the address | 1323 | * @param addrlen where to store the length of the @a addr |
1322 | * @return GNUNET_OK on success | 1324 | * @return #GNUNET_OK on success |
1323 | */ | 1325 | */ |
1324 | int | 1326 | int |
1325 | GNUNET_SERVER_client_get_address (struct GNUNET_SERVER_Client *client, | 1327 | GNUNET_SERVER_client_get_address (struct GNUNET_SERVER_Client *client, |
@@ -1553,7 +1555,7 @@ GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client) | |||
1553 | * instead of potentially buffering multiple messages. | 1555 | * instead of potentially buffering multiple messages. |
1554 | * | 1556 | * |
1555 | * @param client handle to the client | 1557 | * @param client handle to the client |
1556 | * @return GNUNET_OK on success | 1558 | * @return #GNUNET_OK on success |
1557 | */ | 1559 | */ |
1558 | int | 1560 | int |
1559 | GNUNET_SERVER_client_disable_corking (struct GNUNET_SERVER_Client *client) | 1561 | GNUNET_SERVER_client_disable_corking (struct GNUNET_SERVER_Client *client) |
@@ -1566,7 +1568,7 @@ GNUNET_SERVER_client_disable_corking (struct GNUNET_SERVER_Client *client) | |||
1566 | * Wrapper for transmission notification that calls the original | 1568 | * Wrapper for transmission notification that calls the original |
1567 | * callback and update the last activity time for our connection. | 1569 | * callback and update the last activity time for our connection. |
1568 | * | 1570 | * |
1569 | * @param cls the 'struct GNUNET_SERVER_Client' | 1571 | * @param cls the `struct GNUNET_SERVER_Client` |
1570 | * @param size number of bytes we can transmit | 1572 | * @param size number of bytes we can transmit |
1571 | * @param buf where to copy the message | 1573 | * @param buf where to copy the message |
1572 | * @return number of bytes actually transmitted | 1574 | * @return number of bytes actually transmitted |
@@ -1597,7 +1599,7 @@ transmit_ready_callback_wrapper (void *cls, size_t size, void *buf) | |||
1597 | * @param callback_cls closure for @a callback | 1599 | * @param callback_cls closure for @a callback |
1598 | * @return non-NULL if the notify callback was queued; can be used | 1600 | * @return non-NULL if the notify callback was queued; can be used |
1599 | * to cancel the request using | 1601 | * to cancel the request using |
1600 | * #GNUNET_SERVER_notify_transmit_ready_cancel. | 1602 | * #GNUNET_SERVER_notify_transmit_ready_cancel(). |
1601 | * NULL if we are already going to notify someone else (busy) | 1603 | * NULL if we are already going to notify someone else (busy) |
1602 | */ | 1604 | */ |
1603 | struct GNUNET_SERVER_TransmitHandle * | 1605 | struct GNUNET_SERVER_TransmitHandle * |
diff --git a/src/util/service.c b/src/util/service.c index c3bb1039e..5be6bc33f 100644 --- a/src/util/service.c +++ b/src/util/service.c | |||
@@ -389,7 +389,8 @@ get_pid_file_name (struct GNUNET_SERVICE_Context *sctx) | |||
389 | * no ACL configured) | 389 | * no ACL configured) |
390 | */ | 390 | */ |
391 | static int | 391 | static int |
392 | process_acl4 (struct GNUNET_STRINGS_IPv4NetworkPolicy **ret, struct GNUNET_SERVICE_Context *sctx, | 392 | process_acl4 (struct GNUNET_STRINGS_IPv4NetworkPolicy **ret, |
393 | struct GNUNET_SERVICE_Context *sctx, | ||
393 | const char *option) | 394 | const char *option) |
394 | { | 395 | { |
395 | char *opt; | 396 | char *opt; |
@@ -426,7 +427,8 @@ process_acl4 (struct GNUNET_STRINGS_IPv4NetworkPolicy **ret, struct GNUNET_SERVI | |||
426 | * no ACL configured) | 427 | * no ACL configured) |
427 | */ | 428 | */ |
428 | static int | 429 | static int |
429 | process_acl6 (struct GNUNET_STRINGS_IPv6NetworkPolicy **ret, struct GNUNET_SERVICE_Context *sctx, | 430 | process_acl6 (struct GNUNET_STRINGS_IPv6NetworkPolicy **ret, |
431 | struct GNUNET_SERVICE_Context *sctx, | ||
430 | const char *option) | 432 | const char *option) |
431 | { | 433 | { |
432 | char *opt; | 434 | char *opt; |
@@ -464,7 +466,8 @@ process_acl6 (struct GNUNET_STRINGS_IPv6NetworkPolicy **ret, struct GNUNET_SERVI | |||
464 | * parameter is ignore on systems other than LINUX | 466 | * parameter is ignore on systems other than LINUX |
465 | */ | 467 | */ |
466 | static void | 468 | static void |
467 | add_unixpath (struct sockaddr **saddrs, socklen_t * saddrlens, | 469 | add_unixpath (struct sockaddr **saddrs, |
470 | socklen_t *saddrlens, | ||
468 | const char *unixpath, | 471 | const char *unixpath, |
469 | int abstract) | 472 | int abstract) |
470 | { | 473 | { |
@@ -1125,7 +1128,8 @@ write_pid_file (struct GNUNET_SERVICE_Context *sctx, pid_t pid) | |||
1125 | * @param tc unused | 1128 | * @param tc unused |
1126 | */ | 1129 | */ |
1127 | static void | 1130 | static void |
1128 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 1131 | shutdown_task (void *cls, |
1132 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1129 | { | 1133 | { |
1130 | struct GNUNET_SERVICE_Context *service = cls; | 1134 | struct GNUNET_SERVICE_Context *service = cls; |
1131 | struct GNUNET_SERVER_Handle *server = service->server; | 1135 | struct GNUNET_SERVER_Handle *server = service->server; |
diff --git a/src/util/strings.c b/src/util/strings.c index 87c426b6c..ba1a91641 100644 --- a/src/util/strings.c +++ b/src/util/strings.c | |||
@@ -47,7 +47,7 @@ | |||
47 | * | 47 | * |
48 | * Unlike using "snprintf" with "%s", this function | 48 | * Unlike using "snprintf" with "%s", this function |
49 | * will add 0-terminators after each string. The | 49 | * will add 0-terminators after each string. The |
50 | * "GNUNET_string_buffer_tokenize" function can be | 50 | * #GNUNET_string_buffer_tokenize() function can be |
51 | * used to parse the buffer back into individual | 51 | * used to parse the buffer back into individual |
52 | * strings. | 52 | * strings. |
53 | * | 53 | * |