gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r36571 - in libmicrohttpd: . doc src/include src/microhttpd
Date: Sun, 25 Oct 2015 23:07:43 +0100

Author: grothoff
Date: 2015-10-25 23:07:42 +0100 (Sun, 25 Oct 2015)
New Revision: 36571

Modified:
   libmicrohttpd/ChangeLog
   libmicrohttpd/doc/libmicrohttpd.texi
   libmicrohttpd/src/include/microhttpd.h
   libmicrohttpd/src/microhttpd/connection.c
Log:
realize suggestion from FC on MHD list to improve MHD_get_connection_values() 
when used with a bitmask

Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog     2015-10-25 15:45:03 UTC (rev 36570)
+++ libmicrohttpd/ChangeLog     2015-10-25 22:07:42 UTC (rev 36571)
@@ -1,3 +1,7 @@
+Sun Oct 25 23:05:32 CET 2015
+       Return correct header kind in MHD_get_connection_values()
+       even if a bitmask is used for the "kind" argument. -FC/CG
+
 Sun Oct 25 15:29:23 CET 2015
        Fixing transient resource leak affecting long-lived
        connections with many keep-alives and HTTP request

Modified: libmicrohttpd/doc/libmicrohttpd.texi
===================================================================
--- libmicrohttpd/doc/libmicrohttpd.texi        2015-10-25 15:45:03 UTC (rev 
36570)
+++ libmicrohttpd/doc/libmicrohttpd.texi        2015-10-25 22:07:42 UTC (rev 
36571)
@@ -1578,7 +1578,9 @@
 
 
 @deftypefun int MHD_get_connection_values (struct MHD_Connection *connection, 
enum MHD_ValueKind kind, MHD_KeyValueIterator iterator, void *iterator_cls)
-Get all the headers matching @var{kind} from the request.
+Get all the headers matching @var{kind} from the request.  The @var{kind}
+argument can be a bitmask, ORing the various header kinds that are
+requested.
 
 The @var{iterator} callback is invoked once for each header, with
 @var{iterator_cls} as first argument.  After version 0.9.19, the
@@ -1604,7 +1606,7 @@
 @end deftypefun
 
 
address@hidden int MHD_set_connection_value (struct MHD_Connection *connection, 
enum MHD_ValueKind kind, const char * key, const char * value)
address@hidden int MHD_set_connection_value (struct MHD_Connection *connection, 
enum MHD_ValueKind kind, const char *key, const char *value)
 This function can be used to append an entry to
 the list of HTTP headers of a connection (so that the
 @code{MHD_get_connection_values function} will return

Modified: libmicrohttpd/src/include/microhttpd.h
===================================================================
--- libmicrohttpd/src/include/microhttpd.h      2015-10-25 15:45:03 UTC (rev 
36570)
+++ libmicrohttpd/src/include/microhttpd.h      2015-10-25 22:07:42 UTC (rev 
36571)
@@ -130,7 +130,7 @@
  * Current version of the library.
  * 0x01093001 = 1.9.30-1.
  */
-#define MHD_VERSION 0x00094402
+#define MHD_VERSION 0x00094403
 
 /**
  * MHD-internal return code for "YES".
@@ -1777,7 +1777,7 @@
  * Get all of the headers from the request.
  *
  * @param connection connection to get values from
- * @param kind types of values to iterate over
+ * @param kind types of values to iterate over, can be a bitmask
  * @param iterator callback to call on each header;
  *        maybe NULL (then just count headers)
  * @param iterator_cls extra argument to @a iterator
@@ -1787,7 +1787,8 @@
 _MHD_EXTERN int
 MHD_get_connection_values (struct MHD_Connection *connection,
                            enum MHD_ValueKind kind,
-                           MHD_KeyValueIterator iterator, void *iterator_cls);
+                           MHD_KeyValueIterator iterator,
+                           void *iterator_cls);
 
 
 /**

Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c   2015-10-25 15:45:03 UTC (rev 
36570)
+++ libmicrohttpd/src/microhttpd/connection.c   2015-10-25 22:07:42 UTC (rev 
36571)
@@ -116,7 +116,7 @@
  * Get all of the headers from the request.
  *
  * @param connection connection to get values from
- * @param kind types of values to iterate over
+ * @param kind types of values to iterate over, can be a bitmask
  * @param iterator callback to call on each header;
  *        maybe NULL (then just count headers)
  * @param iterator_cls extra argument to @a iterator
@@ -126,7 +126,8 @@
 int
 MHD_get_connection_values (struct MHD_Connection *connection,
                            enum MHD_ValueKind kind,
-                           MHD_KeyValueIterator iterator, void *iterator_cls)
+                           MHD_KeyValueIterator iterator,
+                           void *iterator_cls)
 {
   int ret;
   struct MHD_HTTP_Header *pos;
@@ -138,9 +139,11 @@
     if (0 != (pos->kind & kind))
       {
        ret++;
-       if ((NULL != iterator) &&
-           (MHD_YES != iterator (iterator_cls,
-                                 kind, pos->header, pos->value)))
+       if ( (NULL != iterator) &&
+             (MHD_YES != iterator (iterator_cls,
+                                   pos->kind,
+                                   pos->header,
+                                   pos->value)) )
          return ret;
       }
   return ret;




reply via email to

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