diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-05-11 13:31:41 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-05-11 13:31:41 +0000 |
commit | bd3ab1e9cafa730d9eaf2d1113467ea89de1916b (patch) | |
tree | a2b0005c988a6f2009f637108db42c0365005faa /src/util/test_service.c | |
parent | f6bad19e765e73886a1e5b6d32f0a7551e5757ba (diff) | |
download | gnunet-bd3ab1e9cafa730d9eaf2d1113467ea89de1916b.tar.gz gnunet-bd3ab1e9cafa730d9eaf2d1113467ea89de1916b.zip |
fix
Diffstat (limited to 'src/util/test_service.c')
-rw-r--r-- | src/util/test_service.c | 21 |
1 files changed, 3 insertions, 18 deletions
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; | |||
43 | 43 | ||
44 | static int ok = 1; | 44 | static int ok = 1; |
45 | 45 | ||
46 | static void | ||
47 | end_it (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
48 | { | ||
49 | struct GNUNET_CLIENT_Connection *client = cls; | ||
50 | |||
51 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down service\n"); | ||
52 | GNUNET_CLIENT_disconnect (client, GNUNET_NO); | ||
53 | if (sctx != NULL) | ||
54 | { | ||
55 | GNUNET_SERVICE_stop (sctx); | ||
56 | sctx = NULL; | ||
57 | } | ||
58 | } | ||
59 | |||
60 | 46 | ||
61 | static size_t | 47 | static size_t |
62 | build_msg (void *cls, size_t size, void *buf) | 48 | build_msg (void *cls, size_t size, void *buf) |
@@ -68,10 +54,7 @@ build_msg (void *cls, size_t size, void *buf) | |||
68 | GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader)); | 54 | GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader)); |
69 | msg->type = htons (MY_TYPE); | 55 | msg->type = htons (MY_TYPE); |
70 | msg->size = htons (sizeof (struct GNUNET_MessageHeader)); | 56 | msg->size = htons (sizeof (struct GNUNET_MessageHeader)); |
71 | GNUNET_SCHEDULER_add_continuation (sched, | 57 | GNUNET_CLIENT_disconnect (client, GNUNET_NO); |
72 | &end_it, | ||
73 | client, | ||
74 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | ||
75 | return sizeof (struct GNUNET_MessageHeader); | 58 | return sizeof (struct GNUNET_MessageHeader); |
76 | } | 59 | } |
77 | 60 | ||
@@ -102,6 +85,8 @@ recv_cb (void *cls, | |||
102 | { | 85 | { |
103 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving client message...\n"); | 86 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving client message...\n"); |
104 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 87 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
88 | GNUNET_SCHEDULER_shutdown (sched); | ||
89 | ok = 0; | ||
105 | } | 90 | } |
106 | 91 | ||
107 | static struct GNUNET_SERVER_MessageHandler myhandlers[] = { | 92 | static struct GNUNET_SERVER_MessageHandler myhandlers[] = { |