aboutsummaryrefslogtreecommitdiff
path: root/src/util/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/server.c')
-rw-r--r--src/util/server.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/util/server.c b/src/util/server.c
index 0433feb58..8dedd28fd 100644
--- a/src/util/server.c
+++ b/src/util/server.c
@@ -389,17 +389,17 @@ GNUNET_SERVER_client_set_user_context_ (struct GNUNET_SERVER_Client *client,
389 * 389 *
390 * @param cls handle to our server for which we are processing the listen 390 * @param cls handle to our server for which we are processing the listen
391 * socket 391 * socket
392 * @param tc reason why we are running right now
393 */ 392 */
394static void 393static void
395process_listen_socket (void *cls, 394process_listen_socket (void *cls)
396 const struct GNUNET_SCHEDULER_TaskContext *tc)
397{ 395{
398 struct GNUNET_SERVER_Handle *server = cls; 396 struct GNUNET_SERVER_Handle *server = cls;
397 const struct GNUNET_SCHEDULER_TaskContext *tc;
399 struct GNUNET_CONNECTION_Handle *sock; 398 struct GNUNET_CONNECTION_Handle *sock;
400 unsigned int i; 399 unsigned int i;
401 400
402 server->listen_task = NULL; 401 server->listen_task = NULL;
402 tc = GNUNET_SCHEDULER_get_task_context ();
403 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 403 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
404 { 404 {
405 /* ignore shutdown, someone else will take care of it! */ 405 /* ignore shutdown, someone else will take care of it! */
@@ -655,12 +655,10 @@ GNUNET_SERVER_client_mark_monitor (struct GNUNET_SERVER_Client *client)
655 * Helper function for #test_monitor_clients() to trigger 655 * Helper function for #test_monitor_clients() to trigger
656 * #GNUNET_SERVER_destroy() after the stack has unwound. 656 * #GNUNET_SERVER_destroy() after the stack has unwound.
657 * 657 *
658 * @param cls the 'struct GNUNET_SERVER_Handle' to destroy 658 * @param cls the `struct GNUNET_SERVER_Handle *` to destroy
659 * @param tc unused
660 */ 659 */
661static void 660static void
662do_destroy (void *cls, 661do_destroy (void *cls)
663 const struct GNUNET_SCHEDULER_TaskContext *tc)
664{ 662{
665 struct GNUNET_SERVER_Handle *server = cls; 663 struct GNUNET_SERVER_Handle *server = cls;
666 664
@@ -887,18 +885,18 @@ GNUNET_SERVER_set_callbacks (struct GNUNET_SERVER_Handle *server,
887 * Task run to warn about missing calls to #GNUNET_SERVER_receive_done. 885 * Task run to warn about missing calls to #GNUNET_SERVER_receive_done.
888 * 886 *
889 * @param cls our `struct GNUNET_SERVER_Client *` to process more requests from 887 * @param cls our `struct GNUNET_SERVER_Client *` to process more requests from
890 * @param tc scheduler context (unused)
891 */ 888 */
892static void 889static void
893warn_no_receive_done (void *cls, 890warn_no_receive_done (void *cls)
894 const struct GNUNET_SCHEDULER_TaskContext *tc)
895{ 891{
896 struct GNUNET_SERVER_Client *client = cls; 892 struct GNUNET_SERVER_Client *client = cls;
893 const struct GNUNET_SCHEDULER_TaskContext *tc;
897 894
898 GNUNET_break (0 != client->warn_type); /* type should never be 0 here, as we don't use 0 */ 895 GNUNET_break (0 != client->warn_type); /* type should never be 0 here, as we don't use 0 */
899 client->warn_task = 896 client->warn_task =
900 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, 897 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
901 &warn_no_receive_done, client); 898 &warn_no_receive_done, client);
899 tc = GNUNET_SCHEDULER_get_task_context ();
902 if (0 == (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 900 if (0 == (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
903 LOG (GNUNET_ERROR_TYPE_WARNING, 901 LOG (GNUNET_ERROR_TYPE_WARNING,
904 _("Processing code for message of type %u did not call `GNUNET_SERVER_receive_done' after %s\n"), 902 _("Processing code for message of type %u did not call `GNUNET_SERVER_receive_done' after %s\n"),
@@ -1199,11 +1197,9 @@ process_incoming (void *cls,
1199 * and process requests. 1197 * and process requests.
1200 * 1198 *
1201 * @param cls our `struct GNUNET_SERVER_Client *` to process more requests from 1199 * @param cls our `struct GNUNET_SERVER_Client *` to process more requests from
1202 * @param tc scheduler context (unused)
1203 */ 1200 */
1204static void 1201static void
1205restart_processing (void *cls, 1202restart_processing (void *cls)
1206 const struct GNUNET_SCHEDULER_TaskContext *tc)
1207{ 1203{
1208 struct GNUNET_SERVER_Client *client = cls; 1204 struct GNUNET_SERVER_Client *client = cls;
1209 1205
@@ -1497,11 +1493,9 @@ GNUNET_SERVER_connect_notify_cancel (struct GNUNET_SERVER_Handle *server,
1497 * 'connection.c' is not allowed (see #2329). 1493 * 'connection.c' is not allowed (see #2329).
1498 * 1494 *
1499 * @param cls connection to destroy 1495 * @param cls connection to destroy
1500 * @param tc scheduler context (unused)
1501 */ 1496 */
1502static void 1497static void
1503destroy_connection (void *cls, 1498destroy_connection (void *cls)
1504 const struct GNUNET_SCHEDULER_TaskContext *tc)
1505{ 1499{
1506 struct GNUNET_CONNECTION_Handle *connection = cls; 1500 struct GNUNET_CONNECTION_Handle *connection = cls;
1507 1501