diff options
Diffstat (limited to 'src/transport/gnunet-transport.c')
-rw-r--r-- | src/transport/gnunet-transport.c | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c index 40d28576f..fb8ec60eb 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c | |||
@@ -263,6 +263,27 @@ struct TestContext | |||
263 | 263 | ||
264 | }; | 264 | }; |
265 | 265 | ||
266 | static struct ValidationResolutionContext *vc_head; | ||
267 | static struct ValidationResolutionContext *vc_tail; | ||
268 | |||
269 | struct ValidationResolutionContext | ||
270 | { | ||
271 | struct ValidationResolutionContext *next; | ||
272 | struct ValidationResolutionContext *prev; | ||
273 | |||
274 | struct GNUNET_PeerIdentity id; | ||
275 | struct GNUNET_HELLO_Address *addrcp; | ||
276 | struct GNUNET_TIME_Absolute last_validation; | ||
277 | struct GNUNET_TIME_Absolute valid_until; | ||
278 | struct GNUNET_TIME_Absolute next_validation; | ||
279 | enum GNUNET_TRANSPORT_ValidationState state; | ||
280 | |||
281 | struct GNUNET_TRANSPORT_AddressToStringContext *asc; | ||
282 | |||
283 | char *transport; | ||
284 | int printed; | ||
285 | }; | ||
286 | |||
266 | struct MonitoredPeer | 287 | struct MonitoredPeer |
267 | { | 288 | { |
268 | enum GNUNET_TRANSPORT_PeerState state; | 289 | enum GNUNET_TRANSPORT_PeerState state; |
@@ -293,6 +314,8 @@ static void | |||
293 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 314 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
294 | { | 315 | { |
295 | struct GNUNET_TIME_Relative duration; | 316 | struct GNUNET_TIME_Relative duration; |
317 | struct ValidationResolutionContext *cur; | ||
318 | struct ValidationResolutionContext *next; | ||
296 | end = GNUNET_SCHEDULER_NO_TASK; | 319 | end = GNUNET_SCHEDULER_NO_TASK; |
297 | if (GNUNET_SCHEDULER_NO_TASK != op_timeout) | 320 | if (GNUNET_SCHEDULER_NO_TASK != op_timeout) |
298 | { | 321 | { |
@@ -314,6 +337,19 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
314 | GNUNET_TRANSPORT_monitor_validation_entries_cancel (vic); | 337 | GNUNET_TRANSPORT_monitor_validation_entries_cancel (vic); |
315 | vic = NULL; | 338 | vic = NULL; |
316 | } | 339 | } |
340 | |||
341 | next = vc_head; | ||
342 | for (cur = next; NULL != cur; cur = next) | ||
343 | { | ||
344 | next = cur->next; | ||
345 | |||
346 | GNUNET_TRANSPORT_address_to_string_cancel (cur->asc); | ||
347 | GNUNET_CONTAINER_DLL_remove (vc_head, vc_tail, cur); | ||
348 | GNUNET_free (cur->transport); | ||
349 | GNUNET_HELLO_address_free (cur->addrcp); | ||
350 | GNUNET_free (cur); | ||
351 | } | ||
352 | |||
317 | if (NULL != th) | 353 | if (NULL != th) |
318 | { | 354 | { |
319 | GNUNET_TRANSPORT_notify_transmit_ready_cancel (th); | 355 | GNUNET_TRANSPORT_notify_transmit_ready_cancel (th); |
@@ -365,26 +401,7 @@ struct PeerResolutionContext | |||
365 | int printed; | 401 | int printed; |
366 | }; | 402 | }; |
367 | 403 | ||
368 | static struct ValidationResolutionContext *vc_head; | ||
369 | static struct ValidationResolutionContext *vc_tail; | ||
370 | 404 | ||
371 | struct ValidationResolutionContext | ||
372 | { | ||
373 | struct ValidationResolutionContext *next; | ||
374 | struct ValidationResolutionContext *prev; | ||
375 | |||
376 | struct GNUNET_PeerIdentity id; | ||
377 | struct GNUNET_HELLO_Address *addrcp; | ||
378 | struct GNUNET_TIME_Absolute last_validation; | ||
379 | struct GNUNET_TIME_Absolute valid_until; | ||
380 | struct GNUNET_TIME_Absolute next_validation; | ||
381 | enum GNUNET_TRANSPORT_ValidationState state; | ||
382 | |||
383 | struct GNUNET_TRANSPORT_AddressToStringContext *asc; | ||
384 | |||
385 | char *transport; | ||
386 | int printed; | ||
387 | }; | ||
388 | 405 | ||
389 | static void | 406 | static void |
390 | operation_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 407 | operation_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
@@ -1409,7 +1426,7 @@ testservice_task (void *cls, int result) | |||
1409 | GNUNET_break(0); | 1426 | GNUNET_break(0); |
1410 | return; | 1427 | return; |
1411 | } | 1428 | } |
1412 | 1429 | GNUNET_break (0); | |
1413 | end = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 1430 | end = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
1414 | &shutdown_task, NULL ); | 1431 | &shutdown_task, NULL ); |
1415 | 1432 | ||