rps profiler: additional checks and assertions before disconnect from rps
authorJulius Bünger <buenger@mytum.de>
Thu, 5 Jul 2018 20:05:16 +0000 (22:05 +0200)
committerJulius Bünger <buenger@mytum.de>
Thu, 5 Jul 2018 20:05:16 +0000 (22:05 +0200)
src/rps/gnunet-rps-profiler.c

index dcd72aef157de6662004c1ff0920e44c647a8ea9..0427608f1a86d689bdbaa4954e1dde704ac29a70 100644 (file)
@@ -1177,8 +1177,12 @@ rps_disconnect_adapter (void *cls,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnect_adapter()\n");
   GNUNET_assert (NULL != peer);
-  GNUNET_RPS_disconnect (h);
-  peer->rps_handle = NULL;
+  if (NULL != peer->rps_handle)
+  {
+    GNUNET_assert (h == peer->rps_handle);
+    GNUNET_RPS_disconnect (h);
+    peer->rps_handle = NULL;
+  }
 }