diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-07-02 19:59:21 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-07-02 19:59:21 +0000 |
commit | 0ef6f53af499d8b114cd31c101989a33e2c96daa (patch) | |
tree | 0760b0a7db5e9fd3b2060abd2f902120c8ff6523 /src/core | |
parent | 62ec5fb050d9d311e22f206ee91161254955f2ed (diff) | |
download | gnunet-0ef6f53af499d8b114cd31c101989a33e2c96daa.tar.gz gnunet-0ef6f53af499d8b114cd31c101989a33e2c96daa.zip |
timeout earlier as well
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/test_core_api_reliability.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index dde274e8d..2bd5f9a78 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c | |||
@@ -141,14 +141,26 @@ static void | |||
141 | terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 141 | terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
142 | { | 142 | { |
143 | GNUNET_break (0); | 143 | GNUNET_break (0); |
144 | GNUNET_CORE_disconnect (p1.ch); | 144 | if (p1.ch != NULL) |
145 | p1.ch = NULL; | 145 | { |
146 | GNUNET_CORE_disconnect (p2.ch); | 146 | GNUNET_CORE_disconnect (p1.ch); |
147 | p2.ch = NULL; | 147 | p1.ch = NULL; |
148 | GNUNET_TRANSPORT_disconnect (p1.th); | 148 | } |
149 | p1.th = NULL; | 149 | if (p2.ch != NULL) |
150 | GNUNET_TRANSPORT_disconnect (p2.th); | 150 | { |
151 | p2.th = NULL; | 151 | GNUNET_CORE_disconnect (p2.ch); |
152 | p2.ch = NULL; | ||
153 | } | ||
154 | if (p1.th != NULL) | ||
155 | { | ||
156 | GNUNET_TRANSPORT_disconnect (p1.th); | ||
157 | p1.th = NULL; | ||
158 | } | ||
159 | if (p2.th != NULL) | ||
160 | { | ||
161 | GNUNET_TRANSPORT_disconnect (p2.th); | ||
162 | p2.th = NULL; | ||
163 | } | ||
152 | ok = 42; | 164 | ok = 42; |
153 | } | 165 | } |
154 | 166 | ||
@@ -238,6 +250,7 @@ connect_notify (void *cls, | |||
238 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 250 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
239 | "Asking core (1) for transmission to peer `%4s'\n", | 251 | "Asking core (1) for transmission to peer `%4s'\n", |
240 | GNUNET_i2s (&p2.id)); | 252 | GNUNET_i2s (&p2.id)); |
253 | GNUNET_SCHEDULER_cancel (err_task); | ||
241 | err_task = | 254 | err_task = |
242 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 255 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
243 | &terminate_task_error, | 256 | &terminate_task_error, |
@@ -475,6 +488,10 @@ run (void *cls, | |||
475 | OKPP; | 488 | OKPP; |
476 | setup_peer (&p1, "test_core_api_peer1.conf"); | 489 | setup_peer (&p1, "test_core_api_peer1.conf"); |
477 | setup_peer (&p2, "test_core_api_peer2.conf"); | 490 | setup_peer (&p2, "test_core_api_peer2.conf"); |
491 | err_task = | ||
492 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, | ||
493 | &terminate_task_error, | ||
494 | NULL); | ||
478 | GNUNET_CORE_connect (p1.cfg, 1, | 495 | GNUNET_CORE_connect (p1.cfg, 1, |
479 | &p1, | 496 | &p1, |
480 | &init_notify, | 497 | &init_notify, |