aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-03-20 10:46:21 +0100
committerChristian Grothoff <christian@grothoff.org>2019-03-20 10:46:21 +0100
commit1b610e5b13b7b96e7b3f372c8da1ec9d840f896a (patch)
tree981bbabfcff95e4d5b83c0b50c9cec7611e54abb /doc
parente2c268e3796557560fb2ffe3c2e9c18f74fc9471 (diff)
downloadlibmicrohttpd-1b610e5b13b7b96e7b3f372c8da1ec9d840f896a.tar.gz
libmicrohttpd-1b610e5b13b7b96e7b3f372c8da1ec9d840f896a.zip
allow binary zero in unescaped GET arguments (see mailinglist)
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/logging.c17
-rw-r--r--doc/libmicrohttpd.texi13
2 files changed, 24 insertions, 6 deletions
diff --git a/doc/examples/logging.c b/doc/examples/logging.c
index 239fbe7d..a88f461e 100644
--- a/doc/examples/logging.c
+++ b/doc/examples/logging.c
@@ -15,11 +15,16 @@
15 15
16 16
17static int 17static int
18print_out_key (void *cls, enum MHD_ValueKind kind, const char *key, 18print_out_key (void *cls,
19 const char *value) 19 enum MHD_ValueKind kind,
20 const char *key,
21 const char *value,
22 size_t value_size)
20{ 23{
21 (void)cls; /* Unused. Silent compiler warning. */ 24 (void) cls; /* Unused. Silent compiler warning. */
22 (void)kind; /* Unused. Silent compiler warning. */ 25 (void) kind; /* Unused. Silent compiler warning. */
26 (void) value_size;
27
23 printf ("%s: %s\n", key, value); 28 printf ("%s: %s\n", key, value);
24 return MHD_YES; 29 return MHD_YES;
25} 30}
@@ -38,7 +43,9 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
38 (void)con_cls; /* Unused. Silent compiler warning. */ 43 (void)con_cls; /* Unused. Silent compiler warning. */
39 printf ("New %s request for %s using version %s\n", method, url, version); 44 printf ("New %s request for %s using version %s\n", method, url, version);
40 45
41 MHD_get_connection_values (connection, MHD_HEADER_KIND, print_out_key, 46 MHD_get_connection_values (connection,
47 MHD_HEADER_KIND,
48 &print_out_key,
42 NULL); 49 NULL);
43 50
44 return MHD_NO; 51 return MHD_NO;
diff --git a/doc/libmicrohttpd.texi b/doc/libmicrohttpd.texi
index f2e3576c..97a79bdc 100644
--- a/doc/libmicrohttpd.texi
+++ b/doc/libmicrohttpd.texi
@@ -1356,7 +1356,7 @@ reason for request termination see @code{MHD_OPTION_NOTIFY_COMPLETED}.
1356@end deftypefn 1356@end deftypefn
1357 1357
1358 1358
1359@deftypefn {Function Pointer} int {*MHD_KeyValueIterator} (void *cls, enum MHD_ValueKind kind, const char *key, const char *value) 1359@deftypefn {Function Pointer} int {*MHD_KeyValueIterator} (void *cls, enum MHD_ValueKind kind, const char *key, const char *value, size_t value_size)
1360Iterator over key-value pairs. This iterator can be used to iterate 1360Iterator over key-value pairs. This iterator can be used to iterate
1361over all of the cookies, headers, or @code{POST}-data fields of a 1361over all of the cookies, headers, or @code{POST}-data fields of a
1362request, and also to iterate over the headers that have been added to a 1362request, and also to iterate over the headers that have been added to a
@@ -1375,6 +1375,17 @@ key for the value, can be an empty string
1375@item value 1375@item value
1376value corresponding value, can be NULL 1376value corresponding value, can be NULL
1377 1377
1378@item value_size
1379number of bytes in @code{value}. This argument was introduced in
1380@code{MHD_VERSION} 0x00096301 to allow applications to use binary
1381zeros in values. Applications using this argument must ensure that
1382they are using a sufficiently recent version of MHD, i.e. by testing
1383@code{MHD_get_version()} for values above or equal to 0.9.64.
1384Applications that do not need zeros in values and that want to compile
1385without warnings against newer versions of MHD should not declare this
1386argument and cast the function pointer argument to
1387@code{MHD_KeyValueIterator}.
1388
1378@end table 1389@end table
1379 1390
1380Return @code{MHD_YES} to continue iterating, @code{MHD_NO} to abort the 1391Return @code{MHD_YES} to continue iterating, @code{MHD_NO} to abort the