diff options
author | Florian Dold <florian.dold@gmail.com> | 2013-10-29 07:41:58 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2013-10-29 07:41:58 +0000 |
commit | befe32a46bf5c2eb9eb36ae20a08dffddaeb7fe3 (patch) | |
tree | 7cccf6c63b0107d0c7fbc34b3d0c02f2bc97adfc /src/set | |
parent | 9b7b8af742d70dd464792005b79f1cc920be3f98 (diff) | |
download | gnunet-befe32a46bf5c2eb9eb36ae20a08dffddaeb7fe3.tar.gz gnunet-befe32a46bf5c2eb9eb36ae20a08dffddaeb7fe3.zip |
- fixed assertion due to task not testing for shutdown as a reason
Diffstat (limited to 'src/set')
-rw-r--r-- | src/set/gnunet-service-set.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/set/gnunet-service-set.c b/src/set/gnunet-service-set.c index 6020076ec..406935532 100644 --- a/src/set/gnunet-service-set.c +++ b/src/set/gnunet-service-set.c | |||
@@ -367,6 +367,11 @@ static void | |||
367 | incoming_destroy (struct Incoming *incoming) | 367 | incoming_destroy (struct Incoming *incoming) |
368 | { | 368 | { |
369 | GNUNET_CONTAINER_DLL_remove (incoming_head, incoming_tail, incoming); | 369 | GNUNET_CONTAINER_DLL_remove (incoming_head, incoming_tail, incoming); |
370 | if (GNUNET_SCHEDULER_NO_TASK != incoming->timeout_task) | ||
371 | { | ||
372 | GNUNET_SCHEDULER_cancel (incoming->timeout_task); | ||
373 | incoming->timeout_task = GNUNET_SCHEDULER_NO_TASK; | ||
374 | } | ||
370 | if (NULL != incoming->tunnel) | 375 | if (NULL != incoming->tunnel) |
371 | { | 376 | { |
372 | struct GNUNET_MESH_Tunnel *t = incoming->tunnel; | 377 | struct GNUNET_MESH_Tunnel *t = incoming->tunnel; |
@@ -414,6 +419,7 @@ incoming_suggest (struct Incoming *incoming, struct Listener *listener) | |||
414 | incoming->suggest_id = suggest_id++; | 419 | incoming->suggest_id = suggest_id++; |
415 | 420 | ||
416 | GNUNET_SCHEDULER_cancel (incoming->timeout_task); | 421 | GNUNET_SCHEDULER_cancel (incoming->timeout_task); |
422 | incoming->timeout_task = GNUNET_SCHEDULER_NO_TASK; | ||
417 | mqm = GNUNET_MQ_msg_nested_mh (cmsg, GNUNET_MESSAGE_TYPE_SET_REQUEST, | 423 | mqm = GNUNET_MQ_msg_nested_mh (cmsg, GNUNET_MESSAGE_TYPE_SET_REQUEST, |
418 | incoming->spec->context_msg); | 424 | incoming->spec->context_msg); |
419 | GNUNET_assert (NULL != mqm); | 425 | GNUNET_assert (NULL != mqm); |
@@ -422,7 +428,6 @@ incoming_suggest (struct Incoming *incoming, struct Listener *listener) | |||
422 | cmsg->accept_id = htonl (incoming->suggest_id); | 428 | cmsg->accept_id = htonl (incoming->suggest_id); |
423 | cmsg->peer_id = incoming->spec->peer; | 429 | cmsg->peer_id = incoming->spec->peer; |
424 | GNUNET_MQ_send (listener->client_mq, mqm); | 430 | GNUNET_MQ_send (listener->client_mq, mqm); |
425 | |||
426 | } | 431 | } |
427 | 432 | ||
428 | 433 | ||
@@ -902,7 +907,6 @@ handle_client_accept (void *cls, | |||
902 | 907 | ||
903 | if (NULL == incoming) | 908 | if (NULL == incoming) |
904 | { | 909 | { |
905 | |||
906 | GNUNET_break (0); | 910 | GNUNET_break (0); |
907 | GNUNET_SERVER_client_disconnect (client); | 911 | GNUNET_SERVER_client_disconnect (client); |
908 | return; | 912 | return; |
@@ -971,6 +975,9 @@ incoming_timeout_cb (void *cls, | |||
971 | { | 975 | { |
972 | struct Incoming *incoming = cls; | 976 | struct Incoming *incoming = cls; |
973 | 977 | ||
978 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | ||
979 | return; | ||
980 | |||
974 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "remote peer timed out\n"); | 981 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "remote peer timed out\n"); |
975 | incoming_destroy (incoming); | 982 | incoming_destroy (incoming); |
976 | } | 983 | } |