diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-05-07 07:33:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-05-07 07:33:14 +0000 |
commit | d528ac0433da5d9e5c7a5518ac90c4669a421152 (patch) | |
tree | f3bfd42cad436121a926c9773e3c458674e496d7 /src/testing/testing.c | |
parent | 87617678ba742a1daf222858117e53252e3f0f11 (diff) | |
download | gnunet-d528ac0433da5d9e5c7a5518ac90c4669a421152.tar.gz gnunet-d528ac0433da5d9e5c7a5518ac90c4669a421152.zip |
clean up
Diffstat (limited to 'src/testing/testing.c')
-rw-r--r-- | src/testing/testing.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c index 9558f45eb..dafe0efbe 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -63,18 +63,22 @@ static struct GNUNET_CORE_MessageHandler no_handlers[] = { {NULL, 0, 0} }; | |||
63 | * @param message HELLO message of peer | 63 | * @param message HELLO message of peer |
64 | */ | 64 | */ |
65 | static void | 65 | static void |
66 | process_hello (void *cls, const struct GNUNET_MessageHeader *message) | 66 | process_hello (void *cls, |
67 | const struct GNUNET_MessageHeader *message) | ||
67 | { | 68 | { |
68 | struct GNUNET_TESTING_Daemon *daemon = cls; | 69 | struct GNUNET_TESTING_Daemon *daemon = cls; |
70 | #if WAIT_FOR_HELLO | ||
69 | GNUNET_TESTING_NotifyDaemonRunning cb; | 71 | GNUNET_TESTING_NotifyDaemonRunning cb; |
72 | #endif | ||
70 | 73 | ||
71 | int msize; | 74 | int msize; |
72 | if (daemon == NULL) | 75 | if (daemon == NULL) |
73 | return; | 76 | return; |
74 | 77 | ||
75 | GNUNET_assert (daemon->phase == SP_GET_HELLO || daemon->phase == SP_START_DONE); | 78 | GNUNET_assert (daemon->phase == SP_GET_HELLO || daemon->phase == SP_START_DONE); |
76 | 79 | #if WAIT_FOR_HELLO | |
77 | cb = daemon->cb; | 80 | cb = daemon->cb; |
81 | #endif | ||
78 | daemon->cb = NULL; | 82 | daemon->cb = NULL; |
79 | if (daemon->task != GNUNET_SCHEDULER_NO_TASK) /* Assertion here instead? */ | 83 | if (daemon->task != GNUNET_SCHEDULER_NO_TASK) /* Assertion here instead? */ |
80 | GNUNET_SCHEDULER_cancel(daemon->task); | 84 | GNUNET_SCHEDULER_cancel(daemon->task); |
@@ -119,7 +123,10 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message) | |||
119 | 123 | ||
120 | #if WAIT_FOR_HELLO | 124 | #if WAIT_FOR_HELLO |
121 | if (NULL != cb) /* FIXME: what happens when this callback calls GNUNET_TESTING_daemon_stop? */ | 125 | if (NULL != cb) /* FIXME: what happens when this callback calls GNUNET_TESTING_daemon_stop? */ |
122 | cb (daemon->cb_cls, &daemon->id, daemon->cfg, daemon, NULL); | 126 | cb (daemon->cb_cls, |
127 | &daemon->id, | ||
128 | daemon->cfg, | ||
129 | daemon, NULL); | ||
123 | #endif | 130 | #endif |
124 | } | 131 | } |
125 | 132 | ||