diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-05-06 09:59:08 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-05-06 09:59:08 +0000 |
commit | cbf929c31e8afdd30b2ba6a6bf85c7942f9afac5 (patch) | |
tree | 160cc5e35666cca195451e909f9fa75229c05b75 /src/util/test_service.c | |
parent | 998cb5efab59bfc5cdf9b324273b367fa8278c0b (diff) | |
download | gnunet-cbf929c31e8afdd30b2ba6a6bf85c7942f9afac5.tar.gz gnunet-cbf929c31e8afdd30b2ba6a6bf85c7942f9afac5.zip |
arm related changes to util things, enabling leaky sockets and shutdown messages from services
Diffstat (limited to 'src/util/test_service.c')
-rw-r--r-- | src/util/test_service.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/util/test_service.c b/src/util/test_service.c index a40630c64..544f86fba 100644 --- a/src/util/test_service.c +++ b/src/util/test_service.c | |||
@@ -43,6 +43,16 @@ static struct GNUNET_SERVICE_Context *sctx; | |||
43 | 43 | ||
44 | static int ok = 1; | 44 | static int ok = 1; |
45 | 45 | ||
46 | void | ||
47 | end_cont (void *cls, | ||
48 | int reason) | ||
49 | { | ||
50 | if (sctx != NULL) | ||
51 | GNUNET_SERVICE_stop (sctx); | ||
52 | else | ||
53 | GNUNET_SCHEDULER_shutdown (sched); | ||
54 | ok = 0; | ||
55 | } | ||
46 | 56 | ||
47 | static void | 57 | static void |
48 | end_it (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 58 | end_it (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
@@ -50,12 +60,7 @@ end_it (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
50 | struct GNUNET_CLIENT_Connection *client = cls; | 60 | struct GNUNET_CLIENT_Connection *client = cls; |
51 | 61 | ||
52 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down service\n"); | 62 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down service\n"); |
53 | GNUNET_CLIENT_service_shutdown (client); | 63 | GNUNET_CLIENT_service_shutdown (sched, client, GNUNET_TIME_UNIT_FOREVER_REL, &end_cont, NULL); |
54 | if (sctx != NULL) | ||
55 | GNUNET_SERVICE_stop (sctx); | ||
56 | else | ||
57 | GNUNET_SCHEDULER_shutdown (sched); | ||
58 | ok = 0; | ||
59 | } | 64 | } |
60 | 65 | ||
61 | 66 | ||