gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29355 - in libmicrohttpd: . doc src/include src/microhttpd


From: gnunet
Subject: [GNUnet-SVN] r29355 - in libmicrohttpd: . doc src/include src/microhttpd
Date: Tue, 17 Sep 2013 21:33:20 +0200

Author: grothoff
Date: 2013-09-17 21:33:20 +0200 (Tue, 17 Sep 2013)
New Revision: 29355

Modified:
   libmicrohttpd/ChangeLog
   libmicrohttpd/doc/libmicrohttpd.texi
   libmicrohttpd/src/include/microhttpd.h
   libmicrohttpd/src/microhttpd/connection.c
   libmicrohttpd/src/microhttpd/internal.h
Log:
also pass MHD connection handle in URI callback, needed for GNUnet

Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog     2013-09-17 18:17:28 UTC (rev 29354)
+++ libmicrohttpd/ChangeLog     2013-09-17 19:33:20 UTC (rev 29355)
@@ -1,3 +1,6 @@
+Tue Sep 17 21:32:47 CEST 2013
+       Also pass MHD connection handle in URI log callback. -CG
+
 Fri Sep  6 10:00:44 CEST 2013
        Improved check for proper OpenSSL version for
        libmicrospdy. -CG

Modified: libmicrohttpd/doc/libmicrohttpd.texi
===================================================================
--- libmicrohttpd/doc/libmicrohttpd.texi        2013-09-17 18:17:28 UTC (rev 
29354)
+++ libmicrohttpd/doc/libmicrohttpd.texi        2013-09-17 19:33:20 UTC (rev 
29355)
@@ -631,7 +631,7 @@
 logging.  This option should be followed by two arguments, the first
 one must be of the form
 @example
- void * my_logger(void * cls, const char * uri)
+ void * my_logger(void * cls, const char * uri, struct MHD_Connection *con)
 @end example
 where the return value will be passed as
 @code{*con_cls} in calls to the @code{MHD_AccessHandlerCallback}
@@ -644,6 +644,10 @@
 MHD_OPTION_URI_LOG_CALLBACK.  Finally, @code{uri} will
 be the 0-terminated URI of the request.
 
+Note that during the time of this call, most of the connection's state
+is not initialized (as we have not yet parsed he headers).  However,
+information about the connecting client (IP, socket) is available.
+
 @item MHD_OPTION_HTTPS_MEM_KEY
 @cindex SSL
 @cindex TLS

Modified: libmicrohttpd/src/include/microhttpd.h
===================================================================
--- libmicrohttpd/src/include/microhttpd.h      2013-09-17 18:17:28 UTC (rev 
29354)
+++ libmicrohttpd/src/include/microhttpd.h      2013-09-17 19:33:20 UTC (rev 
29355)
@@ -121,7 +121,7 @@
  * Current version of the library.
  * 0x01093001 = 1.9.30-1.
  */
-#define MHD_VERSION 0x00093000
+#define MHD_VERSION 0x00093001
 
 /**
  * MHD-internal return code for "YES".
@@ -611,7 +611,7 @@
    * logging.  This option should be followed by two arguments, the first
    * one must be of the form
    * 
-   *     void * my_logger(void *cls, const char *uri)
+   *     void * my_logger(void *cls, const char *uri, struct MHD_Connection 
*con)
    * 
    * where the return value will be passed as
    * (`* con_cls`) in calls to the #MHD_AccessHandlerCallback
@@ -623,6 +623,11 @@
    * "cls" will be set to the second argument following
    * #MHD_OPTION_URI_LOG_CALLBACK.  Finally, uri will
    * be the 0-terminated URI of the request.
+   *
+   * Note that during the time of this call, most of the connection's
+   * state is not initialized (as we have not yet parsed he headers).
+   * However, information about the connecting client (IP, socket)
+   * is available.
    */
   MHD_OPTION_URI_LOG_CALLBACK = 7,
 

Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c   2013-09-17 18:17:28 UTC (rev 
29354)
+++ libmicrohttpd/src/microhttpd/connection.c   2013-09-17 19:33:20 UTC (rev 
29355)
@@ -1255,7 +1255,8 @@
   if (NULL != connection->daemon->uri_log_callback)
     connection->client_context
       = connection->daemon->uri_log_callback 
(connection->daemon->uri_log_callback_cls, 
-                                             uri);
+                                             uri,
+                                             connection);
   args = strchr (uri, '?');
   if (NULL != args)
     {

Modified: libmicrohttpd/src/microhttpd/internal.h
===================================================================
--- libmicrohttpd/src/microhttpd/internal.h     2013-09-17 18:17:28 UTC (rev 
29354)
+++ libmicrohttpd/src/microhttpd/internal.h     2013-09-17 19:33:20 UTC (rev 
29355)
@@ -838,9 +838,12 @@
  *
  * @param cls closure
  * @param uri uri being accessed
+ * @param con connection handle
  * @return new closure
  */
-typedef void * (*LogCallback)(void * cls, const char * uri);
+typedef void * (*LogCallback)(void * cls, 
+                             const char * uri,
+                             struct MHD_Connection *con);
 
 /**
  * Signature of function called to unescape URIs.  See also




reply via email to

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