From: Christian Grothoff Date: Tue, 11 May 2010 13:31:41 +0000 (+0000) Subject: fix X-Git-Tag: initial-import-from-subversion-38251~21767 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bd3ab1e9cafa730d9eaf2d1113467ea89de1916b;p=oweals%2Fgnunet.git fix --- diff --git a/src/util/test_service.c b/src/util/test_service.c index 5f3146205..c406a0f24 100644 --- a/src/util/test_service.c +++ b/src/util/test_service.c @@ -43,20 +43,6 @@ static struct GNUNET_SERVICE_Context *sctx; static int ok = 1; -static void -end_it (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) -{ - struct GNUNET_CLIENT_Connection *client = cls; - - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down service\n"); - GNUNET_CLIENT_disconnect (client, GNUNET_NO); - if (sctx != NULL) - { - GNUNET_SERVICE_stop (sctx); - sctx = NULL; - } -} - static size_t build_msg (void *cls, size_t size, void *buf) @@ -68,10 +54,7 @@ build_msg (void *cls, size_t size, void *buf) GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader)); msg->type = htons (MY_TYPE); msg->size = htons (sizeof (struct GNUNET_MessageHeader)); - GNUNET_SCHEDULER_add_continuation (sched, - &end_it, - client, - GNUNET_SCHEDULER_REASON_PREREQ_DONE); + GNUNET_CLIENT_disconnect (client, GNUNET_NO); return sizeof (struct GNUNET_MessageHeader); } @@ -102,6 +85,8 @@ recv_cb (void *cls, { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving client message...\n"); GNUNET_SERVER_receive_done (client, GNUNET_OK); + GNUNET_SCHEDULER_shutdown (sched); + ok = 0; } static struct GNUNET_SERVER_MessageHandler myhandlers[] = {