From: Julius Bünger Date: Wed, 31 Oct 2018 10:59:51 +0000 (+0100) Subject: RPS profiler: Try to avoid assertion on request_cancel X-Git-Tag: v0.11.0~240^2~17 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c376dd1359d198394b240fd15a13877b8b236fe4;p=oweals%2Fgnunet.git RPS profiler: Try to avoid assertion on request_cancel --- diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c index f2a8083e7..c0059ac3b 100644 --- a/src/rps/gnunet-rps-profiler.c +++ b/src/rps/gnunet-rps-profiler.c @@ -909,6 +909,7 @@ cancel_request (struct PendingReply *pending_rep) rps_peer->num_pending_reps--; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Cancelling rps get reply\n"); + GNUNET_assert (NULL != pending_rep->req_handle); GNUNET_RPS_request_cancel (pending_rep->req_handle); GNUNET_free (pending_rep); } @@ -1288,7 +1289,11 @@ rps_disconnect_adapter (void *cls, cancel_request (pending_rep); } GNUNET_assert (h == peer->rps_handle); - GNUNET_RPS_disconnect (h); + if (NULL != h) + { + GNUNET_RPS_disconnect (h); + h = NULL; + } peer->rps_handle = NULL; } } @@ -1788,6 +1793,7 @@ profiler_reply_handle (void *cls, unsigned int i; struct PendingReply *pending_rep = (struct PendingReply *) cls; + pending_rep->req_handle = NULL; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "profiler_reply_handle()\n"); rps_peer = pending_rep->rps_peer; (void) GNUNET_asprintf (&file_name, diff --git a/src/rps/rps_api.c b/src/rps/rps_api.c index bce567678..cfab06f17 100644 --- a/src/rps/rps_api.c +++ b/src/rps/rps_api.c @@ -854,6 +854,7 @@ GNUNET_RPS_request_cancel (struct GNUNET_RPS_Request_Handle *rh) struct GNUNET_RPS_Handle *h; h = rh->rps_handle; + GNUNET_assert (NULL != rh); GNUNET_assert (NULL != rh->srh); remove_stream_request (rh->srh, h->stream_requests_head,