diff options
author | Julius Bünger <buenger@mytum.de> | 2018-10-31 11:59:51 +0100 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2018-10-31 12:04:02 +0100 |
commit | c376dd1359d198394b240fd15a13877b8b236fe4 (patch) | |
tree | d350b8dbe6233c10f4002693e4fbae556da78f54 /src | |
parent | b6395044ac67983a271581839e945027f6c089cf (diff) | |
download | gnunet-c376dd1359d198394b240fd15a13877b8b236fe4.tar.gz gnunet-c376dd1359d198394b240fd15a13877b8b236fe4.zip |
RPS profiler: Try to avoid assertion on request_cancel
Diffstat (limited to 'src')
-rw-r--r-- | src/rps/gnunet-rps-profiler.c | 8 | ||||
-rw-r--r-- | src/rps/rps_api.c | 1 |
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) | |||
909 | rps_peer->num_pending_reps--; | 909 | rps_peer->num_pending_reps--; |
910 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 910 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
911 | "Cancelling rps get reply\n"); | 911 | "Cancelling rps get reply\n"); |
912 | GNUNET_assert (NULL != pending_rep->req_handle); | ||
912 | GNUNET_RPS_request_cancel (pending_rep->req_handle); | 913 | GNUNET_RPS_request_cancel (pending_rep->req_handle); |
913 | GNUNET_free (pending_rep); | 914 | GNUNET_free (pending_rep); |
914 | } | 915 | } |
@@ -1288,7 +1289,11 @@ rps_disconnect_adapter (void *cls, | |||
1288 | cancel_request (pending_rep); | 1289 | cancel_request (pending_rep); |
1289 | } | 1290 | } |
1290 | GNUNET_assert (h == peer->rps_handle); | 1291 | GNUNET_assert (h == peer->rps_handle); |
1291 | GNUNET_RPS_disconnect (h); | 1292 | if (NULL != h) |
1293 | { | ||
1294 | GNUNET_RPS_disconnect (h); | ||
1295 | h = NULL; | ||
1296 | } | ||
1292 | peer->rps_handle = NULL; | 1297 | peer->rps_handle = NULL; |
1293 | } | 1298 | } |
1294 | } | 1299 | } |
@@ -1788,6 +1793,7 @@ profiler_reply_handle (void *cls, | |||
1788 | unsigned int i; | 1793 | unsigned int i; |
1789 | struct PendingReply *pending_rep = (struct PendingReply *) cls; | 1794 | struct PendingReply *pending_rep = (struct PendingReply *) cls; |
1790 | 1795 | ||
1796 | pending_rep->req_handle = NULL; | ||
1791 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "profiler_reply_handle()\n"); | 1797 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "profiler_reply_handle()\n"); |
1792 | rps_peer = pending_rep->rps_peer; | 1798 | rps_peer = pending_rep->rps_peer; |
1793 | (void) GNUNET_asprintf (&file_name, | 1799 | (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) | |||
854 | struct GNUNET_RPS_Handle *h; | 854 | struct GNUNET_RPS_Handle *h; |
855 | 855 | ||
856 | h = rh->rps_handle; | 856 | h = rh->rps_handle; |
857 | GNUNET_assert (NULL != rh); | ||
857 | GNUNET_assert (NULL != rh->srh); | 858 | GNUNET_assert (NULL != rh->srh); |
858 | remove_stream_request (rh->srh, | 859 | remove_stream_request (rh->srh, |
859 | h->stream_requests_head, | 860 | h->stream_requests_head, |