diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-03-02 10:33:56 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-03-02 10:33:56 +0100 |
commit | 0b30ad775e6f62d8fcbd0523f4fe0fc8197db7e5 (patch) | |
tree | f9de3a1d7cbaf3cac8250a266a4449de286b3db6 /src | |
parent | 43a00d14a710d18e8c506bc533de4925f87b1f7b (diff) | |
download | gnunet-0b30ad775e6f62d8fcbd0523f4fe0fc8197db7e5.tar.gz gnunet-0b30ad775e6f62d8fcbd0523f4fe0fc8197db7e5.zip |
fix for #5612
Diffstat (limited to 'src')
-rw-r--r-- | src/util/client.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/util/client.c b/src/util/client.c index 9bdb09e30..356123e94 100644 --- a/src/util/client.c +++ b/src/util/client.c | |||
@@ -258,6 +258,8 @@ transmit_ready (void *cls) | |||
258 | int notify_in_flight; | 258 | int notify_in_flight; |
259 | 259 | ||
260 | cstate->send_task = NULL; | 260 | cstate->send_task = NULL; |
261 | if (GNUNET_YES == cstate->in_destroy) | ||
262 | return; | ||
261 | pos = (const char *) cstate->msg; | 263 | pos = (const char *) cstate->msg; |
262 | len = ntohs (cstate->msg->size); | 264 | len = ntohs (cstate->msg->size); |
263 | GNUNET_assert (cstate->msg_off < len); | 265 | GNUNET_assert (cstate->msg_off < len); |
@@ -378,6 +380,21 @@ connection_client_destroy_impl (struct GNUNET_MQ_Handle *mq, | |||
378 | struct ClientState *cstate = impl_state; | 380 | struct ClientState *cstate = impl_state; |
379 | 381 | ||
380 | (void) mq; | 382 | (void) mq; |
383 | if (NULL != cstate->dns_active) | ||
384 | { | ||
385 | GNUNET_RESOLVER_request_cancel (cstate->dns_active); | ||
386 | cstate->dns_active = NULL; | ||
387 | } | ||
388 | if (NULL != cstate->send_task) | ||
389 | { | ||
390 | GNUNET_SCHEDULER_cancel (cstate->send_task); | ||
391 | cstate->send_task = NULL; | ||
392 | } | ||
393 | if (NULL != cstate->retry_task) | ||
394 | { | ||
395 | GNUNET_SCHEDULER_cancel (cstate->retry_task); | ||
396 | cstate->retry_task = NULL; | ||
397 | } | ||
381 | if (GNUNET_SYSERR == cstate->in_destroy) | 398 | if (GNUNET_SYSERR == cstate->in_destroy) |
382 | { | 399 | { |
383 | /* defer destruction */ | 400 | /* defer destruction */ |
@@ -385,15 +402,13 @@ connection_client_destroy_impl (struct GNUNET_MQ_Handle *mq, | |||
385 | cstate->mq = NULL; | 402 | cstate->mq = NULL; |
386 | return; | 403 | return; |
387 | } | 404 | } |
388 | if (NULL != cstate->dns_active) | ||
389 | GNUNET_RESOLVER_request_cancel (cstate->dns_active); | ||
390 | if (NULL != cstate->send_task) | ||
391 | GNUNET_SCHEDULER_cancel (cstate->send_task); | ||
392 | if (NULL != cstate->recv_task) | 405 | if (NULL != cstate->recv_task) |
406 | { | ||
393 | GNUNET_SCHEDULER_cancel (cstate->recv_task); | 407 | GNUNET_SCHEDULER_cancel (cstate->recv_task); |
394 | if (NULL != cstate->retry_task) | 408 | cstate->recv_task = NULL; |
395 | GNUNET_SCHEDULER_cancel (cstate->retry_task); | 409 | } |
396 | if (NULL != cstate->sock){ | 410 | if (NULL != cstate->sock) |
411 | { | ||
397 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 412 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
398 | "destroying socket: %p\n", | 413 | "destroying socket: %p\n", |
399 | cstate->sock); | 414 | cstate->sock); |