gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] 02/02: RPS profiler: Try to avoid assertion on req


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 02/02: RPS profiler: Try to avoid assertion on request_cancel
Date: Wed, 31 Oct 2018 12:04:23 +0100

This is an automated email from the git hooks/post-receive script.

julius-buenger pushed a commit to branch master
in repository gnunet.

commit c376dd1359d198394b240fd15a13877b8b236fe4
Author: Julius Bünger <address@hidden>
AuthorDate: Wed Oct 31 11:59:51 2018 +0100

    RPS profiler: Try to avoid assertion on request_cancel
---
 src/rps/gnunet-rps-profiler.c | 8 +++++++-
 src/rps/rps_api.c             | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

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,

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]