rps service: check return value when opening cadet port
authorJulius Bünger <buenger@mytum.de>
Thu, 12 Jul 2018 23:14:43 +0000 (01:14 +0200)
committerJulius Bünger <buenger@mytum.de>
Thu, 12 Jul 2018 23:16:01 +0000 (01:16 +0200)
src/rps/gnunet-service-rps.c

index c60ab5e634876d46b9f33b64e5c87b43fdc756a0..5d568dfac99ad98fa74a83df0e43140876a83077 100644 (file)
@@ -4389,6 +4389,13 @@ run (void *cls,
                                        NULL, /* WindowSize handler */
                                        cleanup_destroyed_channel, /* Disconnect handler */
                                        cadet_handlers);
+  if (NULL == cadet_port)
+  {
+    LOG (GNUNET_ERROR_TYPE_ERROR,
+        "Cadet port `%s' is already in use.\n",
+        GNUNET_APPLICATION_PORT_RPS);
+    GNUNET_assert (0);
+  }
 
 
   peerinfo_handle = GNUNET_PEERINFO_connect (cfg);