summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2018-10-31 11:59:51 +0100
committerJulius Bünger <buenger@mytum.de>2018-10-31 12:04:02 +0100
commitc376dd1359d198394b240fd15a13877b8b236fe4 (patch)
treed350b8dbe6233c10f4002693e4fbae556da78f54 /src
parentb6395044ac67983a271581839e945027f6c089cf (diff)
RPS profiler: Try to avoid assertion on request_cancel
Diffstat (limited to 'src')
-rw-r--r--src/rps/gnunet-rps-profiler.c8
-rw-r--r--src/rps/rps_api.c1
2 files changed, 8 insertions, 1 deletions
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,