diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-11-05 10:47:05 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-11-05 10:47:05 +0000 |
commit | 22d94c49ad387d3b7e373a955495ae39362b801a (patch) | |
tree | 9b13ec92a2b1f67d64b8cef4ea6cc95d4818434a | |
parent | 9f783bb15977e7367ed4f7797866534c77e79c18 (diff) | |
download | gnunet-22d94c49ad387d3b7e373a955495ae39362b801a.tar.gz gnunet-22d94c49ad387d3b7e373a955495ae39362b801a.zip |
possible fix for dht testcase segfault
-rw-r--r-- | src/dht/test_dht_twopeer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dht/test_dht_twopeer.c b/src/dht/test_dht_twopeer.c index ade8e65bd..06807f82a 100644 --- a/src/dht/test_dht_twopeer.c +++ b/src/dht/test_dht_twopeer.c | |||
@@ -115,7 +115,7 @@ static void | |||
115 | end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) | 115 | end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) |
116 | { | 116 | { |
117 | if (peer1dht != NULL) | 117 | if (peer1dht != NULL) |
118 | GNUNET_DHT_disconnect(peer1dht); | 118 | GNUNET_DHT_disconnect(peer1dht); |
119 | 119 | ||
120 | if (peer2dht != NULL) | 120 | if (peer2dht != NULL) |
121 | GNUNET_DHT_disconnect(peer2dht); | 121 | GNUNET_DHT_disconnect(peer2dht); |
@@ -136,9 +136,9 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) | |||
136 | if (curr_get_ctx.get_handle != NULL) | 136 | if (curr_get_ctx.get_handle != NULL) |
137 | { | 137 | { |
138 | GNUNET_DHT_get_stop(curr_get_ctx.get_handle); | 138 | GNUNET_DHT_get_stop(curr_get_ctx.get_handle); |
139 | GNUNET_SCHEDULER_add_now (sched, &end_badly_cont, NULL); | ||
140 | } | 139 | } |
141 | 140 | ||
141 | GNUNET_SCHEDULER_add_now (sched, &end_badly_cont, NULL); | ||
142 | ok = 1; | 142 | ok = 1; |
143 | } | 143 | } |
144 | 144 | ||
@@ -237,6 +237,7 @@ stop_retry_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) | |||
237 | get_context->retry_task = GNUNET_SCHEDULER_NO_TASK; | 237 | get_context->retry_task = GNUNET_SCHEDULER_NO_TASK; |
238 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Get attempt %u failed, canceling request!\n", get_context->get_attempts); | 238 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Get attempt %u failed, canceling request!\n", get_context->get_attempts); |
239 | GNUNET_DHT_get_stop(get_context->get_handle); | 239 | GNUNET_DHT_get_stop(get_context->get_handle); |
240 | get_context->get_handle = NULL; | ||
240 | GNUNET_SCHEDULER_add_now(sched, &get_stop_finished, get_context); | 241 | GNUNET_SCHEDULER_add_now(sched, &get_stop_finished, get_context); |
241 | } | 242 | } |
242 | 243 | ||