diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-04-08 15:12:45 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-04-08 15:12:45 +0200 |
commit | 312713c3634aa22d538c09d0146b5ac1d62c206b (patch) | |
tree | adeb696c8a3339d231b78f3a0c9893a7124e45a2 | |
parent | 83a86be948420f7bd902ceee9d661fc208eec1cd (diff) | |
parent | 1b610e5b13b7b96e7b3f372c8da1ec9d840f896a (diff) | |
download | libmicrohttpd-312713c3634aa22d538c09d0146b5ac1d62c206b.tar.gz libmicrohttpd-312713c3634aa22d538c09d0146b5ac1d62c206b.zip |
merge
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | doc/examples/logging.c | 17 | ||||
-rw-r--r-- | doc/libmicrohttpd.texi | 13 | ||||
-rw-r--r-- | po/libmicrohttpd.pot | 266 | ||||
-rw-r--r-- | src/examples/Makefile.am | 8 | ||||
-rw-r--r-- | src/examples/http_chunked_compression.c | 199 | ||||
-rw-r--r-- | src/include/microhttpd.h | 56 | ||||
-rw-r--r-- | src/microhttpd/connection.c | 108 | ||||
-rw-r--r-- | src/microhttpd/digestauth.c | 23 | ||||
-rw-r--r-- | src/microhttpd/internal.c | 19 | ||||
-rw-r--r-- | src/microhttpd/internal.h | 9 | ||||
-rw-r--r-- | src/microhttpd/response.c | 3 | ||||
-rw-r--r-- | src/testcurl/test_get.c | 94 | ||||
-rw-r--r-- | src/testcurl/test_process_headers.c | 8 | ||||
-rw-r--r-- | src/testcurl/test_urlparse.c | 9 |
16 files changed, 648 insertions, 209 deletions
@@ -2,6 +2,25 @@ Mon 08 Apr 2019 03:06:05 PM CEST | |||
2 | Fix close() checks as suggested by MK on the mailinglist | 2 | Fix close() checks as suggested by MK on the mailinglist |
3 | (#3926). -MK/CG | 3 | (#3926). -MK/CG |
4 | 4 | ||
5 | Wed 20 Mar 2019 10:20:24 AM CET | ||
6 | Adding additional "value_length" argument to MHD_KeyValueIterator | ||
7 | callback to support binary zeros in values. This is done in a | ||
8 | backwards-compatible way, but may require adding a cast to existing | ||
9 | code to avoid a compiler warning. -CG | ||
10 | |||
11 | Sun Feb 10 21:00:37 BRT 2019 | ||
12 | Added example for how to compress a chunked HTTP response. -SC | ||
13 | |||
14 | Sun 10 Feb 2019 05:03:44 PM CET | ||
15 | Releasing libmicrohttpd 0.9.63. -CG | ||
16 | |||
17 | Sat 09 Feb 2019 01:51:02 PM CET | ||
18 | Extended test_get to test URI logging and query string parsing | ||
19 | to avoid regression fixed in previous patch in the future. -CG | ||
20 | |||
21 | Thu Feb 7 16:16:12 CET 2019 | ||
22 | Preliminary patch for the raw query string issue, to be tested. -CG | ||
23 | |||
5 | Tue Jan 8 02:57:21 BRT 2019 | 24 | Tue Jan 8 02:57:21 BRT 2019 |
6 | Added minimal example for how to compress HTTP response. -SC | 25 | Added minimal example for how to compress HTTP response. -SC |
7 | 26 | ||
diff --git a/configure.ac b/configure.ac index cfe7af90..62f5ed5e 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -22,15 +22,15 @@ | |||
22 | # | 22 | # |
23 | AC_PREREQ([2.64]) | 23 | AC_PREREQ([2.64]) |
24 | LT_PREREQ([2.4.0]) | 24 | LT_PREREQ([2.4.0]) |
25 | AC_INIT([GNU Libmicrohttpd],[0.9.62],[libmicrohttpd@gnu.org]) | 25 | AC_INIT([GNU Libmicrohttpd],[0.9.63],[libmicrohttpd@gnu.org]) |
26 | AC_CONFIG_AUX_DIR([build-aux]) | 26 | AC_CONFIG_AUX_DIR([build-aux]) |
27 | AM_INIT_AUTOMAKE([silent-rules] [subdir-objects]) | 27 | AM_INIT_AUTOMAKE([silent-rules] [subdir-objects]) |
28 | AC_CONFIG_HEADERS([MHD_config.h]) | 28 | AC_CONFIG_HEADERS([MHD_config.h]) |
29 | AC_CONFIG_MACRO_DIR([m4]) | 29 | AC_CONFIG_MACRO_DIR([m4]) |
30 | 30 | ||
31 | LIB_VERSION_CURRENT=61 | 31 | LIB_VERSION_CURRENT=62 |
32 | LIB_VERSION_REVISION=0 | 32 | LIB_VERSION_REVISION=0 |
33 | LIB_VERSION_AGE=49 | 33 | LIB_VERSION_AGE=50 |
34 | AC_SUBST(LIB_VERSION_CURRENT) | 34 | AC_SUBST(LIB_VERSION_CURRENT) |
35 | AC_SUBST(LIB_VERSION_REVISION) | 35 | AC_SUBST(LIB_VERSION_REVISION) |
36 | AC_SUBST(LIB_VERSION_AGE) | 36 | AC_SUBST(LIB_VERSION_AGE) |
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 | ||
17 | static int | 17 | static int |
18 | print_out_key (void *cls, enum MHD_ValueKind kind, const char *key, | 18 | print_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) |
1360 | Iterator over key-value pairs. This iterator can be used to iterate | 1360 | Iterator over key-value pairs. This iterator can be used to iterate |
1361 | over all of the cookies, headers, or @code{POST}-data fields of a | 1361 | over all of the cookies, headers, or @code{POST}-data fields of a |
1362 | request, and also to iterate over the headers that have been added to a | 1362 | request, 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 |
1376 | value corresponding value, can be NULL | 1376 | value corresponding value, can be NULL |
1377 | 1377 | ||
1378 | @item value_size | ||
1379 | number of bytes in @code{value}. This argument was introduced in | ||
1380 | @code{MHD_VERSION} 0x00096301 to allow applications to use binary | ||
1381 | zeros in values. Applications using this argument must ensure that | ||
1382 | they 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. | ||
1384 | Applications that do not need zeros in values and that want to compile | ||
1385 | without warnings against newer versions of MHD should not declare this | ||
1386 | argument and cast the function pointer argument to | ||
1387 | @code{MHD_KeyValueIterator}. | ||
1388 | |||
1378 | @end table | 1389 | @end table |
1379 | 1390 | ||
1380 | Return @code{MHD_YES} to continue iterating, @code{MHD_NO} to abort the | 1391 | Return @code{MHD_YES} to continue iterating, @code{MHD_NO} to abort the |
diff --git a/po/libmicrohttpd.pot b/po/libmicrohttpd.pot index 9825d043..7906e9ec 100644 --- a/po/libmicrohttpd.pot +++ b/po/libmicrohttpd.pot | |||
@@ -6,9 +6,9 @@ | |||
6 | #, fuzzy | 6 | #, fuzzy |
7 | msgid "" | 7 | msgid "" |
8 | msgstr "" | 8 | msgstr "" |
9 | "Project-Id-Version: GNU libmicrohttpd 0.9.62\n" | 9 | "Project-Id-Version: GNU libmicrohttpd 0.9.63\n" |
10 | "Report-Msgid-Bugs-To: libmicrohttpd@gnu.org\n" | 10 | "Report-Msgid-Bugs-To: libmicrohttpd@gnu.org\n" |
11 | "POT-Creation-Date: 2018-12-08 23:11+0100\n" | 11 | "POT-Creation-Date: 2019-02-10 17:12+0100\n" |
12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
@@ -37,53 +37,53 @@ msgstr "" | |||
37 | msgid "Failed to close FD.\n" | 37 | msgid "Failed to close FD.\n" |
38 | msgstr "" | 38 | msgstr "" |
39 | 39 | ||
40 | #: src/microhttpd/digestauth.c:563 | 40 | #: src/microhttpd/digestauth.c:599 |
41 | msgid "" | 41 | msgid "" |
42 | "Stale nonce received. If this happens a lot, you should probably increase " | 42 | "Stale nonce received. If this happens a lot, you should probably increase " |
43 | "the size of the nonce array.\n" | 43 | "the size of the nonce array.\n" |
44 | msgstr "" | 44 | msgstr "" |
45 | 45 | ||
46 | #: src/microhttpd/digestauth.c:755 | 46 | #: src/microhttpd/digestauth.c:792 |
47 | msgid "Failed to allocate memory for copy of URI arguments\n" | 47 | msgid "Failed to allocate memory for copy of URI arguments\n" |
48 | msgstr "" | 48 | msgstr "" |
49 | 49 | ||
50 | #: src/microhttpd/digestauth.c:893 | 50 | #: src/microhttpd/digestauth.c:932 |
51 | msgid "Authentication failed, invalid timestamp format.\n" | 51 | msgid "Authentication failed, invalid timestamp format.\n" |
52 | msgstr "" | 52 | msgstr "" |
53 | 53 | ||
54 | #: src/microhttpd/digestauth.c:956 | 54 | #: src/microhttpd/digestauth.c:995 |
55 | msgid "Authentication failed, invalid format.\n" | 55 | msgid "Authentication failed, invalid format.\n" |
56 | msgstr "" | 56 | msgstr "" |
57 | 57 | ||
58 | #: src/microhttpd/digestauth.c:966 | 58 | #: src/microhttpd/digestauth.c:1005 |
59 | msgid "Authentication failed, invalid nc format.\n" | 59 | msgid "Authentication failed, invalid nc format.\n" |
60 | msgstr "" | 60 | msgstr "" |
61 | 61 | ||
62 | #: src/microhttpd/digestauth.c:992 | 62 | #: src/microhttpd/digestauth.c:1031 |
63 | msgid "Failed to allocate memory for auth header processing\n" | 63 | msgid "Failed to allocate memory for auth header processing\n" |
64 | msgstr "" | 64 | msgstr "" |
65 | 65 | ||
66 | #: src/microhttpd/digestauth.c:1049 | 66 | #: src/microhttpd/digestauth.c:1090 |
67 | msgid "Authentication failed, URI does not match.\n" | 67 | msgid "Authentication failed, URI does not match.\n" |
68 | msgstr "" | 68 | msgstr "" |
69 | 69 | ||
70 | #: src/microhttpd/digestauth.c:1069 | 70 | #: src/microhttpd/digestauth.c:1109 |
71 | msgid "Authentication failed, arguments do not match.\n" | 71 | msgid "Authentication failed, arguments do not match.\n" |
72 | msgstr "" | 72 | msgstr "" |
73 | 73 | ||
74 | #: src/microhttpd/digestauth.c:1224 | 74 | #: src/microhttpd/digestauth.c:1264 |
75 | msgid "digest size missmatch" | 75 | msgid "digest size missmatch" |
76 | msgstr "" | 76 | msgstr "" |
77 | 77 | ||
78 | #: src/microhttpd/digestauth.c:1314 | 78 | #: src/microhttpd/digestauth.c:1356 |
79 | msgid "Could not register nonce (is the nonce array size zero?).\n" | 79 | msgid "Could not register nonce (is the nonce array size zero?).\n" |
80 | msgstr "" | 80 | msgstr "" |
81 | 81 | ||
82 | #: src/microhttpd/digestauth.c:1339 | 82 | #: src/microhttpd/digestauth.c:1381 |
83 | msgid "Failed to allocate memory for auth response header\n" | 83 | msgid "Failed to allocate memory for auth response header\n" |
84 | msgstr "" | 84 | msgstr "" |
85 | 85 | ||
86 | #: src/microhttpd/digestauth.c:1375 | 86 | #: src/microhttpd/digestauth.c:1417 |
87 | msgid "Failed to add Digest auth header\n" | 87 | msgid "Failed to add Digest auth header\n" |
88 | msgstr "" | 88 | msgstr "" |
89 | 89 | ||
@@ -126,7 +126,7 @@ msgid "" | |||
126 | "unsupported.\n" | 126 | "unsupported.\n" |
127 | msgstr "" | 127 | msgstr "" |
128 | 128 | ||
129 | #: src/microhttpd/daemon.c:1279 src/microhttpd/daemon.c:6454 | 129 | #: src/microhttpd/daemon.c:1279 src/microhttpd/daemon.c:6469 |
130 | msgid "" | 130 | msgid "" |
131 | "Initiated daemon shutdown while \"upgraded\" connection was not closed.\n" | 131 | "Initiated daemon shutdown while \"upgraded\" connection was not closed.\n" |
132 | msgstr "" | 132 | msgstr "" |
@@ -180,7 +180,7 @@ msgstr "" | |||
180 | msgid "PSK authentication failed: gnutls_malloc failed to allocate memory\n" | 180 | msgid "PSK authentication failed: gnutls_malloc failed to allocate memory\n" |
181 | msgstr "" | 181 | msgstr "" |
182 | 182 | ||
183 | #: src/microhttpd/daemon.c:2318 src/microhttpd/daemon.c:6104 | 183 | #: src/microhttpd/daemon.c:2318 src/microhttpd/daemon.c:6113 |
184 | #, c-format | 184 | #, c-format |
185 | msgid "Socket descriptor larger than FD_SETSIZE: %d > %d\n" | 185 | msgid "Socket descriptor larger than FD_SETSIZE: %d > %d\n" |
186 | msgstr "" | 186 | msgstr "" |
@@ -190,7 +190,7 @@ msgstr "" | |||
190 | msgid "Failed to set SO_NOSIGPIPE on accepted socket: %s\n" | 190 | msgid "Failed to set SO_NOSIGPIPE on accepted socket: %s\n" |
191 | msgstr "" | 191 | msgstr "" |
192 | 192 | ||
193 | #: src/microhttpd/daemon.c:2351 src/microhttpd/daemon.c:3155 | 193 | #: src/microhttpd/daemon.c:2351 src/microhttpd/daemon.c:3164 |
194 | #, c-format | 194 | #, c-format |
195 | msgid "Accepted connection on socket %d\n" | 195 | msgid "Accepted connection on socket %d\n" |
196 | msgstr "" | 196 | msgstr "" |
@@ -204,7 +204,7 @@ msgid "Connection rejected by application. Closing connection.\n" | |||
204 | msgstr "" | 204 | msgstr "" |
205 | 205 | ||
206 | #: src/microhttpd/daemon.c:2414 src/microhttpd/daemon.c:2434 | 206 | #: src/microhttpd/daemon.c:2414 src/microhttpd/daemon.c:2434 |
207 | #: src/microhttpd/daemon.c:3741 | 207 | #: src/microhttpd/daemon.c:3750 |
208 | #, c-format | 208 | #, c-format |
209 | msgid "Error allocating memory: %s\n" | 209 | msgid "Error allocating memory: %s\n" |
210 | msgstr "" | 210 | msgstr "" |
@@ -218,9 +218,9 @@ msgstr "" | |||
218 | msgid "Unknown credential type" | 218 | msgid "Unknown credential type" |
219 | msgstr "" | 219 | msgstr "" |
220 | 220 | ||
221 | #: src/microhttpd/daemon.c:2607 src/microhttpd/daemon.c:4231 | 221 | #: src/microhttpd/daemon.c:2607 src/microhttpd/daemon.c:4240 |
222 | #: src/microhttpd/daemon.c:4264 src/microhttpd/daemon.c:5409 | 222 | #: src/microhttpd/daemon.c:4273 src/microhttpd/daemon.c:5418 |
223 | #: src/microhttpd/daemon.c:5426 src/microhttpd/connection.c:3867 | 223 | #: src/microhttpd/daemon.c:5435 src/microhttpd/connection.c:3857 |
224 | #: src/microhttpd/response.c:968 src/microhttpd/response.c:994 | 224 | #: src/microhttpd/response.c:968 src/microhttpd/response.c:994 |
225 | #, c-format | 225 | #, c-format |
226 | msgid "Call to epoll_ctl failed: %s\n" | 226 | msgid "Call to epoll_ctl failed: %s\n" |
@@ -230,9 +230,9 @@ msgstr "" | |||
230 | msgid "Failed to signal new connection via inter-thread communication channel." | 230 | msgid "Failed to signal new connection via inter-thread communication channel." |
231 | msgstr "" | 231 | msgstr "" |
232 | 232 | ||
233 | #: src/microhttpd/daemon.c:2737 src/microhttpd/daemon.c:3239 | 233 | #: src/microhttpd/daemon.c:2737 src/microhttpd/daemon.c:3248 |
234 | #: src/microhttpd/daemon.c:6350 src/microhttpd/connection.c:992 | 234 | #: src/microhttpd/daemon.c:6359 src/microhttpd/connection.c:979 |
235 | #: src/microhttpd/connection.c:1011 | 235 | #: src/microhttpd/connection.c:998 |
236 | msgid "Failed to remove FD from epoll set\n" | 236 | msgid "Failed to remove FD from epoll set\n" |
237 | msgstr "" | 237 | msgstr "" |
238 | 238 | ||
@@ -266,474 +266,478 @@ msgstr "" | |||
266 | msgid "Failed to set noninheritable mode on new client socket.\n" | 266 | msgid "Failed to set noninheritable mode on new client socket.\n" |
267 | msgstr "" | 267 | msgstr "" |
268 | 268 | ||
269 | #: src/microhttpd/daemon.c:3093 | 269 | #: src/microhttpd/daemon.c:3029 |
270 | msgid "Failed to reset buffering mode on new client socket.\n" | ||
271 | msgstr "" | ||
272 | |||
273 | #: src/microhttpd/daemon.c:3102 | ||
270 | #, c-format | 274 | #, c-format |
271 | msgid "Error accepting connection: %s\n" | 275 | msgid "Error accepting connection: %s\n" |
272 | msgstr "" | 276 | msgstr "" |
273 | 277 | ||
274 | #: src/microhttpd/daemon.c:3110 | 278 | #: src/microhttpd/daemon.c:3119 |
275 | msgid "" | 279 | msgid "" |
276 | "Hit process or system resource limit at FIRST connection. This is really bad " | 280 | "Hit process or system resource limit at FIRST connection. This is really bad " |
277 | "as there is no sane way to proceed. Will try busy waiting for system " | 281 | "as there is no sane way to proceed. Will try busy waiting for system " |
278 | "resources to become magically available.\n" | 282 | "resources to become magically available.\n" |
279 | msgstr "" | 283 | msgstr "" |
280 | 284 | ||
281 | #: src/microhttpd/daemon.c:3124 | 285 | #: src/microhttpd/daemon.c:3133 |
282 | #, c-format | 286 | #, c-format |
283 | msgid "" | 287 | msgid "" |
284 | "Hit process or system resource limit at %u connections, temporarily " | 288 | "Hit process or system resource limit at %u connections, temporarily " |
285 | "suspending accept(). Consider setting a lower MHD_OPTION_CONNECTION_LIMIT.\n" | 289 | "suspending accept(). Consider setting a lower MHD_OPTION_CONNECTION_LIMIT.\n" |
286 | msgstr "" | 290 | msgstr "" |
287 | 291 | ||
288 | #: src/microhttpd/daemon.c:3136 | 292 | #: src/microhttpd/daemon.c:3145 |
289 | #, c-format | 293 | #, c-format |
290 | msgid "Failed to set nonblocking mode on incoming connection socket: %s\n" | 294 | msgid "Failed to set nonblocking mode on incoming connection socket: %s\n" |
291 | msgstr "" | 295 | msgstr "" |
292 | 296 | ||
293 | #: src/microhttpd/daemon.c:3148 | 297 | #: src/microhttpd/daemon.c:3157 |
294 | msgid "Failed to set noninheritable mode on incoming connection socket.\n" | 298 | msgid "Failed to set noninheritable mode on incoming connection socket.\n" |
295 | msgstr "" | 299 | msgstr "" |
296 | 300 | ||
297 | #: src/microhttpd/daemon.c:3196 src/microhttpd/daemon.c:6496 | 301 | #: src/microhttpd/daemon.c:3205 src/microhttpd/daemon.c:6511 |
298 | #: src/microhttpd/daemon.c:6528 src/microhttpd/daemon.c:6628 | 302 | #: src/microhttpd/daemon.c:6543 src/microhttpd/daemon.c:6643 |
299 | msgid "Failed to join a thread\n" | 303 | msgid "Failed to join a thread\n" |
300 | msgstr "" | 304 | msgstr "" |
301 | 305 | ||
302 | #: src/microhttpd/daemon.c:3300 | 306 | #: src/microhttpd/daemon.c:3309 |
303 | msgid "Illegal call to MHD_get_timeout\n" | 307 | msgid "Illegal call to MHD_get_timeout\n" |
304 | msgstr "" | 308 | msgstr "" |
305 | 309 | ||
306 | #: src/microhttpd/daemon.c:3497 | 310 | #: src/microhttpd/daemon.c:3506 |
307 | msgid "" | 311 | msgid "" |
308 | "MHD_run_from_select() called with except_fd_set set to NULL. Such behavior " | 312 | "MHD_run_from_select() called with except_fd_set set to NULL. Such behavior " |
309 | "is deprecated.\n" | 313 | "is deprecated.\n" |
310 | msgstr "" | 314 | msgstr "" |
311 | 315 | ||
312 | #: src/microhttpd/daemon.c:3577 | 316 | #: src/microhttpd/daemon.c:3586 |
313 | msgid "Could not obtain daemon fdsets" | 317 | msgid "Could not obtain daemon fdsets" |
314 | msgstr "" | 318 | msgstr "" |
315 | 319 | ||
316 | #: src/microhttpd/daemon.c:3594 | 320 | #: src/microhttpd/daemon.c:3603 |
317 | msgid "Could not add listen socket to fdset" | 321 | msgid "Could not add listen socket to fdset" |
318 | msgstr "" | 322 | msgstr "" |
319 | 323 | ||
320 | #: src/microhttpd/daemon.c:3622 | 324 | #: src/microhttpd/daemon.c:3631 |
321 | msgid "Could not add control inter-thread communication channel FD to fdset" | 325 | msgid "Could not add control inter-thread communication channel FD to fdset" |
322 | msgstr "" | 326 | msgstr "" |
323 | 327 | ||
324 | #: src/microhttpd/daemon.c:3678 | 328 | #: src/microhttpd/daemon.c:3687 |
325 | #, c-format | 329 | #, c-format |
326 | msgid "select failed: %s\n" | 330 | msgid "select failed: %s\n" |
327 | msgstr "" | 331 | msgstr "" |
328 | 332 | ||
329 | #: src/microhttpd/daemon.c:3823 src/microhttpd/daemon.c:3970 | 333 | #: src/microhttpd/daemon.c:3832 src/microhttpd/daemon.c:3979 |
330 | #, c-format | 334 | #, c-format |
331 | msgid "poll failed: %s\n" | 335 | msgid "poll failed: %s\n" |
332 | msgstr "" | 336 | msgstr "" |
333 | 337 | ||
334 | #: src/microhttpd/daemon.c:4100 src/microhttpd/daemon.c:4331 | 338 | #: src/microhttpd/daemon.c:4109 src/microhttpd/daemon.c:4340 |
335 | #, c-format | 339 | #, c-format |
336 | msgid "Call to epoll_wait failed: %s\n" | 340 | msgid "Call to epoll_wait failed: %s\n" |
337 | msgstr "" | 341 | msgstr "" |
338 | 342 | ||
339 | #: src/microhttpd/daemon.c:4283 src/microhttpd/daemon.c:4740 | 343 | #: src/microhttpd/daemon.c:4292 src/microhttpd/daemon.c:4749 |
340 | msgid "Failed to remove listen FD from epoll set\n" | 344 | msgid "Failed to remove listen FD from epoll set\n" |
341 | msgstr "" | 345 | msgstr "" |
342 | 346 | ||
343 | #: src/microhttpd/daemon.c:4748 | 347 | #: src/microhttpd/daemon.c:4757 |
344 | msgid "Failed to signal quiesce via inter-thread communication channel" | 348 | msgid "Failed to signal quiesce via inter-thread communication channel" |
345 | msgstr "" | 349 | msgstr "" |
346 | 350 | ||
347 | #: src/microhttpd/daemon.c:4770 | 351 | #: src/microhttpd/daemon.c:4779 |
348 | msgid "failed to signal quiesce via inter-thread communication channel" | 352 | msgid "failed to signal quiesce via inter-thread communication channel" |
349 | msgstr "" | 353 | msgstr "" |
350 | 354 | ||
351 | #: src/microhttpd/daemon.c:4878 | 355 | #: src/microhttpd/daemon.c:4887 |
352 | msgid "Warning: Too large timeout value, ignored.\n" | 356 | msgid "Warning: Too large timeout value, ignored.\n" |
353 | msgstr "" | 357 | msgstr "" |
354 | 358 | ||
355 | #: src/microhttpd/daemon.c:4919 | 359 | #: src/microhttpd/daemon.c:4928 |
356 | msgid "" | 360 | msgid "" |
357 | "Warning: Zero size, specified for thread pool size, is ignored. Thread pool " | 361 | "Warning: Zero size, specified for thread pool size, is ignored. Thread pool " |
358 | "is not used.\n" | 362 | "is not used.\n" |
359 | msgstr "" | 363 | msgstr "" |
360 | 364 | ||
361 | #: src/microhttpd/daemon.c:4927 | 365 | #: src/microhttpd/daemon.c:4936 |
362 | msgid "" | 366 | msgid "" |
363 | "Warning: \"1\", specified for thread pool size, is ignored. Thread pool is " | 367 | "Warning: \"1\", specified for thread pool size, is ignored. Thread pool is " |
364 | "not used.\n" | 368 | "not used.\n" |
365 | msgstr "" | 369 | msgstr "" |
366 | 370 | ||
367 | #: src/microhttpd/daemon.c:4939 | 371 | #: src/microhttpd/daemon.c:4948 |
368 | #, c-format | 372 | #, c-format |
369 | msgid "Specified thread pool size (%u) too big\n" | 373 | msgid "Specified thread pool size (%u) too big\n" |
370 | msgstr "" | 374 | msgstr "" |
371 | 375 | ||
372 | #: src/microhttpd/daemon.c:4950 | 376 | #: src/microhttpd/daemon.c:4959 |
373 | msgid "" | 377 | msgid "" |
374 | "MHD_OPTION_THREAD_POOL_SIZE option is specified but " | 378 | "MHD_OPTION_THREAD_POOL_SIZE option is specified but " |
375 | "MHD_USE_INTERNAL_POLLING_THREAD flag is not specified.\n" | 379 | "MHD_USE_INTERNAL_POLLING_THREAD flag is not specified.\n" |
376 | msgstr "" | 380 | msgstr "" |
377 | 381 | ||
378 | #: src/microhttpd/daemon.c:4959 | 382 | #: src/microhttpd/daemon.c:4968 |
379 | msgid "" | 383 | msgid "" |
380 | "Both MHD_OPTION_THREAD_POOL_SIZE option and MHD_USE_THREAD_PER_CONNECTION " | 384 | "Both MHD_OPTION_THREAD_POOL_SIZE option and MHD_USE_THREAD_PER_CONNECTION " |
381 | "flag are specified.\n" | 385 | "flag are specified.\n" |
382 | msgstr "" | 386 | msgstr "" |
383 | 387 | ||
384 | #: src/microhttpd/daemon.c:4976 src/microhttpd/daemon.c:4988 | 388 | #: src/microhttpd/daemon.c:4985 src/microhttpd/daemon.c:4997 |
385 | #: src/microhttpd/daemon.c:5000 src/microhttpd/daemon.c:5012 | 389 | #: src/microhttpd/daemon.c:5009 src/microhttpd/daemon.c:5021 |
386 | #: src/microhttpd/daemon.c:5053 src/microhttpd/daemon.c:5081 | 390 | #: src/microhttpd/daemon.c:5062 src/microhttpd/daemon.c:5090 |
387 | #: src/microhttpd/daemon.c:5100 | 391 | #: src/microhttpd/daemon.c:5109 |
388 | #, c-format | 392 | #, c-format |
389 | msgid "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not set\n" | 393 | msgid "MHD HTTPS option %d passed to MHD but MHD_USE_TLS not set\n" |
390 | msgstr "" | 394 | msgstr "" |
391 | 395 | ||
392 | #: src/microhttpd/daemon.c:5031 | 396 | #: src/microhttpd/daemon.c:5040 |
393 | msgid "Error initializing DH parameters\n" | 397 | msgid "Error initializing DH parameters\n" |
394 | msgstr "" | 398 | msgstr "" |
395 | 399 | ||
396 | #: src/microhttpd/daemon.c:5043 | 400 | #: src/microhttpd/daemon.c:5052 |
397 | msgid "Bad Diffie-Hellman parameters format\n" | 401 | msgid "Bad Diffie-Hellman parameters format\n" |
398 | msgstr "" | 402 | msgstr "" |
399 | 403 | ||
400 | #: src/microhttpd/daemon.c:5070 | 404 | #: src/microhttpd/daemon.c:5079 |
401 | #, c-format | 405 | #, c-format |
402 | msgid "Setting priorities to `%s' failed: %s\n" | 406 | msgid "Setting priorities to `%s' failed: %s\n" |
403 | msgstr "" | 407 | msgstr "" |
404 | 408 | ||
405 | #: src/microhttpd/daemon.c:5089 | 409 | #: src/microhttpd/daemon.c:5098 |
406 | msgid "" | 410 | msgid "" |
407 | "MHD_OPTION_HTTPS_CERT_CALLBACK requires building MHD with GnuTLS >= 3.0\n" | 411 | "MHD_OPTION_HTTPS_CERT_CALLBACK requires building MHD with GnuTLS >= 3.0\n" |
408 | msgstr "" | 412 | msgstr "" |
409 | 413 | ||
410 | #: src/microhttpd/daemon.c:5123 | 414 | #: src/microhttpd/daemon.c:5132 |
411 | msgid "" | 415 | msgid "" |
412 | "MHD_OPTION_LISTEN_SOCKET specified for daemon with MHD_USE_NO_LISTEN_SOCKET " | 416 | "MHD_OPTION_LISTEN_SOCKET specified for daemon with MHD_USE_NO_LISTEN_SOCKET " |
413 | "flag set.\n" | 417 | "flag set.\n" |
414 | msgstr "" | 418 | msgstr "" |
415 | 419 | ||
416 | #: src/microhttpd/daemon.c:5172 | 420 | #: src/microhttpd/daemon.c:5181 |
417 | msgid "" | 421 | msgid "" |
418 | "Flag MHD_USE_PEDANTIC_CHECKS is ignored because another behavior is " | 422 | "Flag MHD_USE_PEDANTIC_CHECKS is ignored because another behavior is " |
419 | "specified by MHD_OPTION_STRICT_CLIENT.\n" | 423 | "specified by MHD_OPTION_STRICT_CLIENT.\n" |
420 | msgstr "" | 424 | msgstr "" |
421 | 425 | ||
422 | #: src/microhttpd/daemon.c:5304 | 426 | #: src/microhttpd/daemon.c:5313 |
423 | #, c-format | 427 | #, c-format |
424 | msgid "MHD HTTPS option %d passed to MHD compiled without GNUtls >= 3\n" | 428 | msgid "MHD HTTPS option %d passed to MHD compiled without GNUtls >= 3\n" |
425 | msgstr "" | 429 | msgstr "" |
426 | 430 | ||
427 | #: src/microhttpd/daemon.c:5317 | 431 | #: src/microhttpd/daemon.c:5326 |
428 | #, c-format | 432 | #, c-format |
429 | msgid "MHD HTTPS option %d passed to MHD compiled without HTTPS support\n" | 433 | msgid "MHD HTTPS option %d passed to MHD compiled without HTTPS support\n" |
430 | msgstr "" | 434 | msgstr "" |
431 | 435 | ||
432 | #: src/microhttpd/daemon.c:5323 | 436 | #: src/microhttpd/daemon.c:5332 |
433 | #, c-format | 437 | #, c-format |
434 | msgid "Invalid option %d! (Did you terminate the list with MHD_OPTION_END?)\n" | 438 | msgid "Invalid option %d! (Did you terminate the list with MHD_OPTION_END?)\n" |
435 | msgstr "" | 439 | msgstr "" |
436 | 440 | ||
437 | #: src/microhttpd/daemon.c:5353 | 441 | #: src/microhttpd/daemon.c:5362 |
438 | #, c-format | 442 | #, c-format |
439 | msgid "Call to epoll_create1 failed: %s\n" | 443 | msgid "Call to epoll_create1 failed: %s\n" |
440 | msgstr "" | 444 | msgstr "" |
441 | 445 | ||
442 | #: src/microhttpd/daemon.c:5363 | 446 | #: src/microhttpd/daemon.c:5372 |
443 | msgid "Failed to set noninheritable mode on epoll FD.\n" | 447 | msgid "Failed to set noninheritable mode on epoll FD.\n" |
444 | msgstr "" | 448 | msgstr "" |
445 | 449 | ||
446 | #: src/microhttpd/daemon.c:5606 | 450 | #: src/microhttpd/daemon.c:5615 |
447 | msgid "" | 451 | msgid "" |
448 | "Warning: MHD_USE_THREAD_PER_CONNECTION must be used only with " | 452 | "Warning: MHD_USE_THREAD_PER_CONNECTION must be used only with " |
449 | "MHD_USE_INTERNAL_POLLING_THREAD. Flag MHD_USE_INTERNAL_POLLING_THREAD was " | 453 | "MHD_USE_INTERNAL_POLLING_THREAD. Flag MHD_USE_INTERNAL_POLLING_THREAD was " |
450 | "added. Consider setting MHD_USE_INTERNAL_POLLING_THREAD explicitly.\n" | 454 | "added. Consider setting MHD_USE_INTERNAL_POLLING_THREAD explicitly.\n" |
451 | msgstr "" | 455 | msgstr "" |
452 | 456 | ||
453 | #: src/microhttpd/daemon.c:5654 | 457 | #: src/microhttpd/daemon.c:5663 |
454 | msgid "Using debug build of libmicrohttpd.\n" | 458 | msgid "Using debug build of libmicrohttpd.\n" |
455 | msgstr "" | 459 | msgstr "" |
456 | 460 | ||
457 | #: src/microhttpd/daemon.c:5668 | 461 | #: src/microhttpd/daemon.c:5677 |
458 | #, c-format | 462 | #, c-format |
459 | msgid "Failed to create inter-thread communication channel: %s\n" | 463 | msgid "Failed to create inter-thread communication channel: %s\n" |
460 | msgstr "" | 464 | msgstr "" |
461 | 465 | ||
462 | #: src/microhttpd/daemon.c:5684 | 466 | #: src/microhttpd/daemon.c:5693 |
463 | msgid "" | 467 | msgid "" |
464 | "file descriptor for inter-thread communication channel exceeds maximum " | 468 | "file descriptor for inter-thread communication channel exceeds maximum " |
465 | "value\n" | 469 | "value\n" |
466 | msgstr "" | 470 | msgstr "" |
467 | 471 | ||
468 | #: src/microhttpd/daemon.c:5704 | 472 | #: src/microhttpd/daemon.c:5713 |
469 | msgid "Specified value for NC_SIZE too large\n" | 473 | msgid "Specified value for NC_SIZE too large\n" |
470 | msgstr "" | 474 | msgstr "" |
471 | 475 | ||
472 | #: src/microhttpd/daemon.c:5718 | 476 | #: src/microhttpd/daemon.c:5727 |
473 | #, c-format | 477 | #, c-format |
474 | msgid "Failed to allocate memory for nonce-nc map: %s\n" | 478 | msgid "Failed to allocate memory for nonce-nc map: %s\n" |
475 | msgstr "" | 479 | msgstr "" |
476 | 480 | ||
477 | #: src/microhttpd/daemon.c:5735 | 481 | #: src/microhttpd/daemon.c:5744 |
478 | msgid "MHD failed to initialize nonce-nc mutex\n" | 482 | msgid "MHD failed to initialize nonce-nc mutex\n" |
479 | msgstr "" | 483 | msgstr "" |
480 | 484 | ||
481 | #: src/microhttpd/daemon.c:5755 | 485 | #: src/microhttpd/daemon.c:5764 |
482 | msgid "MHD thread pooling only works with MHD_USE_INTERNAL_POLLING_THREAD\n" | 486 | msgid "MHD thread pooling only works with MHD_USE_INTERNAL_POLLING_THREAD\n" |
483 | msgstr "" | 487 | msgstr "" |
484 | 488 | ||
485 | #: src/microhttpd/daemon.c:5779 | 489 | #: src/microhttpd/daemon.c:5788 |
486 | #, c-format | 490 | #, c-format |
487 | msgid "Failed to create socket for listening: %s\n" | 491 | msgid "Failed to create socket for listening: %s\n" |
488 | msgstr "" | 492 | msgstr "" |
489 | 493 | ||
490 | #: src/microhttpd/daemon.c:5800 src/microhttpd/daemon.c:5819 | 494 | #: src/microhttpd/daemon.c:5809 src/microhttpd/daemon.c:5828 |
491 | #: src/microhttpd/daemon.c:5842 src/microhttpd/daemon.c:5879 | 495 | #: src/microhttpd/daemon.c:5851 src/microhttpd/daemon.c:5888 |
492 | #: src/microhttpd/daemon.c:5956 src/microhttpd/daemon.c:5987 | 496 | #: src/microhttpd/daemon.c:5965 src/microhttpd/daemon.c:5996 |
493 | #, c-format | 497 | #, c-format |
494 | msgid "setsockopt failed: %s\n" | 498 | msgid "setsockopt failed: %s\n" |
495 | msgstr "" | 499 | msgstr "" |
496 | 500 | ||
497 | #: src/microhttpd/daemon.c:5852 | 501 | #: src/microhttpd/daemon.c:5861 |
498 | msgid "Cannot allow listening address reuse: SO_REUSEPORT not defined\n" | 502 | msgid "Cannot allow listening address reuse: SO_REUSEPORT not defined\n" |
499 | msgstr "" | 503 | msgstr "" |
500 | 504 | ||
501 | #: src/microhttpd/daemon.c:5887 | 505 | #: src/microhttpd/daemon.c:5896 |
502 | msgid "" | 506 | msgid "" |
503 | "Cannot disallow listening address reuse: SO_EXCLUSIVEADDRUSE not defined\n" | 507 | "Cannot disallow listening address reuse: SO_EXCLUSIVEADDRUSE not defined\n" |
504 | msgstr "" | 508 | msgstr "" |
505 | 509 | ||
506 | #: src/microhttpd/daemon.c:5967 | 510 | #: src/microhttpd/daemon.c:5976 |
507 | #, c-format | 511 | #, c-format |
508 | msgid "Failed to bind to port %u: %s\n" | 512 | msgid "Failed to bind to port %u: %s\n" |
509 | msgstr "" | 513 | msgstr "" |
510 | 514 | ||
511 | #: src/microhttpd/daemon.c:5998 | 515 | #: src/microhttpd/daemon.c:6007 |
512 | #, c-format | 516 | #, c-format |
513 | msgid "Failed to listen for connections: %s\n" | 517 | msgid "Failed to listen for connections: %s\n" |
514 | msgstr "" | 518 | msgstr "" |
515 | 519 | ||
516 | #: src/microhttpd/daemon.c:6025 | 520 | #: src/microhttpd/daemon.c:6034 |
517 | #, c-format | 521 | #, c-format |
518 | msgid "Failed to get listen port number: %s\n" | 522 | msgid "Failed to get listen port number: %s\n" |
519 | msgstr "" | 523 | msgstr "" |
520 | 524 | ||
521 | #: src/microhttpd/daemon.c:6035 | 525 | #: src/microhttpd/daemon.c:6044 |
522 | msgid "" | 526 | msgid "" |
523 | "Failed to get listen port number (`struct sockaddr_storage` too small!?)\n" | 527 | "Failed to get listen port number (`struct sockaddr_storage` too small!?)\n" |
524 | msgstr "" | 528 | msgstr "" |
525 | 529 | ||
526 | #: src/microhttpd/daemon.c:6068 | 530 | #: src/microhttpd/daemon.c:6077 |
527 | msgid "Unknown address family!\n" | 531 | msgid "Unknown address family!\n" |
528 | msgstr "" | 532 | msgstr "" |
529 | 533 | ||
530 | #: src/microhttpd/daemon.c:6081 | 534 | #: src/microhttpd/daemon.c:6090 |
531 | #, c-format | 535 | #, c-format |
532 | msgid "Failed to set nonblocking mode on listening socket: %s\n" | 536 | msgid "Failed to set nonblocking mode on listening socket: %s\n" |
533 | msgstr "" | 537 | msgstr "" |
534 | 538 | ||
535 | #: src/microhttpd/daemon.c:6123 | 539 | #: src/microhttpd/daemon.c:6132 |
536 | msgid "" | 540 | msgid "" |
537 | "Combining MHD_USE_THREAD_PER_CONNECTION and MHD_USE_EPOLL is not supported.\n" | 541 | "Combining MHD_USE_THREAD_PER_CONNECTION and MHD_USE_EPOLL is not supported.\n" |
538 | msgstr "" | 542 | msgstr "" |
539 | 543 | ||
540 | #: src/microhttpd/daemon.c:6137 src/microhttpd/daemon.c:6150 | 544 | #: src/microhttpd/daemon.c:6146 src/microhttpd/daemon.c:6159 |
541 | msgid "MHD failed to initialize IP connection limit mutex\n" | 545 | msgid "MHD failed to initialize IP connection limit mutex\n" |
542 | msgstr "" | 546 | msgstr "" |
543 | 547 | ||
544 | #: src/microhttpd/daemon.c:6169 | 548 | #: src/microhttpd/daemon.c:6178 |
545 | msgid "Failed to initialize TLS support\n" | 549 | msgid "Failed to initialize TLS support\n" |
546 | msgstr "" | 550 | msgstr "" |
547 | 551 | ||
548 | #: src/microhttpd/daemon.c:6196 | 552 | #: src/microhttpd/daemon.c:6205 |
549 | #, c-format | 553 | #, c-format |
550 | msgid "Failed to create listen thread: %s\n" | 554 | msgid "Failed to create listen thread: %s\n" |
551 | msgstr "" | 555 | msgstr "" |
552 | 556 | ||
553 | #: src/microhttpd/daemon.c:6244 | 557 | #: src/microhttpd/daemon.c:6253 |
554 | #, c-format | 558 | #, c-format |
555 | msgid "Failed to create worker inter-thread communication channel: %s\n" | 559 | msgid "Failed to create worker inter-thread communication channel: %s\n" |
556 | msgstr "" | 560 | msgstr "" |
557 | 561 | ||
558 | #: src/microhttpd/daemon.c:6255 | 562 | #: src/microhttpd/daemon.c:6264 |
559 | msgid "" | 563 | msgid "" |
560 | "File descriptor for worker inter-thread communication channel exceeds " | 564 | "File descriptor for worker inter-thread communication channel exceeds " |
561 | "maximum value\n" | 565 | "maximum value\n" |
562 | msgstr "" | 566 | msgstr "" |
563 | 567 | ||
564 | #: src/microhttpd/daemon.c:6280 | 568 | #: src/microhttpd/daemon.c:6289 |
565 | msgid "MHD failed to initialize cleanup connection mutex\n" | 569 | msgid "MHD failed to initialize cleanup connection mutex\n" |
566 | msgstr "" | 570 | msgstr "" |
567 | 571 | ||
568 | #: src/microhttpd/daemon.c:6294 | 572 | #: src/microhttpd/daemon.c:6303 |
569 | #, c-format | 573 | #, c-format |
570 | msgid "Failed to create pool thread: %s\n" | 574 | msgid "Failed to create pool thread: %s\n" |
571 | msgstr "" | 575 | msgstr "" |
572 | 576 | ||
573 | #: src/microhttpd/daemon.c:6441 src/microhttpd/daemon.c:6472 | 577 | #: src/microhttpd/daemon.c:6456 src/microhttpd/daemon.c:6487 |
574 | msgid "MHD_stop_daemon() called while we have suspended connections.\n" | 578 | msgid "MHD_stop_daemon() called while we have suspended connections.\n" |
575 | msgstr "" | 579 | msgstr "" |
576 | 580 | ||
577 | #: src/microhttpd/daemon.c:6481 src/microhttpd/daemon.c:6610 | 581 | #: src/microhttpd/daemon.c:6496 src/microhttpd/daemon.c:6625 |
578 | msgid "Failed to signal shutdown via inter-thread communication channel" | 582 | msgid "Failed to signal shutdown via inter-thread communication channel" |
579 | msgstr "" | 583 | msgstr "" |
580 | 584 | ||
581 | #: src/microhttpd/daemon.c:6573 | 585 | #: src/microhttpd/daemon.c:6588 |
582 | msgid "Failed to signal shutdown via inter-thread communication channel." | 586 | msgid "Failed to signal shutdown via inter-thread communication channel." |
583 | msgstr "" | 587 | msgstr "" |
584 | 588 | ||
585 | #: src/microhttpd/daemon.c:7040 | 589 | #: src/microhttpd/daemon.c:7055 |
586 | msgid "Failed to initialize winsock\n" | 590 | msgid "Failed to initialize winsock\n" |
587 | msgstr "" | 591 | msgstr "" |
588 | 592 | ||
589 | #: src/microhttpd/daemon.c:7043 | 593 | #: src/microhttpd/daemon.c:7058 |
590 | msgid "Winsock version 2.2 is not available\n" | 594 | msgid "Winsock version 2.2 is not available\n" |
591 | msgstr "" | 595 | msgstr "" |
592 | 596 | ||
593 | #: src/microhttpd/daemon.c:7051 src/microhttpd/daemon.c:7055 | 597 | #: src/microhttpd/daemon.c:7066 src/microhttpd/daemon.c:7070 |
594 | msgid "Failed to initialise multithreading in libgcrypt\n" | 598 | msgid "Failed to initialise multithreading in libgcrypt\n" |
595 | msgstr "" | 599 | msgstr "" |
596 | 600 | ||
597 | #: src/microhttpd/daemon.c:7060 | 601 | #: src/microhttpd/daemon.c:7075 |
598 | msgid "libgcrypt is too old. MHD was compiled for libgcrypt 1.6.0 or newer\n" | 602 | msgid "libgcrypt is too old. MHD was compiled for libgcrypt 1.6.0 or newer\n" |
599 | msgstr "" | 603 | msgstr "" |
600 | 604 | ||
601 | #: src/microhttpd/mhd_sockets.h:248 | 605 | #: src/microhttpd/mhd_sockets.h:261 |
602 | msgid "Close socket failed.\n" | 606 | msgid "Close socket failed.\n" |
603 | msgstr "" | 607 | msgstr "" |
604 | 608 | ||
605 | #: src/microhttpd/connection.c:1117 | 609 | #: src/microhttpd/connection.c:1104 |
606 | msgid "Closing connection (application reported error generating data)\n" | 610 | msgid "Closing connection (application reported error generating data)\n" |
607 | msgstr "" | 611 | msgstr "" |
608 | 612 | ||
609 | #: src/microhttpd/connection.c:1170 | 613 | #: src/microhttpd/connection.c:1157 |
610 | msgid "Closing connection (out of memory)\n" | 614 | msgid "Closing connection (out of memory)\n" |
611 | msgstr "" | 615 | msgstr "" |
612 | 616 | ||
613 | #: src/microhttpd/connection.c:1217 | 617 | #: src/microhttpd/connection.c:1204 |
614 | msgid "Closing connection (application error generating response)\n" | 618 | msgid "Closing connection (application error generating response)\n" |
615 | msgstr "" | 619 | msgstr "" |
616 | 620 | ||
617 | #: src/microhttpd/connection.c:1799 | 621 | #: src/microhttpd/connection.c:1786 |
618 | #, c-format | 622 | #, c-format |
619 | msgid "" | 623 | msgid "" |
620 | "Error processing request (HTTP response code is %u (`%s')). Closing " | 624 | "Error processing request (HTTP response code is %u (`%s')). Closing " |
621 | "connection.\n" | 625 | "connection.\n" |
622 | msgstr "" | 626 | msgstr "" |
623 | 627 | ||
624 | #: src/microhttpd/connection.c:1825 src/microhttpd/connection.c:2810 | 628 | #: src/microhttpd/connection.c:1812 src/microhttpd/connection.c:2800 |
625 | msgid "Closing connection (failed to queue response)\n" | 629 | msgid "Closing connection (failed to queue response)\n" |
626 | msgstr "" | 630 | msgstr "" |
627 | 631 | ||
628 | #: src/microhttpd/connection.c:1835 src/microhttpd/connection.c:3579 | 632 | #: src/microhttpd/connection.c:1822 src/microhttpd/connection.c:3569 |
629 | #: src/microhttpd/connection.c:3702 | 633 | #: src/microhttpd/connection.c:3692 |
630 | msgid "Closing connection (failed to create response header)\n" | 634 | msgid "Closing connection (failed to create response header)\n" |
631 | msgstr "" | 635 | msgstr "" |
632 | 636 | ||
633 | #: src/microhttpd/connection.c:1881 src/microhttpd/connection.c:2960 | 637 | #: src/microhttpd/connection.c:1868 src/microhttpd/connection.c:2950 |
634 | #: src/microhttpd/connection.c:3028 src/microhttpd/connection.c:3344 | 638 | #: src/microhttpd/connection.c:3018 src/microhttpd/connection.c:3334 |
635 | #, c-format | 639 | #, c-format |
636 | msgid "In function %s handling connection at state: %s\n" | 640 | msgid "In function %s handling connection at state: %s\n" |
637 | msgstr "" | 641 | msgstr "" |
638 | 642 | ||
639 | #: src/microhttpd/connection.c:2093 | 643 | #: src/microhttpd/connection.c:2080 |
640 | msgid "Not enough memory in pool to allocate header record!\n" | 644 | msgid "Not enough memory in pool to allocate header record!\n" |
641 | msgstr "" | 645 | msgstr "" |
642 | 646 | ||
643 | #: src/microhttpd/connection.c:2135 | 647 | #: src/microhttpd/connection.c:2122 |
644 | msgid "Not enough memory in pool to parse cookies!\n" | 648 | msgid "Not enough memory in pool to parse cookies!\n" |
645 | msgstr "" | 649 | msgstr "" |
646 | 650 | ||
647 | #: src/microhttpd/connection.c:2356 src/microhttpd/connection.c:2541 | 651 | #: src/microhttpd/connection.c:2346 src/microhttpd/connection.c:2531 |
648 | msgid "Application reported internal error, closing connection.\n" | 652 | msgid "Application reported internal error, closing connection.\n" |
649 | msgstr "" | 653 | msgstr "" |
650 | 654 | ||
651 | #: src/microhttpd/connection.c:2409 src/microhttpd/connection.c:2486 | 655 | #: src/microhttpd/connection.c:2399 src/microhttpd/connection.c:2476 |
652 | msgid "" | 656 | msgid "" |
653 | "Received malformed HTTP request (bad chunked encoding). Closing connection.\n" | 657 | "Received malformed HTTP request (bad chunked encoding). Closing connection.\n" |
654 | msgstr "" | 658 | msgstr "" |
655 | 659 | ||
656 | #: src/microhttpd/connection.c:2549 | 660 | #: src/microhttpd/connection.c:2539 |
657 | msgid "libmicrohttpd API violation" | 661 | msgid "libmicrohttpd API violation" |
658 | msgstr "" | 662 | msgstr "" |
659 | 663 | ||
660 | #: src/microhttpd/connection.c:2564 | 664 | #: src/microhttpd/connection.c:2554 |
661 | msgid "" | 665 | msgid "" |
662 | "WARNING: incomplete upload processing and connection not suspended may " | 666 | "WARNING: incomplete upload processing and connection not suspended may " |
663 | "result in hung connection.\n" | 667 | "result in hung connection.\n" |
664 | msgstr "" | 668 | msgstr "" |
665 | 669 | ||
666 | #: src/microhttpd/connection.c:2634 | 670 | #: src/microhttpd/connection.c:2624 |
667 | msgid "Received malformed line (no colon). Closing connection.\n" | 671 | msgid "Received malformed line (no colon). Closing connection.\n" |
668 | msgstr "" | 672 | msgstr "" |
669 | 673 | ||
670 | #: src/microhttpd/connection.c:2788 | 674 | #: src/microhttpd/connection.c:2778 |
671 | msgid "Received HTTP 1.1 request without `Host' header.\n" | 675 | msgid "Received HTTP 1.1 request without `Host' header.\n" |
672 | msgstr "" | 676 | msgstr "" |
673 | 677 | ||
674 | #: src/microhttpd/connection.c:2799 | 678 | #: src/microhttpd/connection.c:2789 |
675 | msgid "Closing connection (failed to create response)\n" | 679 | msgid "Closing connection (failed to create response)\n" |
676 | msgstr "" | 680 | msgstr "" |
677 | 681 | ||
678 | #: src/microhttpd/connection.c:2939 | 682 | #: src/microhttpd/connection.c:2929 |
679 | msgid "Socket disconnected while reading request.\n" | 683 | msgid "Socket disconnected while reading request.\n" |
680 | msgstr "" | 684 | msgstr "" |
681 | 685 | ||
682 | #: src/microhttpd/connection.c:2945 | 686 | #: src/microhttpd/connection.c:2935 |
683 | msgid "Connection socket is closed due to error when reading request.\n" | 687 | msgid "Connection socket is closed due to error when reading request.\n" |
684 | msgstr "" | 688 | msgstr "" |
685 | 689 | ||
686 | #: src/microhttpd/connection.c:3054 | 690 | #: src/microhttpd/connection.c:3044 |
687 | #, c-format | 691 | #, c-format |
688 | msgid "Failed to send data in request for %s.\n" | 692 | msgid "Failed to send data in request for %s.\n" |
689 | msgstr "" | 693 | msgstr "" |
690 | 694 | ||
691 | #: src/microhttpd/connection.c:3063 | 695 | #: src/microhttpd/connection.c:3053 |
692 | #, c-format | 696 | #, c-format |
693 | msgid "Sent 100 continue response: `%.*s'\n" | 697 | msgid "Sent 100 continue response: `%.*s'\n" |
694 | msgstr "" | 698 | msgstr "" |
695 | 699 | ||
696 | #: src/microhttpd/connection.c:3087 | 700 | #: src/microhttpd/connection.c:3077 |
697 | msgid "Connection was closed while sending response headers.\n" | 701 | msgid "Connection was closed while sending response headers.\n" |
698 | msgstr "" | 702 | msgstr "" |
699 | 703 | ||
700 | #: src/microhttpd/connection.c:3128 | 704 | #: src/microhttpd/connection.c:3118 |
701 | msgid "Data offset exceeds limit" | 705 | msgid "Data offset exceeds limit" |
702 | msgstr "" | 706 | msgstr "" |
703 | 707 | ||
704 | #: src/microhttpd/connection.c:3137 | 708 | #: src/microhttpd/connection.c:3127 |
705 | #, c-format | 709 | #, c-format |
706 | msgid "Sent %d-byte DATA response: `%.*s'\n" | 710 | msgid "Sent %d-byte DATA response: `%.*s'\n" |
707 | msgstr "" | 711 | msgstr "" |
708 | 712 | ||
709 | #: src/microhttpd/connection.c:3154 | 713 | #: src/microhttpd/connection.c:3144 |
710 | #, c-format | 714 | #, c-format |
711 | msgid "Failed to send data in request for `%s'.\n" | 715 | msgid "Failed to send data in request for `%s'.\n" |
712 | msgstr "" | 716 | msgstr "" |
713 | 717 | ||
714 | #: src/microhttpd/connection.c:3182 src/microhttpd/connection.c:3210 | 718 | #: src/microhttpd/connection.c:3172 src/microhttpd/connection.c:3200 |
715 | msgid "Connection was closed while sending response body.\n" | 719 | msgid "Connection was closed while sending response body.\n" |
716 | msgstr "" | 720 | msgstr "" |
717 | 721 | ||
718 | #: src/microhttpd/connection.c:3233 | 722 | #: src/microhttpd/connection.c:3223 |
719 | msgid "Internal error\n" | 723 | msgid "Internal error\n" |
720 | msgstr "" | 724 | msgstr "" |
721 | 725 | ||
722 | #: src/microhttpd/connection.c:3306 | 726 | #: src/microhttpd/connection.c:3296 |
723 | msgid "" | 727 | msgid "" |
724 | "Failed to signal end of connection via inter-thread communication channel" | 728 | "Failed to signal end of connection via inter-thread communication channel" |
725 | msgstr "" | 729 | msgstr "" |
726 | 730 | ||
727 | #: src/microhttpd/connection.c:4053 | 731 | #: src/microhttpd/connection.c:4043 |
728 | msgid "Attempted to queue response on wrong thread!\n" | 732 | msgid "Attempted to queue response on wrong thread!\n" |
729 | msgstr "" | 733 | msgstr "" |
730 | 734 | ||
731 | #: src/microhttpd/connection.c:4064 | 735 | #: src/microhttpd/connection.c:4054 |
732 | msgid "" | 736 | msgid "" |
733 | "Attempted 'upgrade' connection on daemon without MHD_ALLOW_UPGRADE option!\n" | 737 | "Attempted 'upgrade' connection on daemon without MHD_ALLOW_UPGRADE option!\n" |
734 | msgstr "" | 738 | msgstr "" |
735 | 739 | ||
736 | #: src/microhttpd/connection.c:4073 | 740 | #: src/microhttpd/connection.c:4063 |
737 | msgid "Application used invalid status code for 'upgrade' response!\n" | 741 | msgid "Application used invalid status code for 'upgrade' response!\n" |
738 | msgstr "" | 742 | msgstr "" |
739 | 743 | ||
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am index ce01107a..f934d6ad 100644 --- a/src/examples/Makefile.am +++ b/src/examples/Makefile.am | |||
@@ -70,7 +70,8 @@ endif | |||
70 | 70 | ||
71 | if HAVE_ZLIB | 71 | if HAVE_ZLIB |
72 | noinst_PROGRAMS += \ | 72 | noinst_PROGRAMS += \ |
73 | http_compression | 73 | http_compression \ |
74 | http_chunked_compression | ||
74 | endif | 75 | endif |
75 | 76 | ||
76 | if HAVE_W32 | 77 | if HAVE_W32 |
@@ -206,8 +207,13 @@ https_fileserver_example_LDADD = \ | |||
206 | 207 | ||
207 | http_compression_SOURCES = \ | 208 | http_compression_SOURCES = \ |
208 | http_compression.c | 209 | http_compression.c |
210 | http_chunked_compression_SOURCES = \ | ||
211 | http_chunked_compression.c | ||
209 | http_compression_LDADD = \ | 212 | http_compression_LDADD = \ |
210 | $(top_builddir)/src/microhttpd/libmicrohttpd.la | 213 | $(top_builddir)/src/microhttpd/libmicrohttpd.la |
214 | http_chunked_compression_LDADD = \ | ||
215 | $(top_builddir)/src/microhttpd/libmicrohttpd.la | ||
211 | if HAVE_ZLIB | 216 | if HAVE_ZLIB |
212 | http_compression_LDADD += -lz | 217 | http_compression_LDADD += -lz |
218 | http_chunked_compression_LDADD += -lz | ||
213 | endif \ No newline at end of file | 219 | endif \ No newline at end of file |
diff --git a/src/examples/http_chunked_compression.c b/src/examples/http_chunked_compression.c new file mode 100644 index 00000000..167771fa --- /dev/null +++ b/src/examples/http_chunked_compression.c | |||
@@ -0,0 +1,199 @@ | |||
1 | /* | ||
2 | This file is part of libmicrohttpd | ||
3 | Copyright (C) 2019 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | This library is free software; you can redistribute it and/or | ||
6 | modify it under the terms of the GNU Lesser General Public | ||
7 | License as published by the Free Software Foundation; either | ||
8 | version 2.1 of the License, or (at your option) any later version. | ||
9 | |||
10 | This library is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Lesser General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Lesser General Public | ||
16 | License along with this library; if not, write to the Free Software | ||
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | */ | ||
19 | /** | ||
20 | * @file http_chunked_compression.c | ||
21 | * @brief example for how to compress a chunked HTTP response | ||
22 | * @author Silvio Clecio (silvioprog) | ||
23 | */ | ||
24 | |||
25 | #include "platform.h" | ||
26 | #include <zlib.h> | ||
27 | #include <microhttpd.h> | ||
28 | |||
29 | #define CHUNK 16384 | ||
30 | |||
31 | struct Holder { | ||
32 | FILE *file; | ||
33 | z_stream stream; | ||
34 | void *buf; | ||
35 | }; | ||
36 | |||
37 | static int | ||
38 | compress_buf (z_stream *strm, const void *src, size_t src_size, size_t *offset, void **dest, size_t *dest_size, | ||
39 | void *tmp) | ||
40 | { | ||
41 | unsigned int have; | ||
42 | int ret; | ||
43 | int flush; | ||
44 | *dest = NULL; | ||
45 | *dest_size = 0; | ||
46 | do | ||
47 | { | ||
48 | if (src_size > CHUNK) | ||
49 | { | ||
50 | strm->avail_in = CHUNK; | ||
51 | src_size -= CHUNK; | ||
52 | flush = Z_NO_FLUSH; | ||
53 | } | ||
54 | else | ||
55 | { | ||
56 | strm->avail_in = (uInt) src_size; | ||
57 | flush = Z_SYNC_FLUSH; | ||
58 | } | ||
59 | *offset += strm->avail_in; | ||
60 | strm->next_in = (Bytef *) src; | ||
61 | do | ||
62 | { | ||
63 | strm->avail_out = CHUNK; | ||
64 | strm->next_out = tmp; | ||
65 | ret = deflate (strm, flush); | ||
66 | have = CHUNK - strm->avail_out; | ||
67 | *dest_size += have; | ||
68 | *dest = realloc (*dest, *dest_size); | ||
69 | if (NULL == *dest) | ||
70 | return MHD_NO; | ||
71 | memcpy ((*dest) + ((*dest_size) - have), tmp, have); | ||
72 | } | ||
73 | while (0 == strm->avail_out); | ||
74 | } | ||
75 | while (flush != Z_SYNC_FLUSH); | ||
76 | return (Z_OK == ret) ? MHD_YES : MHD_NO; | ||
77 | } | ||
78 | |||
79 | static ssize_t | ||
80 | read_cb (void *cls, uint64_t pos, char *mem, size_t size) | ||
81 | { | ||
82 | struct Holder *holder = cls; | ||
83 | void *src; | ||
84 | void *buf; | ||
85 | src = malloc (size); | ||
86 | if (NULL == src) | ||
87 | return MHD_CONTENT_READER_END_WITH_ERROR; | ||
88 | size = fread (src, 1, size, holder->file); | ||
89 | if (size < 0) | ||
90 | { | ||
91 | size = MHD_CONTENT_READER_END_WITH_ERROR; | ||
92 | goto done; | ||
93 | } | ||
94 | if (0 == size) | ||
95 | { | ||
96 | size = MHD_CONTENT_READER_END_OF_STREAM; | ||
97 | goto done; | ||
98 | } | ||
99 | if (MHD_YES != compress_buf (&holder->stream, src, size, &pos, &buf, &size, holder->buf)) | ||
100 | size = MHD_CONTENT_READER_END_WITH_ERROR; | ||
101 | else | ||
102 | { | ||
103 | memcpy (mem, buf, size); | ||
104 | free (buf); | ||
105 | } | ||
106 | done: | ||
107 | free (src); | ||
108 | return size; | ||
109 | } | ||
110 | |||
111 | static void | ||
112 | free_cb (void *cls) | ||
113 | { | ||
114 | struct Holder *holder = cls; | ||
115 | fclose (holder->file); | ||
116 | deflateEnd (&holder->stream); | ||
117 | free (holder->buf); | ||
118 | free (holder); | ||
119 | } | ||
120 | |||
121 | static int | ||
122 | ahc_echo (void *cls, struct MHD_Connection *con, const char *url, const char *method, const char *version, | ||
123 | const char *upload_data, size_t *upload_size, void **ptr) | ||
124 | { | ||
125 | struct Holder *holder; | ||
126 | struct MHD_Response *res; | ||
127 | int ret; | ||
128 | (void) cls; | ||
129 | (void) url; | ||
130 | (void) method; | ||
131 | (void) version; | ||
132 | (void) upload_data; | ||
133 | (void) upload_size; | ||
134 | if (NULL == *ptr) | ||
135 | { | ||
136 | *ptr = (void *) 1; | ||
137 | return MHD_YES; | ||
138 | } | ||
139 | *ptr = NULL; | ||
140 | holder = calloc (1, sizeof (struct Holder)); | ||
141 | if (!holder) | ||
142 | return MHD_NO; | ||
143 | holder->file = fopen (__FILE__, "rb"); | ||
144 | if (NULL == holder->file) | ||
145 | goto file_error; | ||
146 | ret = deflateInit(&holder->stream, Z_BEST_COMPRESSION); | ||
147 | if (ret != Z_OK) | ||
148 | goto stream_error; | ||
149 | holder->buf = malloc (CHUNK); | ||
150 | if (NULL == holder->buf) | ||
151 | goto buf_error; | ||
152 | res = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, 1024, &read_cb, holder, &free_cb); | ||
153 | if (NULL == res) | ||
154 | goto error; | ||
155 | ret = MHD_add_response_header (res, MHD_HTTP_HEADER_CONTENT_ENCODING, "deflate"); | ||
156 | if (MHD_YES != ret) | ||
157 | goto res_error; | ||
158 | ret = MHD_add_response_header (res, MHD_HTTP_HEADER_CONTENT_TYPE, "text/x-c"); | ||
159 | if (MHD_YES != ret) | ||
160 | goto res_error; | ||
161 | ret = MHD_queue_response (con, MHD_HTTP_OK, res); | ||
162 | res_error: | ||
163 | MHD_destroy_response (res); | ||
164 | return ret; | ||
165 | error: | ||
166 | free (holder->buf); | ||
167 | buf_error: | ||
168 | deflateEnd (&holder->stream); | ||
169 | stream_error: | ||
170 | fclose (holder->file); | ||
171 | file_error: | ||
172 | free (holder); | ||
173 | return MHD_NO; | ||
174 | } | ||
175 | |||
176 | int | ||
177 | main (int argc, char *const *argv) | ||
178 | { | ||
179 | struct MHD_Daemon *d; | ||
180 | unsigned int port; | ||
181 | if ((argc != 2) || | ||
182 | (1 != sscanf (argv[1], "%u", &port)) || | ||
183 | (UINT16_MAX < port)) | ||
184 | { | ||
185 | fprintf (stderr, "%s PORT\n", argv[0]); | ||
186 | return 1; | ||
187 | } | ||
188 | d = MHD_start_daemon (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD, (uint16_t) port, NULL, NULL, | ||
189 | &ahc_echo, NULL, | ||
190 | MHD_OPTION_END); | ||
191 | if (NULL == d) | ||
192 | return 1; | ||
193 | if (0 == port) | ||
194 | MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT, &port); | ||
195 | fprintf (stdout, "HTTP server running at http://localhost:%u\n\nPress ENTER to stop the server ...\n", port); | ||
196 | (void) getc (stdin); | ||
197 | MHD_stop_daemon (d); | ||
198 | return 0; | ||
199 | } | ||
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index f654d1d7..4917f62b 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libmicrohttpd | 2 | This file is part of libmicrohttpd |
3 | Copyright (C) 2006-2018 Christian Grothoff (and other contributing authors) | 3 | Copyright (C) 2006--2019 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Lesser General Public | 6 | modify it under the terms of the GNU Lesser General Public |
@@ -126,7 +126,7 @@ typedef intptr_t ssize_t; | |||
126 | * Current version of the library. | 126 | * Current version of the library. |
127 | * 0x01093001 = 1.9.30-1. | 127 | * 0x01093001 = 1.9.30-1. |
128 | */ | 128 | */ |
129 | #define MHD_VERSION 0x00096203 | 129 | #define MHD_VERSION 0x00096301 |
130 | 130 | ||
131 | /** | 131 | /** |
132 | * MHD-internal return code for "YES". | 132 | * MHD-internal return code for "YES". |
@@ -1380,10 +1380,12 @@ enum MHD_OPTION | |||
1380 | * struct MHD_Connection *c, | 1380 | * struct MHD_Connection *c, |
1381 | * char *s) | 1381 | * char *s) |
1382 | * | 1382 | * |
1383 | * where the return value must be "strlen(s)" and "s" should be | 1383 | * where the return value must be the length of the value left in |
1384 | * updated. Note that the unescape function must not lengthen "s" | 1384 | * "s" (without the 0-terminator) and "s" should be updated. Note |
1385 | * (the result must be shorter than the input and still be | 1385 | * that the unescape function must not lengthen "s" (the result must |
1386 | * 0-terminated). "cls" will be set to the second argument | 1386 | * be shorter than the input and must still be 0-terminated). |
1387 | * However, it may also include binary zeros before the | ||
1388 | * 0-termination. "cls" will be set to the second argument | ||
1387 | * following #MHD_OPTION_UNESCAPE_CALLBACK. | 1389 | * following #MHD_OPTION_UNESCAPE_CALLBACK. |
1388 | */ | 1390 | */ |
1389 | MHD_OPTION_UNESCAPE_CALLBACK = 16, | 1391 | MHD_OPTION_UNESCAPE_CALLBACK = 16, |
@@ -2025,6 +2027,8 @@ typedef void | |||
2025 | * @param kind kind of the header we are looking at | 2027 | * @param kind kind of the header we are looking at |
2026 | * @param key key for the value, can be an empty string | 2028 | * @param key key for the value, can be an empty string |
2027 | * @param value corresponding value, can be NULL | 2029 | * @param value corresponding value, can be NULL |
2030 | * @param value_size number of bytes in @a value, NEW since #MHD_VERSION 0x00096301; | ||
2031 | * for C-strings, the length excludes the 0-terminator | ||
2028 | * @return #MHD_YES to continue iterating, | 2032 | * @return #MHD_YES to continue iterating, |
2029 | * #MHD_NO to abort the iteration | 2033 | * #MHD_NO to abort the iteration |
2030 | * @ingroup request | 2034 | * @ingroup request |
@@ -2033,7 +2037,8 @@ typedef int | |||
2033 | (*MHD_KeyValueIterator) (void *cls, | 2037 | (*MHD_KeyValueIterator) (void *cls, |
2034 | enum MHD_ValueKind kind, | 2038 | enum MHD_ValueKind kind, |
2035 | const char *key, | 2039 | const char *key, |
2036 | const char *value); | 2040 | const char *value, |
2041 | size_t value_size); | ||
2037 | 2042 | ||
2038 | 2043 | ||
2039 | /** | 2044 | /** |
@@ -2494,6 +2499,40 @@ MHD_set_connection_value (struct MHD_Connection *connection, | |||
2494 | 2499 | ||
2495 | 2500 | ||
2496 | /** | 2501 | /** |
2502 | * This function can be used to add an entry to the HTTP headers of a | ||
2503 | * connection (so that the #MHD_get_connection_values function will | ||
2504 | * return them -- and the `struct MHD_PostProcessor` will also see | ||
2505 | * them). This maybe required in certain situations (see Mantis | ||
2506 | * #1399) where (broken) HTTP implementations fail to supply values | ||
2507 | * needed by the post processor (or other parts of the application). | ||
2508 | * | ||
2509 | * This function MUST only be called from within the | ||
2510 | * #MHD_AccessHandlerCallback (otherwise, access maybe improperly | ||
2511 | * synchronized). Furthermore, the client must guarantee that the key | ||
2512 | * and value arguments are 0-terminated strings that are NOT freed | ||
2513 | * until the connection is closed. (The easiest way to do this is by | ||
2514 | * passing only arguments to permanently allocated strings.). | ||
2515 | * | ||
2516 | * @param connection the connection for which a | ||
2517 | * value should be set | ||
2518 | * @param kind kind of the value | ||
2519 | * @param key key for the value | ||
2520 | * @param value the value itself | ||
2521 | * @param value_size number of bytes in @a value (excluding 0-terminator for C-strings) | ||
2522 | * @return #MHD_NO if the operation could not be | ||
2523 | * performed due to insufficient memory; | ||
2524 | * #MHD_YES on success | ||
2525 | * @ingroup request | ||
2526 | */ | ||
2527 | int | ||
2528 | MHD_set_connection_value2 (struct MHD_Connection *connection, | ||
2529 | enum MHD_ValueKind kind, | ||
2530 | const char *key, | ||
2531 | const char *value, | ||
2532 | size_t value_size); | ||
2533 | |||
2534 | |||
2535 | /** | ||
2497 | * Sets the global error handler to a different implementation. @a cb | 2536 | * Sets the global error handler to a different implementation. @a cb |
2498 | * will only be called in the case of typically fatal, serious | 2537 | * will only be called in the case of typically fatal, serious |
2499 | * internal consistency issues. These issues should only arise in the | 2538 | * internal consistency issues. These issues should only arise in the |
@@ -3075,7 +3114,8 @@ MHD_del_response_header (struct MHD_Response *response, | |||
3075 | */ | 3114 | */ |
3076 | _MHD_EXTERN int | 3115 | _MHD_EXTERN int |
3077 | MHD_get_response_headers (struct MHD_Response *response, | 3116 | MHD_get_response_headers (struct MHD_Response *response, |
3078 | MHD_KeyValueIterator iterator, void *iterator_cls); | 3117 | MHD_KeyValueIterator iterator, |
3118 | void *iterator_cls); | ||
3079 | 3119 | ||
3080 | 3120 | ||
3081 | /** | 3121 | /** |
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index e06ae993..4fe66805 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libmicrohttpd | 2 | This file is part of libmicrohttpd |
3 | Copyright (C) 2007-2017 Daniel Pittman and Christian Grothoff | 3 | Copyright (C) 2007-2019 Daniel Pittman and Christian Grothoff |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Lesser General Public | 6 | modify it under the terms of the GNU Lesser General Public |
@@ -706,7 +706,8 @@ MHD_get_connection_values (struct MHD_Connection *connection, | |||
706 | (MHD_YES != iterator (iterator_cls, | 706 | (MHD_YES != iterator (iterator_cls, |
707 | pos->kind, | 707 | pos->kind, |
708 | pos->header, | 708 | pos->header, |
709 | pos->value)) ) | 709 | pos->value, |
710 | pos->value_size)) ) | ||
710 | return ret; | 711 | return ret; |
711 | } | 712 | } |
712 | return ret; | 713 | return ret; |
@@ -733,16 +734,18 @@ MHD_get_connection_values (struct MHD_Connection *connection, | |||
733 | * @param kind kind of the value | 734 | * @param kind kind of the value |
734 | * @param key key for the value | 735 | * @param key key for the value |
735 | * @param value the value itself | 736 | * @param value the value itself |
737 | * @param value_size number of bytes in @a value | ||
736 | * @return #MHD_NO if the operation could not be | 738 | * @return #MHD_NO if the operation could not be |
737 | * performed due to insufficient memory; | 739 | * performed due to insufficient memory; |
738 | * #MHD_YES on success | 740 | * #MHD_YES on success |
739 | * @ingroup request | 741 | * @ingroup request |
740 | */ | 742 | */ |
741 | int | 743 | int |
742 | MHD_set_connection_value (struct MHD_Connection *connection, | 744 | MHD_set_connection_value2 (struct MHD_Connection *connection, |
743 | enum MHD_ValueKind kind, | 745 | enum MHD_ValueKind kind, |
744 | const char *key, | 746 | const char *key, |
745 | const char *value) | 747 | const char *value, |
748 | size_t value_size) | ||
746 | { | 749 | { |
747 | struct MHD_HTTP_Header *pos; | 750 | struct MHD_HTTP_Header *pos; |
748 | 751 | ||
@@ -753,6 +756,7 @@ MHD_set_connection_value (struct MHD_Connection *connection, | |||
753 | return MHD_NO; | 756 | return MHD_NO; |
754 | pos->header = (char *) key; | 757 | pos->header = (char *) key; |
755 | pos->value = (char *) value; | 758 | pos->value = (char *) value; |
759 | pos->value_size = value_size; | ||
756 | pos->kind = kind; | 760 | pos->kind = kind; |
757 | pos->next = NULL; | 761 | pos->next = NULL; |
758 | /* append 'pos' to the linked list of headers */ | 762 | /* append 'pos' to the linked list of headers */ |
@@ -771,6 +775,47 @@ MHD_set_connection_value (struct MHD_Connection *connection, | |||
771 | 775 | ||
772 | 776 | ||
773 | /** | 777 | /** |
778 | * This function can be used to add an entry to the HTTP headers of a | ||
779 | * connection (so that the #MHD_get_connection_values function will | ||
780 | * return them -- and the `struct MHD_PostProcessor` will also see | ||
781 | * them). This maybe required in certain situations (see Mantis | ||
782 | * #1399) where (broken) HTTP implementations fail to supply values | ||
783 | * needed by the post processor (or other parts of the application). | ||
784 | * | ||
785 | * This function MUST only be called from within the | ||
786 | * #MHD_AccessHandlerCallback (otherwise, access maybe improperly | ||
787 | * synchronized). Furthermore, the client must guarantee that the key | ||
788 | * and value arguments are 0-terminated strings that are NOT freed | ||
789 | * until the connection is closed. (The easiest way to do this is by | ||
790 | * passing only arguments to permanently allocated strings.). | ||
791 | * | ||
792 | * @param connection the connection for which a | ||
793 | * value should be set | ||
794 | * @param kind kind of the value | ||
795 | * @param key key for the value | ||
796 | * @param value the value itself | ||
797 | * @return #MHD_NO if the operation could not be | ||
798 | * performed due to insufficient memory; | ||
799 | * #MHD_YES on success | ||
800 | * @ingroup request | ||
801 | */ | ||
802 | int | ||
803 | MHD_set_connection_value (struct MHD_Connection *connection, | ||
804 | enum MHD_ValueKind kind, | ||
805 | const char *key, | ||
806 | const char *value) | ||
807 | { | ||
808 | return MHD_set_connection_value2 (connection, | ||
809 | kind, | ||
810 | key, | ||
811 | value, | ||
812 | NULL != value | ||
813 | ? strlen (value) | ||
814 | : 0); | ||
815 | } | ||
816 | |||
817 | |||
818 | /** | ||
774 | * Get a particular header value. If multiple | 819 | * Get a particular header value. If multiple |
775 | * values match the kind, return any one of them. | 820 | * values match the kind, return any one of them. |
776 | * | 821 | * |
@@ -2061,19 +2106,22 @@ get_next_header_line (struct MHD_Connection *connection, | |||
2061 | * @param kind kind of the value | 2106 | * @param kind kind of the value |
2062 | * @param key key for the value | 2107 | * @param key key for the value |
2063 | * @param value the value itself | 2108 | * @param value the value itself |
2109 | * @param value_size number of bytes in @a value | ||
2064 | * @return #MHD_NO on failure (out of memory), #MHD_YES for success | 2110 | * @return #MHD_NO on failure (out of memory), #MHD_YES for success |
2065 | */ | 2111 | */ |
2066 | static int | 2112 | static int |
2067 | connection_add_header (struct MHD_Connection *connection, | 2113 | connection_add_header (struct MHD_Connection *connection, |
2068 | const char *key, | 2114 | const char *key, |
2069 | const char *value, | 2115 | const char *value, |
2116 | size_t value_size, | ||
2070 | enum MHD_ValueKind kind) | 2117 | enum MHD_ValueKind kind) |
2071 | { | 2118 | { |
2072 | if (MHD_NO == | 2119 | if (MHD_NO == |
2073 | MHD_set_connection_value (connection, | 2120 | MHD_set_connection_value2 (connection, |
2074 | kind, | 2121 | kind, |
2075 | key, | 2122 | key, |
2076 | value)) | 2123 | value, |
2124 | value_size)) | ||
2077 | { | 2125 | { |
2078 | #ifdef HAVE_MESSAGES | 2126 | #ifdef HAVE_MESSAGES |
2079 | MHD_DLOG (connection->daemon, | 2127 | MHD_DLOG (connection->daemon, |
@@ -2104,6 +2152,7 @@ parse_cookie_header (struct MHD_Connection *connection) | |||
2104 | char *semicolon; | 2152 | char *semicolon; |
2105 | char *equals; | 2153 | char *equals; |
2106 | char *ekill; | 2154 | char *ekill; |
2155 | char *end; | ||
2107 | char old; | 2156 | char old; |
2108 | int quotes; | 2157 | int quotes; |
2109 | 2158 | ||
@@ -2155,6 +2204,7 @@ parse_cookie_header (struct MHD_Connection *connection) | |||
2155 | connection_add_header (connection, | 2204 | connection_add_header (connection, |
2156 | pos, | 2205 | pos, |
2157 | "", | 2206 | "", |
2207 | 0, | ||
2158 | MHD_COOKIE_KIND)) | 2208 | MHD_COOKIE_KIND)) |
2159 | return MHD_NO; | 2209 | return MHD_NO; |
2160 | if (old == '\0') | 2210 | if (old == '\0') |
@@ -2174,6 +2224,7 @@ parse_cookie_header (struct MHD_Connection *connection) | |||
2174 | quotes = (quotes + 1) & 1; | 2224 | quotes = (quotes + 1) & 1; |
2175 | semicolon++; | 2225 | semicolon++; |
2176 | } | 2226 | } |
2227 | end = semicolon; | ||
2177 | if ('\0' == semicolon[0]) | 2228 | if ('\0' == semicolon[0]) |
2178 | semicolon = NULL; | 2229 | semicolon = NULL; |
2179 | if (NULL != semicolon) | 2230 | if (NULL != semicolon) |
@@ -2183,15 +2234,17 @@ parse_cookie_header (struct MHD_Connection *connection) | |||
2183 | } | 2234 | } |
2184 | /* remove quotes */ | 2235 | /* remove quotes */ |
2185 | if ( ('"' == equals[0]) && | 2236 | if ( ('"' == equals[0]) && |
2186 | ('"' == equals[strlen (equals) - 1]) ) | 2237 | ('"' == end[-1]) ) |
2187 | { | 2238 | { |
2188 | equals[strlen (equals) - 1] = '\0'; | ||
2189 | equals++; | 2239 | equals++; |
2240 | end--; | ||
2241 | *end = '\0'; | ||
2190 | } | 2242 | } |
2191 | if (MHD_NO == | 2243 | if (MHD_NO == |
2192 | connection_add_header (connection, | 2244 | connection_add_header (connection, |
2193 | pos, | 2245 | pos, |
2194 | equals, | 2246 | equals, |
2247 | end - equals, | ||
2195 | MHD_COOKIE_KIND)) | 2248 | MHD_COOKIE_KIND)) |
2196 | return MHD_NO; | 2249 | return MHD_NO; |
2197 | pos = semicolon; | 2250 | pos = semicolon; |
@@ -2257,7 +2310,7 @@ parse_initial_message_line (struct MHD_Connection *connection, | |||
2257 | http_version--; | 2310 | http_version--; |
2258 | if (http_version > uri) | 2311 | if (http_version > uri) |
2259 | { | 2312 | { |
2260 | /* http_version points to string before HTTP version string */ | 2313 | /* http_version points to character before HTTP version string */ |
2261 | http_version[0] = '\0'; | 2314 | http_version[0] = '\0'; |
2262 | connection->version = http_version + 1; | 2315 | connection->version = http_version + 1; |
2263 | uri_len = http_version - uri; | 2316 | uri_len = http_version - uri; |
@@ -2277,24 +2330,21 @@ parse_initial_message_line (struct MHD_Connection *connection, | |||
2277 | return MHD_NO; | 2330 | return MHD_NO; |
2278 | } | 2331 | } |
2279 | 2332 | ||
2280 | /* unescape URI before searching for arguments */ | ||
2281 | daemon->unescape_callback (daemon->unescape_callback_cls, | ||
2282 | connection, | ||
2283 | uri); | ||
2284 | uri_len = strlen (uri); /* recalculate: may have changed! */ | ||
2285 | args = memchr (uri, | 2333 | args = memchr (uri, |
2286 | '?', | 2334 | '?', |
2287 | uri_len); | 2335 | uri_len); |
2288 | } | 2336 | } |
2289 | 2337 | ||
2338 | /* log callback before we modify URI *or* args */ | ||
2290 | if (NULL != daemon->uri_log_callback) | 2339 | if (NULL != daemon->uri_log_callback) |
2291 | { | 2340 | { |
2292 | connection->client_aware = true; | 2341 | connection->client_aware = true; |
2293 | connection->client_context | 2342 | connection->client_context |
2294 | = daemon->uri_log_callback (daemon->uri_log_callback_cls, | 2343 | = daemon->uri_log_callback (daemon->uri_log_callback_cls, |
2295 | curi, | 2344 | uri, |
2296 | connection); | 2345 | connection); |
2297 | } | 2346 | } |
2347 | |||
2298 | if (NULL != args) | 2348 | if (NULL != args) |
2299 | { | 2349 | { |
2300 | args[0] = '\0'; | 2350 | args[0] = '\0'; |
@@ -2306,6 +2356,12 @@ parse_initial_message_line (struct MHD_Connection *connection, | |||
2306 | &connection_add_header, | 2356 | &connection_add_header, |
2307 | &unused_num_headers); | 2357 | &unused_num_headers); |
2308 | } | 2358 | } |
2359 | |||
2360 | /* unescape URI *after* searching for arguments and log callback */ | ||
2361 | if (NULL != uri) | ||
2362 | daemon->unescape_callback (daemon->unescape_callback_cls, | ||
2363 | connection, | ||
2364 | uri); | ||
2309 | connection->url = curi; | 2365 | connection->url = curi; |
2310 | return MHD_YES; | 2366 | return MHD_YES; |
2311 | } | 2367 | } |
@@ -2708,16 +2764,20 @@ process_broken_line (struct MHD_Connection *connection, | |||
2708 | REQUEST_TOO_BIG); | 2764 | REQUEST_TOO_BIG); |
2709 | return MHD_NO; | 2765 | return MHD_NO; |
2710 | } | 2766 | } |
2711 | memcpy (&last[last_len], tmp, tmp_len + 1); | 2767 | memcpy (&last[last_len], |
2768 | tmp, | ||
2769 | tmp_len + 1); | ||
2712 | connection->last = last; | 2770 | connection->last = last; |
2713 | return MHD_YES; /* possibly more than 2 lines... */ | 2771 | return MHD_YES; /* possibly more than 2 lines... */ |
2714 | } | 2772 | } |
2715 | mhd_assert ( (NULL != last) && | 2773 | mhd_assert ( (NULL != last) && |
2716 | (NULL != connection->colon) ); | 2774 | (NULL != connection->colon) ); |
2717 | if ((MHD_NO == connection_add_header (connection, | 2775 | if (MHD_NO == |
2718 | last, | 2776 | connection_add_header (connection, |
2719 | connection->colon, | 2777 | last, |
2720 | kind))) | 2778 | connection->colon, |
2779 | strlen (connection->colon), | ||
2780 | kind)) | ||
2721 | { | 2781 | { |
2722 | transmit_error_response (connection, | 2782 | transmit_error_response (connection, |
2723 | MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE, | 2783 | MHD_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE, |
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c index d4e23fef..8f04bf38 100644 --- a/src/microhttpd/digestauth.c +++ b/src/microhttpd/digestauth.c | |||
@@ -732,6 +732,7 @@ calculate_nonce (uint32_t nonce_time, | |||
732 | * @param connection the connection | 732 | * @param connection the connection |
733 | * @param key the key | 733 | * @param key the key |
734 | * @param value the value, can be NULL | 734 | * @param value the value, can be NULL |
735 | * @param value_size number of bytes in @a value | ||
735 | * @param kind type of the header | 736 | * @param kind type of the header |
736 | * @return #MHD_YES if the key-value pair is in the headers, | 737 | * @return #MHD_YES if the key-value pair is in the headers, |
737 | * #MHD_NO if not | 738 | * #MHD_NO if not |
@@ -740,6 +741,7 @@ static int | |||
740 | test_header (struct MHD_Connection *connection, | 741 | test_header (struct MHD_Connection *connection, |
741 | const char *key, | 742 | const char *key, |
742 | const char *value, | 743 | const char *value, |
744 | size_t value_size, | ||
743 | enum MHD_ValueKind kind) | 745 | enum MHD_ValueKind kind) |
744 | { | 746 | { |
745 | struct MHD_HTTP_Header *pos; | 747 | struct MHD_HTTP_Header *pos; |
@@ -748,6 +750,8 @@ test_header (struct MHD_Connection *connection, | |||
748 | { | 750 | { |
749 | if (kind != pos->kind) | 751 | if (kind != pos->kind) |
750 | continue; | 752 | continue; |
753 | if (value_size != pos->value_size) | ||
754 | continue; | ||
751 | if (0 != strcmp (key, | 755 | if (0 != strcmp (key, |
752 | pos->header)) | 756 | pos->header)) |
753 | continue; | 757 | continue; |
@@ -756,8 +760,9 @@ test_header (struct MHD_Connection *connection, | |||
756 | return MHD_YES; | 760 | return MHD_YES; |
757 | if ( (NULL == value) || | 761 | if ( (NULL == value) || |
758 | (NULL == pos->value) || | 762 | (NULL == pos->value) || |
759 | (0 != strcmp (value, | 763 | (0 != memcmp (value, |
760 | pos->value)) ) | 764 | pos->value, |
765 | value_size)) ) | ||
761 | continue; | 766 | continue; |
762 | return MHD_YES; | 767 | return MHD_YES; |
763 | } | 768 | } |
@@ -862,6 +867,7 @@ digest_auth_check_all (struct MHD_Connection *connection, | |||
862 | uint32_t t; | 867 | uint32_t t; |
863 | size_t left; /* number of characters left in 'header' for 'uri' */ | 868 | size_t left; /* number of characters left in 'header' for 'uri' */ |
864 | uint64_t nci; | 869 | uint64_t nci; |
870 | char *qmark; | ||
865 | 871 | ||
866 | VLA_CHECK_LEN_DIGEST(da->digest_size); | 872 | VLA_CHECK_LEN_DIGEST(da->digest_size); |
867 | header = MHD_lookup_connection_value (connection, | 873 | header = MHD_lookup_connection_value (connection, |
@@ -1072,15 +1078,17 @@ digest_auth_check_all (struct MHD_Connection *connection, | |||
1072 | uri, | 1078 | uri, |
1073 | hentity, | 1079 | hentity, |
1074 | da); | 1080 | da); |
1075 | 1081 | qmark = strchr (uri, | |
1082 | '?'); | ||
1083 | if (NULL != qmark) | ||
1084 | *qmark = '\0'; | ||
1076 | 1085 | ||
1077 | /* Need to unescape URI before comparing with connection->url */ | 1086 | /* Need to unescape URI before comparing with connection->url */ |
1078 | daemon->unescape_callback (daemon->unescape_callback_cls, | 1087 | daemon->unescape_callback (daemon->unescape_callback_cls, |
1079 | connection, | 1088 | connection, |
1080 | uri); | 1089 | uri); |
1081 | if (0 != strncmp (uri, | 1090 | if (0 != strcmp (uri, |
1082 | connection->url, | 1091 | connection->url)) |
1083 | strlen (connection->url))) | ||
1084 | { | 1092 | { |
1085 | #ifdef HAVE_MESSAGES | 1093 | #ifdef HAVE_MESSAGES |
1086 | MHD_DLOG (daemon, | 1094 | MHD_DLOG (daemon, |
@@ -1091,8 +1099,7 @@ digest_auth_check_all (struct MHD_Connection *connection, | |||
1091 | } | 1099 | } |
1092 | 1100 | ||
1093 | { | 1101 | { |
1094 | const char *args = strchr (uri, | 1102 | const char *args = qmark; |
1095 | '?'); | ||
1096 | 1103 | ||
1097 | if (NULL == args) | 1104 | if (NULL == args) |
1098 | args = ""; | 1105 | args = ""; |
diff --git a/src/microhttpd/internal.c b/src/microhttpd/internal.c index d2532c54..8e9e0aac 100644 --- a/src/microhttpd/internal.c +++ b/src/microhttpd/internal.c | |||
@@ -162,7 +162,7 @@ MHD_http_unescape (char *val) | |||
162 | } | 162 | } |
163 | } | 163 | } |
164 | *wpos = '\0'; /* add 0-terminator */ | 164 | *wpos = '\0'; /* add 0-terminator */ |
165 | return wpos - val; /* = strlen(val) */ | 165 | return wpos - val; |
166 | } | 166 | } |
167 | 167 | ||
168 | 168 | ||
@@ -190,6 +190,7 @@ MHD_parse_arguments_ (struct MHD_Connection *connection, | |||
190 | struct MHD_Daemon *daemon = connection->daemon; | 190 | struct MHD_Daemon *daemon = connection->daemon; |
191 | char *equals; | 191 | char *equals; |
192 | char *amper; | 192 | char *amper; |
193 | size_t len; | ||
193 | 194 | ||
194 | *num_headers = 0; | 195 | *num_headers = 0; |
195 | while ( (NULL != args) && | 196 | while ( (NULL != args) && |
@@ -210,6 +211,7 @@ MHD_parse_arguments_ (struct MHD_Connection *connection, | |||
210 | if (MHD_YES != cb (connection, | 211 | if (MHD_YES != cb (connection, |
211 | args, | 212 | args, |
212 | NULL, | 213 | NULL, |
214 | 0, | ||
213 | kind)) | 215 | kind)) |
214 | return MHD_NO; | 216 | return MHD_NO; |
215 | (*num_headers)++; | 217 | (*num_headers)++; |
@@ -223,12 +225,13 @@ MHD_parse_arguments_ (struct MHD_Connection *connection, | |||
223 | connection, | 225 | connection, |
224 | args); | 226 | args); |
225 | MHD_unescape_plus (equals); | 227 | MHD_unescape_plus (equals); |
226 | daemon->unescape_callback (daemon->unescape_callback_cls, | 228 | len = daemon->unescape_callback (daemon->unescape_callback_cls, |
227 | connection, | 229 | connection, |
228 | equals); | 230 | equals); |
229 | if (MHD_YES != cb (connection, | 231 | if (MHD_YES != cb (connection, |
230 | args, | 232 | args, |
231 | equals, | 233 | equals, |
234 | len, | ||
232 | kind)) | 235 | kind)) |
233 | return MHD_NO; | 236 | return MHD_NO; |
234 | (*num_headers)++; | 237 | (*num_headers)++; |
@@ -248,6 +251,7 @@ MHD_parse_arguments_ (struct MHD_Connection *connection, | |||
248 | if (MHD_YES != cb (connection, | 251 | if (MHD_YES != cb (connection, |
249 | args, | 252 | args, |
250 | NULL, | 253 | NULL, |
254 | 0, | ||
251 | kind)) | 255 | kind)) |
252 | return MHD_NO; | 256 | return MHD_NO; |
253 | /* continue with 'bar' */ | 257 | /* continue with 'bar' */ |
@@ -264,12 +268,13 @@ MHD_parse_arguments_ (struct MHD_Connection *connection, | |||
264 | connection, | 268 | connection, |
265 | args); | 269 | args); |
266 | MHD_unescape_plus (equals); | 270 | MHD_unescape_plus (equals); |
267 | daemon->unescape_callback (daemon->unescape_callback_cls, | 271 | len = daemon->unescape_callback (daemon->unescape_callback_cls, |
268 | connection, | 272 | connection, |
269 | equals); | 273 | equals); |
270 | if (MHD_YES != cb (connection, | 274 | if (MHD_YES != cb (connection, |
271 | args, | 275 | args, |
272 | equals, | 276 | equals, |
277 | len, | ||
273 | kind)) | 278 | kind)) |
274 | return MHD_NO; | 279 | return MHD_NO; |
275 | (*num_headers)++; | 280 | (*num_headers)++; |
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h index d09de610..f77ebd10 100644 --- a/src/microhttpd/internal.h +++ b/src/microhttpd/internal.h | |||
@@ -276,6 +276,11 @@ struct MHD_HTTP_Header | |||
276 | char *value; | 276 | char *value; |
277 | 277 | ||
278 | /** | 278 | /** |
279 | * Number of bytes in @a value. | ||
280 | */ | ||
281 | size_t value_size; | ||
282 | |||
283 | /** | ||
279 | * Type of the header (where in the HTTP protocol is this header | 284 | * Type of the header (where in the HTTP protocol is this header |
280 | * from). | 285 | * from). |
281 | */ | 286 | */ |
@@ -1881,7 +1886,8 @@ MHD_unescape_plus (char *arg); | |||
1881 | * | 1886 | * |
1882 | * @param connection context of the iteration | 1887 | * @param connection context of the iteration |
1883 | * @param key 0-terminated key string, never NULL | 1888 | * @param key 0-terminated key string, never NULL |
1884 | * @param value 0-terminated value string, may be NULL | 1889 | * @param value 0-terminated binary data, may include binary zeros, may be NULL |
1890 | * @param value_size number of bytes in value | ||
1885 | * @param kind origin of the key-value pair | 1891 | * @param kind origin of the key-value pair |
1886 | * @return #MHD_YES on success (continue to iterate) | 1892 | * @return #MHD_YES on success (continue to iterate) |
1887 | * #MHD_NO to signal failure (and abort iteration) | 1893 | * #MHD_NO to signal failure (and abort iteration) |
@@ -1890,6 +1896,7 @@ typedef int | |||
1890 | (*MHD_ArgumentIterator_)(struct MHD_Connection *connection, | 1896 | (*MHD_ArgumentIterator_)(struct MHD_Connection *connection, |
1891 | const char *key, | 1897 | const char *key, |
1892 | const char *value, | 1898 | const char *value, |
1899 | size_t value_size, | ||
1893 | enum MHD_ValueKind kind); | 1900 | enum MHD_ValueKind kind); |
1894 | 1901 | ||
1895 | 1902 | ||
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index 263f8303..9f328eef 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c | |||
@@ -240,7 +240,8 @@ MHD_get_response_headers (struct MHD_Response *response, | |||
240 | (MHD_YES != iterator (iterator_cls, | 240 | (MHD_YES != iterator (iterator_cls, |
241 | pos->kind, | 241 | pos->kind, |
242 | pos->header, | 242 | pos->header, |
243 | pos->value))) | 243 | pos->value, |
244 | pos->value_size))) | ||
244 | break; | 245 | break; |
245 | } | 246 | } |
246 | return numHeaders; | 247 | return numHeaders; |
diff --git a/src/testcurl/test_get.c b/src/testcurl/test_get.c index cb81283f..7e4fd4c6 100644 --- a/src/testcurl/test_get.c +++ b/src/testcurl/test_get.c | |||
@@ -35,6 +35,8 @@ | |||
35 | #include "mhd_sockets.h" /* only macros used */ | 35 | #include "mhd_sockets.h" /* only macros used */ |
36 | 36 | ||
37 | 37 | ||
38 | #define EXPECTED_URI_PATH "/hello_world?a=%26&b=c" | ||
39 | |||
38 | #ifdef _WIN32 | 40 | #ifdef _WIN32 |
39 | #ifndef WIN32_LEAN_AND_MEAN | 41 | #ifndef WIN32_LEAN_AND_MEAN |
40 | #define WIN32_LEAN_AND_MEAN 1 | 42 | #define WIN32_LEAN_AND_MEAN 1 |
@@ -64,6 +66,7 @@ struct CBC | |||
64 | size_t size; | 66 | size_t size; |
65 | }; | 67 | }; |
66 | 68 | ||
69 | |||
67 | static size_t | 70 | static size_t |
68 | copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) | 71 | copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) |
69 | { | 72 | { |
@@ -76,6 +79,24 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) | |||
76 | return size * nmemb; | 79 | return size * nmemb; |
77 | } | 80 | } |
78 | 81 | ||
82 | |||
83 | static void * | ||
84 | log_cb (void *cls, | ||
85 | const char *uri, | ||
86 | struct MHD_Connection *con) | ||
87 | { | ||
88 | if (0 != strcmp (uri, | ||
89 | EXPECTED_URI_PATH)) | ||
90 | { | ||
91 | fprintf (stderr, | ||
92 | "Wrong URI: `%s'\n", | ||
93 | uri); | ||
94 | abort (); | ||
95 | } | ||
96 | return NULL; | ||
97 | } | ||
98 | |||
99 | |||
79 | static int | 100 | static int |
80 | ahc_echo (void *cls, | 101 | ahc_echo (void *cls, |
81 | struct MHD_Connection *connection, | 102 | struct MHD_Connection *connection, |
@@ -89,7 +110,10 @@ ahc_echo (void *cls, | |||
89 | const char *me = cls; | 110 | const char *me = cls; |
90 | struct MHD_Response *response; | 111 | struct MHD_Response *response; |
91 | int ret; | 112 | int ret; |
92 | (void)version;(void)upload_data;(void)upload_data_size; /* Unused. Silent compiler warning. */ | 113 | const char *v; |
114 | (void) version; | ||
115 | (void) upload_data; | ||
116 | (void) upload_data_size; /* Unused. Silence compiler warning. */ | ||
93 | 117 | ||
94 | if (0 != strcasecmp (me, method)) | 118 | if (0 != strcasecmp (me, method)) |
95 | return MHD_NO; /* unexpected method */ | 119 | return MHD_NO; /* unexpected method */ |
@@ -99,10 +123,26 @@ ahc_echo (void *cls, | |||
99 | return MHD_YES; | 123 | return MHD_YES; |
100 | } | 124 | } |
101 | *unused = NULL; | 125 | *unused = NULL; |
126 | v = MHD_lookup_connection_value (connection, | ||
127 | MHD_GET_ARGUMENT_KIND, | ||
128 | "a"); | ||
129 | if ( (NULL == v) || | ||
130 | (0 != strcmp ("&", | ||
131 | v)) ) | ||
132 | abort (); | ||
133 | v = MHD_lookup_connection_value (connection, | ||
134 | MHD_GET_ARGUMENT_KIND, | ||
135 | "b"); | ||
136 | if ( (NULL == v) || | ||
137 | (0 != strcmp ("c", | ||
138 | v)) ) | ||
139 | abort (); | ||
102 | response = MHD_create_response_from_buffer (strlen (url), | 140 | response = MHD_create_response_from_buffer (strlen (url), |
103 | (void *) url, | 141 | (void *) url, |
104 | MHD_RESPMEM_MUST_COPY); | 142 | MHD_RESPMEM_MUST_COPY); |
105 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); | 143 | ret = MHD_queue_response (connection, |
144 | MHD_HTTP_OK, | ||
145 | response); | ||
106 | MHD_destroy_response (response); | 146 | MHD_destroy_response (response); |
107 | if (ret == MHD_NO) | 147 | if (ret == MHD_NO) |
108 | abort (); | 148 | abort (); |
@@ -131,7 +171,10 @@ testInternalGet (int poll_flag) | |||
131 | cbc.size = 2048; | 171 | cbc.size = 2048; |
132 | cbc.pos = 0; | 172 | cbc.pos = 0; |
133 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | poll_flag, | 173 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | poll_flag, |
134 | global_port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); | 174 | global_port, NULL, NULL, |
175 | &ahc_echo, "GET", | ||
176 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | ||
177 | MHD_OPTION_END); | ||
135 | if (d == NULL) | 178 | if (d == NULL) |
136 | return 1; | 179 | return 1; |
137 | if (0 == global_port) | 180 | if (0 == global_port) |
@@ -143,7 +186,7 @@ testInternalGet (int poll_flag) | |||
143 | global_port = (int)dinfo->port; | 186 | global_port = (int)dinfo->port; |
144 | } | 187 | } |
145 | c = curl_easy_init (); | 188 | c = curl_easy_init (); |
146 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 189 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); |
147 | curl_easy_setopt (c, CURLOPT_PORT, (long)global_port); | 190 | curl_easy_setopt (c, CURLOPT_PORT, (long)global_port); |
148 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); | 191 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); |
149 | curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); | 192 | curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); |
@@ -198,7 +241,10 @@ testMultithreadedGet (int poll_flag) | |||
198 | cbc.size = 2048; | 241 | cbc.size = 2048; |
199 | cbc.pos = 0; | 242 | cbc.pos = 0; |
200 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | poll_flag, | 243 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | poll_flag, |
201 | global_port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); | 244 | global_port, NULL, NULL, |
245 | &ahc_echo, "GET", | ||
246 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | ||
247 | MHD_OPTION_END); | ||
202 | if (d == NULL) | 248 | if (d == NULL) |
203 | return 16; | 249 | return 16; |
204 | if (0 == global_port) | 250 | if (0 == global_port) |
@@ -210,7 +256,7 @@ testMultithreadedGet (int poll_flag) | |||
210 | global_port = (int)dinfo->port; | 256 | global_port = (int)dinfo->port; |
211 | } | 257 | } |
212 | c = curl_easy_init (); | 258 | c = curl_easy_init (); |
213 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 259 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); |
214 | curl_easy_setopt (c, CURLOPT_PORT, (long)global_port); | 260 | curl_easy_setopt (c, CURLOPT_PORT, (long)global_port); |
215 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); | 261 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); |
216 | curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); | 262 | curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); |
@@ -265,8 +311,11 @@ testMultithreadedPoolGet (int poll_flag) | |||
265 | cbc.size = 2048; | 311 | cbc.size = 2048; |
266 | cbc.pos = 0; | 312 | cbc.pos = 0; |
267 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | poll_flag, | 313 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | poll_flag, |
268 | global_port, NULL, NULL, &ahc_echo, "GET", | 314 | global_port, NULL, NULL, |
269 | MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, MHD_OPTION_END); | 315 | &ahc_echo, "GET", |
316 | MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT, | ||
317 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | ||
318 | MHD_OPTION_END); | ||
270 | if (d == NULL) | 319 | if (d == NULL) |
271 | return 16; | 320 | return 16; |
272 | if (0 == global_port) | 321 | if (0 == global_port) |
@@ -278,7 +327,7 @@ testMultithreadedPoolGet (int poll_flag) | |||
278 | global_port = (int)dinfo->port; | 327 | global_port = (int)dinfo->port; |
279 | } | 328 | } |
280 | c = curl_easy_init (); | 329 | c = curl_easy_init (); |
281 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 330 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); |
282 | curl_easy_setopt (c, CURLOPT_PORT, (long)global_port); | 331 | curl_easy_setopt (c, CURLOPT_PORT, (long)global_port); |
283 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); | 332 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); |
284 | curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); | 333 | curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); |
@@ -348,7 +397,10 @@ testExternalGet () | |||
348 | cbc.size = 2048; | 397 | cbc.size = 2048; |
349 | cbc.pos = 0; | 398 | cbc.pos = 0; |
350 | d = MHD_start_daemon (MHD_USE_ERROR_LOG, | 399 | d = MHD_start_daemon (MHD_USE_ERROR_LOG, |
351 | global_port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); | 400 | global_port, NULL, NULL, |
401 | &ahc_echo, "GET", | ||
402 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | ||
403 | MHD_OPTION_END); | ||
352 | if (d == NULL) | 404 | if (d == NULL) |
353 | return 256; | 405 | return 256; |
354 | if (0 == global_port) | 406 | if (0 == global_port) |
@@ -360,7 +412,7 @@ testExternalGet () | |||
360 | global_port = (int)dinfo->port; | 412 | global_port = (int)dinfo->port; |
361 | } | 413 | } |
362 | c = curl_easy_init (); | 414 | c = curl_easy_init (); |
363 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 415 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); |
364 | curl_easy_setopt (c, CURLOPT_PORT, (long)global_port); | 416 | curl_easy_setopt (c, CURLOPT_PORT, (long)global_port); |
365 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); | 417 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); |
366 | curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); | 418 | curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); |
@@ -494,6 +546,7 @@ testUnknownPortGet (int poll_flag) | |||
494 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | poll_flag, | 546 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | poll_flag, |
495 | 0, NULL, NULL, &ahc_echo, "GET", | 547 | 0, NULL, NULL, &ahc_echo, "GET", |
496 | MHD_OPTION_SOCK_ADDR, &addr, | 548 | MHD_OPTION_SOCK_ADDR, &addr, |
549 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | ||
497 | MHD_OPTION_END); | 550 | MHD_OPTION_END); |
498 | if (MHD_NO == MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | 551 | if (MHD_NO == MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) |
499 | { | 552 | { |
@@ -517,8 +570,11 @@ testUnknownPortGet (int poll_flag) | |||
517 | port = (int)dinfo->port; | 570 | port = (int)dinfo->port; |
518 | } | 571 | } |
519 | 572 | ||
520 | snprintf(buf, sizeof(buf), "http://127.0.0.1:%d/hello_world", | 573 | snprintf(buf, |
521 | port); | 574 | sizeof(buf), |
575 | "http://127.0.0.1:%d%s", | ||
576 | port, | ||
577 | EXPECTED_URI_PATH); | ||
522 | 578 | ||
523 | c = curl_easy_init (); | 579 | c = curl_easy_init (); |
524 | curl_easy_setopt (c, CURLOPT_URL, buf); | 580 | curl_easy_setopt (c, CURLOPT_URL, buf); |
@@ -570,7 +626,10 @@ testStopRace (int poll_flag) | |||
570 | } | 626 | } |
571 | 627 | ||
572 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | poll_flag, | 628 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | poll_flag, |
573 | global_port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); | 629 | global_port, NULL, NULL, |
630 | &ahc_echo, "GET", | ||
631 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | ||
632 | MHD_OPTION_END); | ||
574 | if (d == NULL) | 633 | if (d == NULL) |
575 | return 16; | 634 | return 16; |
576 | if (0 == global_port) | 635 | if (0 == global_port) |
@@ -686,7 +745,10 @@ testEmptyGet (int poll_flag) | |||
686 | cbc.size = 2048; | 745 | cbc.size = 2048; |
687 | cbc.pos = 0; | 746 | cbc.pos = 0; |
688 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | poll_flag, | 747 | d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | poll_flag, |
689 | global_port, NULL, NULL, &ahc_empty, NULL, MHD_OPTION_END); | 748 | global_port, NULL, NULL, |
749 | &ahc_empty, NULL, | ||
750 | MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, | ||
751 | MHD_OPTION_END); | ||
690 | if (d == NULL) | 752 | if (d == NULL) |
691 | return 4194304; | 753 | return 4194304; |
692 | if (0 == global_port) | 754 | if (0 == global_port) |
@@ -698,7 +760,7 @@ testEmptyGet (int poll_flag) | |||
698 | global_port = (int)dinfo->port; | 760 | global_port = (int)dinfo->port; |
699 | } | 761 | } |
700 | c = curl_easy_init (); | 762 | c = curl_easy_init (); |
701 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1/hello_world"); | 763 | curl_easy_setopt (c, CURLOPT_URL, "http://127.0.0.1" EXPECTED_URI_PATH); |
702 | curl_easy_setopt (c, CURLOPT_PORT, (long)global_port); | 764 | curl_easy_setopt (c, CURLOPT_PORT, (long)global_port); |
703 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); | 765 | curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer); |
704 | curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); | 766 | curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); |
diff --git a/src/testcurl/test_process_headers.c b/src/testcurl/test_process_headers.c index f9c7cd03..3be814e2 100644 --- a/src/testcurl/test_process_headers.c +++ b/src/testcurl/test_process_headers.c | |||
@@ -65,8 +65,13 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) | |||
65 | return size * nmemb; | 65 | return size * nmemb; |
66 | } | 66 | } |
67 | 67 | ||
68 | |||
68 | static int | 69 | static int |
69 | kv_cb (void *cls, enum MHD_ValueKind kind, const char *key, const char *value) | 70 | kv_cb (void *cls, |
71 | enum MHD_ValueKind kind, | ||
72 | const char *key, | ||
73 | const char *value, | ||
74 | size_t value_size) | ||
70 | { | 75 | { |
71 | if ((0 == strcmp (key, MHD_HTTP_HEADER_HOST)) && | 76 | if ((0 == strcmp (key, MHD_HTTP_HEADER_HOST)) && |
72 | (0 == strncmp (value, "127.0.0.1", strlen("127.0.0.1"))) && (kind == MHD_HEADER_KIND)) | 77 | (0 == strncmp (value, "127.0.0.1", strlen("127.0.0.1"))) && (kind == MHD_HEADER_KIND)) |
@@ -77,6 +82,7 @@ kv_cb (void *cls, enum MHD_ValueKind kind, const char *key, const char *value) | |||
77 | return MHD_YES; | 82 | return MHD_YES; |
78 | } | 83 | } |
79 | 84 | ||
85 | |||
80 | static int | 86 | static int |
81 | ahc_echo (void *cls, | 87 | ahc_echo (void *cls, |
82 | struct MHD_Connection *connection, | 88 | struct MHD_Connection *connection, |
diff --git a/src/testcurl/test_urlparse.c b/src/testcurl/test_urlparse.c index 8675f19c..1e6cc28c 100644 --- a/src/testcurl/test_urlparse.c +++ b/src/testcurl/test_urlparse.c | |||
@@ -67,13 +67,18 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) | |||
67 | return size * nmemb; | 67 | return size * nmemb; |
68 | } | 68 | } |
69 | 69 | ||
70 | |||
70 | static int | 71 | static int |
71 | test_values (void *cls, | 72 | test_values (void *cls, |
72 | enum MHD_ValueKind kind, | 73 | enum MHD_ValueKind kind, |
73 | const char *key, | 74 | const char *key, |
74 | const char *value) | 75 | const char *value, |
76 | size_t value_size) | ||
75 | { | 77 | { |
76 | (void)cls;(void)kind; /* Unused. Silent compiler warning. */ | 78 | (void) cls; |
79 | (void) kind; | ||
80 | (void) value_size; | ||
81 | |||
77 | if ( (0 == strcmp (key, "a")) && | 82 | if ( (0 == strcmp (key, "a")) && |
78 | (0 == strcmp (value, "b")) ) | 83 | (0 == strcmp (value, "b")) ) |
79 | matches += 1; | 84 | matches += 1; |