gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r11214 - gnunet/src/include


From: gnunet
Subject: [GNUnet-SVN] r11214 - gnunet/src/include
Date: Thu, 6 May 2010 11:55:53 +0200

Author: nevans
Date: 2010-05-06 11:55:53 +0200 (Thu, 06 May 2010)
New Revision: 11214

Modified:
   gnunet/src/include/gnunet_client_lib.h
   gnunet/src/include/gnunet_connection_lib.h
   gnunet/src/include/gnunet_constants.h
   gnunet/src/include/gnunet_protocols.h
   gnunet/src/include/gnunet_server_lib.h
Log:
changes required for arm fix

Modified: gnunet/src/include/gnunet_client_lib.h
===================================================================
--- gnunet/src/include/gnunet_client_lib.h      2010-05-06 09:54:08 UTC (rev 
11213)
+++ gnunet/src/include/gnunet_client_lib.h      2010-05-06 09:55:53 UTC (rev 
11214)
@@ -106,6 +106,19 @@
                                               GNUNET_MessageHeader * msg);
 
 /**
+ * Type of a function to call when we have finished shutting
+ * down a service, or failed.
+ *
+ * @param cls closure
+ * @param reason what is the result of the shutdown
+ *        GNUNET_NO on shutdown (not running)
+ *        GNUNET_YES on running
+ *        GNUNET_SYSERR on failure to transmit message
+ */
+typedef void (*GNUNET_CLIENT_ShutdownTask) (void *cls,
+                                            int reason);
+
+/**
  * Read from the service.
  *
  * @param sock the service
@@ -202,9 +215,19 @@
  * be used by the caller after this call
  * (calling this function frees "sock" after a while).
  *
+ * @param sched the scheduler to use for calling shutdown continuation
  * @param sock the socket connected to the service
+ * @param timeout how long to wait before giving up on transmission
+ * @param cont continuation to call once the service is really down
+ * @param cont_cls closure for continuation
+ *
  */
-void GNUNET_CLIENT_service_shutdown (struct GNUNET_CLIENT_Connection *sock);
+void
+GNUNET_CLIENT_service_shutdown (struct GNUNET_SCHEDULER_Handle *sched,
+                                struct GNUNET_CLIENT_Connection *sock,
+                                struct GNUNET_TIME_Relative timeout,
+                                GNUNET_CLIENT_ShutdownTask cont,
+                                void *cont_cls);
 
 
 /**

Modified: gnunet/src/include/gnunet_connection_lib.h
===================================================================
--- gnunet/src/include/gnunet_connection_lib.h  2010-05-06 09:54:08 UTC (rev 
11213)
+++ gnunet/src/include/gnunet_connection_lib.h  2010-05-06 09:55:53 UTC (rev 
11214)
@@ -84,6 +84,15 @@
                                          const struct sockaddr * addr,
                                          socklen_t addrlen, int errCode);
 
+/**
+ * Set the persist option on this connection handle.  Indicates
+ * that the underlying socket or fd should never really be closed.
+ * Used for indicating process death.
+ *
+ * @param sock the connection to set persistent
+ */
+void
+GNUNET_CONNECTION_persist_(struct GNUNET_CONNECTION_Handle *sock);
 
 /**
  * Create a socket handle by boxing an existing OS socket.  The OS

Modified: gnunet/src/include/gnunet_constants.h
===================================================================
--- gnunet/src/include/gnunet_constants.h       2010-05-06 09:54:08 UTC (rev 
11213)
+++ gnunet/src/include/gnunet_constants.h       2010-05-06 09:55:53 UTC (rev 
11214)
@@ -60,7 +60,7 @@
  * How long do we wait after a FORK+EXEC before testing for the
  * resulting process to be up (port open, waitpid, etc.)?
  */
-#define GNUNET_CONSTANTS_EXEC_WAIT GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_MILLISECONDS, 100)
+#define GNUNET_CONSTANTS_EXEC_WAIT GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_MILLISECONDS, 200)
 
 /**
  * After how long do we consider a service irresponsive

Modified: gnunet/src/include/gnunet_protocols.h
===================================================================
--- gnunet/src/include/gnunet_protocols.h       2010-05-06 09:54:08 UTC (rev 
11213)
+++ gnunet/src/include/gnunet_protocols.h       2010-05-06 09:55:53 UTC (rev 
11214)
@@ -104,8 +104,20 @@
  */
 #define GNUNET_MESSAGE_TYPE_ARM_IS_UNKNOWN 12
 
+/**
+ * Acknowledge service shutting down, disconnect
+ * indicates service stopped.
+ */
+#define GNUNET_MESSAGE_TYPE_SHUTDOWN_ACK 13
 
 /**
+ * Deny service shutdown, disconnect indicates
+ * service won't be stopped as a result of shutdown
+ * message.
+ */
+#define GNUNET_MESSAGE_TYPE_SHUTDOWN_REFUSE 14
+
+/**
  * HELLO message used for communicating peer addresses.
  * Managed by libgnunethello.
  */

Modified: gnunet/src/include/gnunet_server_lib.h
===================================================================
--- gnunet/src/include/gnunet_server_lib.h      2010-05-06 09:54:08 UTC (rev 
11213)
+++ gnunet/src/include/gnunet_server_lib.h      2010-05-06 09:55:53 UTC (rev 
11214)
@@ -187,6 +187,15 @@
 
 
 /**
+ * Set the persistent flag on this client, used to setup client connection
+ * to only be killed when the service it's connected to is actually dead.
+ *
+ * @param client the client to set the persistent flag on
+ */
+void
+GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client);
+
+/**
  * Resume receiving from this client, we are done processing the
  * current request.  This function must be called from within each
  * GNUNET_SERVER_MessageCallback (or its respective continuations).
@@ -317,8 +326,9 @@
  * Destroy this connection (free resources).
  *
  * @param cls closure
+ * @pararm persist when connection is closed, "leak" socket
  */
-typedef void (*GNUNET_SERVER_DestroyCallback) (void *cls);
+typedef void (*GNUNET_SERVER_DestroyCallback) (void *cls, int persist);
 
 
 /**





reply via email to

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