gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r27973 - in gnunet/src: include mesh util


From: gnunet
Subject: [GNUnet-SVN] r27973 - in gnunet/src: include mesh util
Date: Sat, 13 Jul 2013 03:32:57 +0200

Author: bartpolot
Date: 2013-07-13 03:32:57 +0200 (Sat, 13 Jul 2013)
New Revision: 27973

Modified:
   gnunet/src/include/gnunet_server_lib.h
   gnunet/src/mesh/gnunet-service-mesh.c
   gnunet/src/util/server.c
Log:
- connect_notify is also called with NULL on server shutdown

Modified: gnunet/src/include/gnunet_server_lib.h
===================================================================
--- gnunet/src/include/gnunet_server_lib.h      2013-07-13 01:20:42 UTC (rev 
27972)
+++ gnunet/src/include/gnunet_server_lib.h      2013-07-13 01:32:57 UTC (rev 
27973)
@@ -476,7 +476,11 @@
 /**
  * Ask the server to notify us whenever a client connects.
  * This function is called whenever the actual network connection
- * is opened.
+ * is opened. If the server is destroyed before this
+ * notification is explicitly cancelled, the 'callback' will
+ * once be called with a 'client' argument of NULL to indicate
+ * that the server itself is now gone (and that the callback
+ * won't be called anymore and also can no longer be cancelled).
  *
  * @param server the server manageing the clients
  * @param callback function to call on sconnect

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2013-07-13 01:20:42 UTC (rev 
27972)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2013-07-13 01:32:57 UTC (rev 
27973)
@@ -4405,6 +4405,8 @@
 {
   struct MeshClient *c;
 
+  if (NULL == client)
+    return;
   c = GNUNET_malloc (sizeof (struct MeshClient));
   c->handle = client;
   GNUNET_SERVER_client_keep (client);

Modified: gnunet/src/util/server.c
===================================================================
--- gnunet/src/util/server.c    2013-07-13 01:20:42 UTC (rev 27972)
+++ gnunet/src/util/server.c    2013-07-13 01:32:57 UTC (rev 27973)
@@ -1342,7 +1342,11 @@
 /**
  * Ask the server to notify us whenever a client connects.
  * This function is called whenever the actual network connection
- * is opened.
+ * is opened. If the server is destroyed before this
+ * notification is explicitly cancelled, the 'callback' will
+ * once be called with a 'client' argument of NULL to indicate
+ * that the server itself is now gone (and that the callback
+ * won't be called anymore and also can no longer be cancelled).
  *
  * @param server the server manageing the clients
  * @param callback function to call on sconnect




reply via email to

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