aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/chapters/basicauthentication.inc16
-rw-r--r--doc/chapters/exploringrequests.inc2
-rw-r--r--doc/chapters/hellobrowser.inc2
-rw-r--r--doc/chapters/largerpost.inc14
-rw-r--r--doc/chapters/processingpost.inc14
-rw-r--r--doc/chapters/responseheaders.inc2
-rw-r--r--doc/chapters/websocket.inc4
-rw-r--r--doc/examples/basicauthentication.c6
-rw-r--r--doc/examples/hellobrowser.c4
-rw-r--r--doc/examples/largepost.c14
-rw-r--r--doc/examples/logging.c4
-rw-r--r--doc/examples/responseheaders.c4
-rw-r--r--doc/examples/sessions.c16
-rw-r--r--doc/examples/simplepost.c14
-rw-r--r--doc/examples/tlsauthentication.c6
-rw-r--r--doc/examples/websocket.c10
-rw-r--r--doc/libmicrohttpd.texi61
-rw-r--r--src/examples/authorization_example.c8
-rw-r--r--src/examples/benchmark.c10
-rw-r--r--src/examples/benchmark_https.c10
-rw-r--r--src/examples/chunked_example.c8
-rw-r--r--src/examples/connection_close.c10
-rw-r--r--src/examples/demo.c14
-rw-r--r--src/examples/demo_https.c14
-rw-r--r--src/examples/digest_auth_example.c4
-rw-r--r--src/examples/dual_stack_example.c8
-rw-r--r--src/examples/fileserver_example.c8
-rw-r--r--src/examples/fileserver_example_dirs.c8
-rw-r--r--src/examples/fileserver_example_external_select.c8
-rw-r--r--src/examples/http_chunked_compression.c8
-rw-r--r--src/examples/http_compression.c8
-rw-r--r--src/examples/https_fileserver_example.c8
-rw-r--r--src/examples/minimal_example.c8
-rw-r--r--src/examples/minimal_example_comet.c8
-rw-r--r--src/examples/minimal_example_empty.c8
-rw-r--r--src/examples/minimal_example_empty_tls.c8
-rw-r--r--src/examples/msgs_i18n.c2
-rw-r--r--src/examples/post_example.c16
-rw-r--r--src/examples/querystring_example.c8
-rw-r--r--src/examples/refuse_post_example.c8
-rw-r--r--src/examples/suspend_resume_epoll.c10
-rw-r--r--src/examples/timeout.c4
-rw-r--r--src/examples/upgrade_example.c14
-rw-r--r--src/examples/websocket_chatserver_example.c16
-rw-r--r--src/examples/websocket_threaded_example.c12
-rw-r--r--src/include/microhttpd.h28
-rw-r--r--src/include/microhttpd2.h10
-rw-r--r--src/microhttpd/test_client_put_stop.c12
-rw-r--r--src/microhttpd/test_daemon.c4
-rw-r--r--src/microhttpd/test_options.c4
-rw-r--r--src/microhttpd/test_start_stop.c4
-rw-r--r--src/microhttpd/test_upgrade.c42
-rw-r--r--src/microhttpd/test_upgrade_large.c42
-rw-r--r--src/microhttpd_ws/test_websocket_browser.c10
-rw-r--r--src/testcurl/https/test_empty_response.c4
-rw-r--r--src/testcurl/https/test_https_get.c8
-rw-r--r--src/testcurl/https/test_https_get_iovec.c16
-rw-r--r--src/testcurl/https/test_https_get_select.c8
-rw-r--r--src/testcurl/https/test_https_session_info.c6
-rw-r--r--src/testcurl/https/tls_test_common.c12
-rw-r--r--src/testcurl/https/tls_test_common.h4
-rw-r--r--src/testcurl/perf_get.c8
-rw-r--r--src/testcurl/perf_get_concurrent.c8
-rw-r--r--src/testcurl/test_add_conn.c8
-rw-r--r--src/testcurl/test_callback.c4
-rw-r--r--src/testcurl/test_concurrent_stop.c8
-rw-r--r--src/testcurl/test_delete.c4
-rw-r--r--src/testcurl/test_digestauth.c4
-rw-r--r--src/testcurl/test_digestauth_sha256.c4
-rw-r--r--src/testcurl/test_digestauth_with_arguments.c4
-rw-r--r--src/testcurl/test_get.c16
-rw-r--r--src/testcurl/test_get_chunked.c6
-rw-r--r--src/testcurl/test_get_close_keep_alive.c8
-rw-r--r--src/testcurl/test_get_empty.c16
-rw-r--r--src/testcurl/test_get_iovec.c16
-rw-r--r--src/testcurl/test_get_response_cleanup.c8
-rw-r--r--src/testcurl/test_get_sendfile.c8
-rw-r--r--src/testcurl/test_get_wait.c8
-rw-r--r--src/testcurl/test_iplimit.c8
-rw-r--r--src/testcurl/test_large_put.c8
-rw-r--r--src/testcurl/test_long_header.c4
-rw-r--r--src/testcurl/test_parse_cookies.c8
-rw-r--r--src/testcurl/test_patch.c4
-rw-r--r--src/testcurl/test_post.c20
-rw-r--r--src/testcurl/test_post_loop.c10
-rw-r--r--src/testcurl/test_postform.c14
-rw-r--r--src/testcurl/test_process_arguments.c8
-rw-r--r--src/testcurl/test_process_headers.c8
-rw-r--r--src/testcurl/test_put.c4
-rw-r--r--src/testcurl/test_put_chunked.c4
-rw-r--r--src/testcurl/test_quiesce.c12
-rw-r--r--src/testcurl/test_quiesce_stream.c8
-rw-r--r--src/testcurl/test_termination.c6
-rw-r--r--src/testcurl/test_timeout.c8
-rw-r--r--src/testcurl/test_toolarge.c8
-rw-r--r--src/testcurl/test_tricky.c8
-rw-r--r--src/testcurl/test_urlparse.c8
-rw-r--r--src/testzzuf/test_get.c8
-rw-r--r--src/testzzuf/test_get_chunked.c6
-rw-r--r--src/testzzuf/test_long_header.c4
-rw-r--r--src/testzzuf/test_post.c14
-rw-r--r--src/testzzuf/test_post_form.c14
-rw-r--r--src/testzzuf/test_put.c4
-rw-r--r--src/testzzuf/test_put_chunked.c4
-rw-r--r--src/testzzuf/test_put_large.c4
105 files changed, 507 insertions, 510 deletions
diff --git a/doc/chapters/basicauthentication.inc b/doc/chapters/basicauthentication.inc
index ca48403a..7aa33637 100644
--- a/doc/chapters/basicauthentication.inc
+++ b/doc/chapters/basicauthentication.inc
@@ -64,10 +64,10 @@ application should suspend the connection).
64@end enumerate 64@end enumerate
65 65
66But how can we tell whether the callback has been called before for the 66But how can we tell whether the callback has been called before for the
67particular connection? Initially, the pointer this parameter references is 67particular request? Initially, the pointer this parameter references is
68set by @emph{MHD} in the callback. But it will also be "remembered" on the 68set by @emph{MHD} in the callback. But it will also be "remembered" on the
69next call (for the same connection). Thus, we can use the @code{con_cls} 69next call (for the same request). Thus, we can use the @code{req_cls}
70location to keep track of the connection state. For now, we will simply 70location to keep track of the request state. For now, we will simply
71generate no response until the parameter is non-null---implying the callback 71generate no response until the parameter is non-null---implying the callback
72was called before at least once. We do not need to share information between 72was called before at least once. We do not need to share information between
73different calls of the callback, so we can set the parameter to any address 73different calls of the callback, so we can set the parameter to any address
@@ -81,10 +81,10 @@ static int
81answer_to_connection (void *cls, struct MHD_Connection *connection, 81answer_to_connection (void *cls, struct MHD_Connection *connection,
82 const char *url, const char *method, const char *version, 82 const char *url, const char *method, const char *version,
83 const char *upload_data, size_t *upload_data_size, 83 const char *upload_data, size_t *upload_data_size,
84 void **con_cls) 84 void **req_cls)
85{ 85{
86 if (0 != strcmp(method, "GET")) return MHD_NO; 86 if (0 != strcmp(method, "GET")) return MHD_NO;
87 if (NULL == *con_cls) {*con_cls = connection; return MHD_YES;} 87 if (NULL == *req_cls) {*req_cls = connection; return MHD_YES;}
88 88
89 ... 89 ...
90 /* else respond accordingly */ 90 /* else respond accordingly */
@@ -116,7 +116,7 @@ static int
116answer_to_connection (void *cls, struct MHD_Connection *connection, 116answer_to_connection (void *cls, struct MHD_Connection *connection,
117 const char *url, const char *method, 117 const char *url, const char *method,
118 const char *version, const char *upload_data, 118 const char *version, const char *upload_data,
119 size_t *upload_data_size, void **con_cls) 119 size_t *upload_data_size, void **req_cls)
120{ 120{
121 char *user; 121 char *user;
122 char *pass; 122 char *pass;
@@ -126,9 +126,9 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
126 126
127 if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) 127 if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
128 return MHD_NO; 128 return MHD_NO;
129 if (NULL == *con_cls) 129 if (NULL == *req_cls)
130 { 130 {
131 *con_cls = connection; 131 *req_cls = connection;
132 return MHD_YES; 132 return MHD_YES;
133 } 133 }
134 pass = NULL; 134 pass = NULL;
diff --git a/doc/chapters/exploringrequests.inc b/doc/chapters/exploringrequests.inc
index 2e43c38a..8237c9bb 100644
--- a/doc/chapters/exploringrequests.inc
+++ b/doc/chapters/exploringrequests.inc
@@ -14,7 +14,7 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
14 const char *url, 14 const char *url,
15 const char *method, const char *version, 15 const char *method, const char *version,
16 const char *upload_data, 16 const char *upload_data,
17 size_t *upload_data_size, void **con_cls) 17 size_t *upload_data_size, void **req_cls)
18{ 18{
19 ... 19 ...
20 return MHD_NO; 20 return MHD_NO;
diff --git a/doc/chapters/hellobrowser.inc b/doc/chapters/hellobrowser.inc
index ac7a5fe1..6ca37df9 100644
--- a/doc/chapters/hellobrowser.inc
+++ b/doc/chapters/hellobrowser.inc
@@ -43,7 +43,7 @@ int answer_to_connection (void *cls, struct MHD_Connection *connection,
43 const char *url, 43 const char *url,
44 const char *method, const char *version, 44 const char *method, const char *version,
45 const char *upload_data, 45 const char *upload_data,
46 size_t *upload_data_size, void **con_cls) 46 size_t *upload_data_size, void **req_cls)
47{ 47{
48 const char *page = "<html><body>Hello, browser!</body></html>"; 48 const char *page = "<html><body>Hello, browser!</body></html>";
49 49
diff --git a/doc/chapters/largerpost.inc b/doc/chapters/largerpost.inc
index 11479382..681550ce 100644
--- a/doc/chapters/largerpost.inc
+++ b/doc/chapters/largerpost.inc
@@ -95,9 +95,9 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
95 const char *url, 95 const char *url,
96 const char *method, const char *version, 96 const char *method, const char *version,
97 const char *upload_data, 97 const char *upload_data,
98 size_t *upload_data_size, void **con_cls) 98 size_t *upload_data_size, void **req_cls)
99{ 99{
100 if (NULL == *con_cls) 100 if (NULL == *req_cls)
101 { 101 {
102 struct connection_info_struct *con_info; 102 struct connection_info_struct *con_info;
103 103
@@ -120,7 +120,7 @@ the addition of a filepointer for each connection.
120 } 120 }
121 else con_info->connectiontype = GET; 121 else con_info->connectiontype = GET;
122 122
123 *con_cls = (void*) con_info; 123 *req_cls = (void*) con_info;
124 124
125 return MHD_YES; 125 return MHD_YES;
126 } 126 }
@@ -179,7 +179,7 @@ constituted no expected request method.
179@verbatim 179@verbatim
180 if (0 == strcmp (method, "POST")) 180 if (0 == strcmp (method, "POST"))
181 { 181 {
182 struct connection_info_struct *con_info = *con_cls; 182 struct connection_info_struct *con_info = *req_cls;
183 183
184 if (0 != *upload_data_size) 184 if (0 != *upload_data_size)
185 { 185 {
@@ -284,10 +284,10 @@ The new client was registered when the postprocessor was created. Likewise, we u
284on destroying the postprocessor when the request is completed. 284on destroying the postprocessor when the request is completed.
285@verbatim 285@verbatim
286void request_completed (void *cls, struct MHD_Connection *connection, 286void request_completed (void *cls, struct MHD_Connection *connection,
287 void **con_cls, 287 void **req_cls,
288 enum MHD_RequestTerminationCode toe) 288 enum MHD_RequestTerminationCode toe)
289{ 289{
290 struct connection_info_struct *con_info = *con_cls; 290 struct connection_info_struct *con_info = *req_cls;
291 291
292 if (NULL == con_info) return; 292 if (NULL == con_info) return;
293 293
@@ -303,7 +303,7 @@ void request_completed (void *cls, struct MHD_Connection *connection,
303 } 303 }
304 304
305 free (con_info); 305 free (con_info);
306 *con_cls = NULL; 306 *req_cls = NULL;
307} 307}
308@end verbatim 308@end verbatim
309@noindent 309@noindent
diff --git a/doc/chapters/processingpost.inc b/doc/chapters/processingpost.inc
index 920dac31..8f0dc7d8 100644
--- a/doc/chapters/processingpost.inc
+++ b/doc/chapters/processingpost.inc
@@ -111,10 +111,10 @@ requests other than @emph{POST} requests.
111 111
112@verbatim 112@verbatim
113void request_completed (void *cls, struct MHD_Connection *connection, 113void request_completed (void *cls, struct MHD_Connection *connection,
114 void **con_cls, 114 void **req_cls,
115 enum MHD_RequestTerminationCode toe) 115 enum MHD_RequestTerminationCode toe)
116{ 116{
117 struct connection_info_struct *con_info = *con_cls; 117 struct connection_info_struct *con_info = *req_cls;
118 118
119 if (NULL == con_info) return; 119 if (NULL == con_info) return;
120 if (con_info->connectiontype == POST) 120 if (con_info->connectiontype == POST)
@@ -124,7 +124,7 @@ void request_completed (void *cls, struct MHD_Connection *connection,
124 } 124 }
125 125
126 free (con_info); 126 free (con_info);
127 *con_cls = NULL; 127 *req_cls = NULL;
128} 128}
129@end verbatim 129@end verbatim
130@noindent 130@noindent
@@ -155,9 +155,9 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
155 const char *url, 155 const char *url,
156 const char *method, const char *version, 156 const char *method, const char *version,
157 const char *upload_data, 157 const char *upload_data,
158 size_t *upload_data_size, void **con_cls) 158 size_t *upload_data_size, void **req_cls)
159{ 159{
160 if(NULL == *con_cls) 160 if(NULL == *req_cls)
161 { 161 {
162 struct connection_info_struct *con_info; 162 struct connection_info_struct *con_info;
163 163
@@ -190,7 +190,7 @@ of the request is stored for convenience.
190The address of our structure will both serve as the indicator for successive iterations and to remember 190The address of our structure will both serve as the indicator for successive iterations and to remember
191the particular details about the connection. 191the particular details about the connection.
192@verbatim 192@verbatim
193 *con_cls = (void*) con_info; 193 *req_cls = (void*) con_info;
194 return MHD_YES; 194 return MHD_YES;
195 } 195 }
196@end verbatim 196@end verbatim
@@ -212,7 +212,7 @@ considered---all of it.
212@verbatim 212@verbatim
213 if (0 == strcmp (method, "POST")) 213 if (0 == strcmp (method, "POST"))
214 { 214 {
215 struct connection_info_struct *con_info = *con_cls; 215 struct connection_info_struct *con_info = *req_cls;
216 216
217 if (*upload_data_size != 0) 217 if (*upload_data_size != 0)
218 { 218 {
diff --git a/doc/chapters/responseheaders.inc b/doc/chapters/responseheaders.inc
index 0b1c67e2..cd33e257 100644
--- a/doc/chapters/responseheaders.inc
+++ b/doc/chapters/responseheaders.inc
@@ -28,7 +28,7 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
28 const char *url, 28 const char *url,
29 const char *method, const char *version, 29 const char *method, const char *version,
30 const char *upload_data, 30 const char *upload_data,
31 size_t *upload_data_size, void **con_cls) 31 size_t *upload_data_size, void **req_cls)
32{ 32{
33 unsigned char *buffer = NULL; 33 unsigned char *buffer = NULL;
34 struct MHD_Response *response; 34 struct MHD_Response *response;
diff --git a/doc/chapters/websocket.inc b/doc/chapters/websocket.inc
index a480fd13..e1cbdc2b 100644
--- a/doc/chapters/websocket.inc
+++ b/doc/chapters/websocket.inc
@@ -122,7 +122,7 @@ per connection, could look like this:
122static void 122static void
123upgrade_handler (void *cls, 123upgrade_handler (void *cls,
124 struct MHD_Connection *connection, 124 struct MHD_Connection *connection,
125 void *con_cls, 125 void *req_cls,
126 const char *extra_in, 126 const char *extra_in,
127 size_t extra_in_size, 127 size_t extra_in_size,
128 MHD_socket fd, 128 MHD_socket fd,
@@ -501,7 +501,7 @@ callback function from an earlier example to a working websocket:
501static void 501static void
502upgrade_handler (void *cls, 502upgrade_handler (void *cls,
503 struct MHD_Connection *connection, 503 struct MHD_Connection *connection,
504 void *con_cls, 504 void *req_cls,
505 const char *extra_in, 505 const char *extra_in,
506 size_t extra_in_size, 506 size_t extra_in_size,
507 MHD_socket fd, 507 MHD_socket fd,
diff --git a/doc/examples/basicauthentication.c b/doc/examples/basicauthentication.c
index fffc728f..3b105a1d 100644
--- a/doc/examples/basicauthentication.c
+++ b/doc/examples/basicauthentication.c
@@ -21,7 +21,7 @@ static enum MHD_Result
21answer_to_connection (void *cls, struct MHD_Connection *connection, 21answer_to_connection (void *cls, struct MHD_Connection *connection,
22 const char *url, const char *method, 22 const char *url, const char *method,
23 const char *version, const char *upload_data, 23 const char *version, const char *upload_data,
24 size_t *upload_data_size, void **con_cls) 24 size_t *upload_data_size, void **req_cls)
25{ 25{
26 char *user; 26 char *user;
27 char *pass; 27 char *pass;
@@ -36,9 +36,9 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
36 36
37 if (0 != strcmp (method, "GET")) 37 if (0 != strcmp (method, "GET"))
38 return MHD_NO; 38 return MHD_NO;
39 if (NULL == *con_cls) 39 if (NULL == *req_cls)
40 { 40 {
41 *con_cls = connection; 41 *req_cls = connection;
42 return MHD_YES; 42 return MHD_YES;
43 } 43 }
44 pass = NULL; 44 pass = NULL;
diff --git a/doc/examples/hellobrowser.c b/doc/examples/hellobrowser.c
index 0c13c24d..b14ea6d8 100644
--- a/doc/examples/hellobrowser.c
+++ b/doc/examples/hellobrowser.c
@@ -18,7 +18,7 @@ static enum MHD_Result
18answer_to_connection (void *cls, struct MHD_Connection *connection, 18answer_to_connection (void *cls, struct MHD_Connection *connection,
19 const char *url, const char *method, 19 const char *url, const char *method,
20 const char *version, const char *upload_data, 20 const char *version, const char *upload_data,
21 size_t *upload_data_size, void **con_cls) 21 size_t *upload_data_size, void **req_cls)
22{ 22{
23 const char *page = "<html><body>Hello, browser!</body></html>"; 23 const char *page = "<html><body>Hello, browser!</body></html>";
24 struct MHD_Response *response; 24 struct MHD_Response *response;
@@ -29,7 +29,7 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
29 (void) version; /* Unused. Silent compiler warning. */ 29 (void) version; /* Unused. Silent compiler warning. */
30 (void) upload_data; /* Unused. Silent compiler warning. */ 30 (void) upload_data; /* Unused. Silent compiler warning. */
31 (void) upload_data_size; /* Unused. Silent compiler warning. */ 31 (void) upload_data_size; /* Unused. Silent compiler warning. */
32 (void) con_cls; /* Unused. Silent compiler warning. */ 32 (void) req_cls; /* Unused. Silent compiler warning. */
33 33
34 response = 34 response =
35 MHD_create_response_from_buffer (strlen (page), (void *) page, 35 MHD_create_response_from_buffer (strlen (page), (void *) page,
diff --git a/doc/examples/largepost.c b/doc/examples/largepost.c
index dc685745..58649508 100644
--- a/doc/examples/largepost.c
+++ b/doc/examples/largepost.c
@@ -181,10 +181,10 @@ iterate_post (void *coninfo_cls,
181static void 181static void
182request_completed (void *cls, 182request_completed (void *cls,
183 struct MHD_Connection *connection, 183 struct MHD_Connection *connection,
184 void **con_cls, 184 void **req_cls,
185 enum MHD_RequestTerminationCode toe) 185 enum MHD_RequestTerminationCode toe)
186{ 186{
187 struct connection_info_struct *con_info = *con_cls; 187 struct connection_info_struct *con_info = *req_cls;
188 (void) cls; /* Unused. Silent compiler warning. */ 188 (void) cls; /* Unused. Silent compiler warning. */
189 (void) connection; /* Unused. Silent compiler warning. */ 189 (void) connection; /* Unused. Silent compiler warning. */
190 (void) toe; /* Unused. Silent compiler warning. */ 190 (void) toe; /* Unused. Silent compiler warning. */
@@ -205,7 +205,7 @@ request_completed (void *cls,
205 } 205 }
206 206
207 free (con_info); 207 free (con_info);
208 *con_cls = NULL; 208 *req_cls = NULL;
209} 209}
210 210
211 211
@@ -217,13 +217,13 @@ answer_to_connection (void *cls,
217 const char *version, 217 const char *version,
218 const char *upload_data, 218 const char *upload_data,
219 size_t *upload_data_size, 219 size_t *upload_data_size,
220 void **con_cls) 220 void **req_cls)
221{ 221{
222 (void) cls; /* Unused. Silent compiler warning. */ 222 (void) cls; /* Unused. Silent compiler warning. */
223 (void) url; /* Unused. Silent compiler warning. */ 223 (void) url; /* Unused. Silent compiler warning. */
224 (void) version; /* Unused. Silent compiler warning. */ 224 (void) version; /* Unused. Silent compiler warning. */
225 225
226 if (NULL == *con_cls) 226 if (NULL == *req_cls)
227 { 227 {
228 /* First call, setup data structures */ 228 /* First call, setup data structures */
229 struct connection_info_struct *con_info; 229 struct connection_info_struct *con_info;
@@ -262,7 +262,7 @@ answer_to_connection (void *cls,
262 con_info->connectiontype = GET; 262 con_info->connectiontype = GET;
263 } 263 }
264 264
265 *con_cls = (void *) con_info; 265 *req_cls = (void *) con_info;
266 266
267 return MHD_YES; 267 return MHD_YES;
268 } 268 }
@@ -283,7 +283,7 @@ answer_to_connection (void *cls,
283 283
284 if (0 == strcasecmp (method, MHD_HTTP_METHOD_POST)) 284 if (0 == strcasecmp (method, MHD_HTTP_METHOD_POST))
285 { 285 {
286 struct connection_info_struct *con_info = *con_cls; 286 struct connection_info_struct *con_info = *req_cls;
287 287
288 if (0 != *upload_data_size) 288 if (0 != *upload_data_size)
289 { 289 {
diff --git a/doc/examples/logging.c b/doc/examples/logging.c
index 22ff7e62..0db2e2ef 100644
--- a/doc/examples/logging.c
+++ b/doc/examples/logging.c
@@ -29,13 +29,13 @@ static enum MHD_Result
29answer_to_connection (void *cls, struct MHD_Connection *connection, 29answer_to_connection (void *cls, struct MHD_Connection *connection,
30 const char *url, const char *method, 30 const char *url, const char *method,
31 const char *version, const char *upload_data, 31 const char *version, const char *upload_data,
32 size_t *upload_data_size, void **con_cls) 32 size_t *upload_data_size, void **req_cls)
33{ 33{
34 (void) cls; /* Unused. Silent compiler warning. */ 34 (void) cls; /* Unused. Silent compiler warning. */
35 (void) version; /* Unused. Silent compiler warning. */ 35 (void) version; /* Unused. Silent compiler warning. */
36 (void) upload_data; /* Unused. Silent compiler warning. */ 36 (void) upload_data; /* Unused. Silent compiler warning. */
37 (void) upload_data_size; /* Unused. Silent compiler warning. */ 37 (void) upload_data_size; /* Unused. Silent compiler warning. */
38 (void) con_cls; /* Unused. Silent compiler warning. */ 38 (void) req_cls; /* Unused. Silent compiler warning. */
39 printf ("New %s request for %s using version %s\n", method, url, version); 39 printf ("New %s request for %s using version %s\n", method, url, version);
40 40
41 MHD_get_connection_values (connection, MHD_HEADER_KIND, print_out_key, 41 MHD_get_connection_values (connection, MHD_HEADER_KIND, print_out_key,
diff --git a/doc/examples/responseheaders.c b/doc/examples/responseheaders.c
index f1cf939c..80eebbe9 100644
--- a/doc/examples/responseheaders.c
+++ b/doc/examples/responseheaders.c
@@ -23,7 +23,7 @@ static enum MHD_Result
23answer_to_connection (void *cls, struct MHD_Connection *connection, 23answer_to_connection (void *cls, struct MHD_Connection *connection,
24 const char *url, const char *method, 24 const char *url, const char *method,
25 const char *version, const char *upload_data, 25 const char *version, const char *upload_data,
26 size_t *upload_data_size, void **con_cls) 26 size_t *upload_data_size, void **req_cls)
27{ 27{
28 struct MHD_Response *response; 28 struct MHD_Response *response;
29 int fd; 29 int fd;
@@ -34,7 +34,7 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
34 (void) version; /* Unused. Silent compiler warning. */ 34 (void) version; /* Unused. Silent compiler warning. */
35 (void) upload_data; /* Unused. Silent compiler warning. */ 35 (void) upload_data; /* Unused. Silent compiler warning. */
36 (void) upload_data_size; /* Unused. Silent compiler warning. */ 36 (void) upload_data_size; /* Unused. Silent compiler warning. */
37 (void) con_cls; /* Unused. Silent compiler warning. */ 37 (void) req_cls; /* Unused. Silent compiler warning. */
38 38
39 if (0 != strcmp (method, "GET")) 39 if (0 != strcmp (method, "GET"))
40 return MHD_NO; 40 return MHD_NO;
diff --git a/doc/examples/sessions.c b/doc/examples/sessions.c
index db311bd4..5dd74e2c 100644
--- a/doc/examples/sessions.c
+++ b/doc/examples/sessions.c
@@ -548,7 +548,7 @@ post_iterator (void *cls,
548 * @param upload_data_size set initially to the size of the 548 * @param upload_data_size set initially to the size of the
549 * upload_data provided; the method must update this 549 * upload_data provided; the method must update this
550 * value to the number of bytes NOT processed; 550 * value to the number of bytes NOT processed;
551 * @param ptr pointer that the callback can set to some 551 * @param req_cls pointer that the callback can set to some
552 * address and that will be preserved by MHD for future 552 * address and that will be preserved by MHD for future
553 * calls for this request; since the access handler may 553 * calls for this request; since the access handler may
554 * be called many times (i.e., for a PUT/POST operation 554 * be called many times (i.e., for a PUT/POST operation
@@ -557,7 +557,7 @@ post_iterator (void *cls,
557 * If necessary, this state can be cleaned up in the 557 * If necessary, this state can be cleaned up in the
558 * global "MHD_RequestCompleted" callback (which 558 * global "MHD_RequestCompleted" callback (which
559 * can be set with the MHD_OPTION_NOTIFY_COMPLETED). 559 * can be set with the MHD_OPTION_NOTIFY_COMPLETED).
560 * Initially, <tt>*con_cls</tt> will be NULL. 560 * Initially, <tt>*req_cls</tt> will be NULL.
561 * @return MHS_YES if the connection was handled successfully, 561 * @return MHS_YES if the connection was handled successfully,
562 * MHS_NO if the socket must be closed due to a serious 562 * MHS_NO if the socket must be closed due to a serious
563 * error while handling the request 563 * error while handling the request
@@ -570,7 +570,7 @@ create_response (void *cls,
570 const char *version, 570 const char *version,
571 const char *upload_data, 571 const char *upload_data,
572 size_t *upload_data_size, 572 size_t *upload_data_size,
573 void **ptr) 573 void **req_cls)
574{ 574{
575 struct MHD_Response *response; 575 struct MHD_Response *response;
576 struct Request *request; 576 struct Request *request;
@@ -580,7 +580,7 @@ create_response (void *cls,
580 (void) cls; /* Unused. Silent compiler warning. */ 580 (void) cls; /* Unused. Silent compiler warning. */
581 (void) version; /* Unused. Silent compiler warning. */ 581 (void) version; /* Unused. Silent compiler warning. */
582 582
583 request = *ptr; 583 request = *req_cls;
584 if (NULL == request) 584 if (NULL == request)
585 { 585 {
586 request = calloc (1, sizeof (struct Request)); 586 request = calloc (1, sizeof (struct Request));
@@ -589,7 +589,7 @@ create_response (void *cls,
589 fprintf (stderr, "calloc error: %s\n", strerror (errno)); 589 fprintf (stderr, "calloc error: %s\n", strerror (errno));
590 return MHD_NO; 590 return MHD_NO;
591 } 591 }
592 *ptr = request; 592 *req_cls = request;
593 if (0 == strcmp (method, MHD_HTTP_METHOD_POST)) 593 if (0 == strcmp (method, MHD_HTTP_METHOD_POST))
594 { 594 {
595 request->pp = MHD_create_post_processor (connection, 1024, 595 request->pp = MHD_create_post_processor (connection, 1024,
@@ -668,16 +668,16 @@ create_response (void *cls,
668 * 668 *
669 * @param cls not used 669 * @param cls not used
670 * @param connection connection that completed 670 * @param connection connection that completed
671 * @param con_cls session handle 671 * @param req_cls session handle
672 * @param toe status code 672 * @param toe status code
673 */ 673 */
674static void 674static void
675request_completed_callback (void *cls, 675request_completed_callback (void *cls,
676 struct MHD_Connection *connection, 676 struct MHD_Connection *connection,
677 void **con_cls, 677 void **req_cls,
678 enum MHD_RequestTerminationCode toe) 678 enum MHD_RequestTerminationCode toe)
679{ 679{
680 struct Request *request = *con_cls; 680 struct Request *request = *req_cls;
681 (void) cls; /* Unused. Silent compiler warning. */ 681 (void) cls; /* Unused. Silent compiler warning. */
682 (void) connection; /* Unused. Silent compiler warning. */ 682 (void) connection; /* Unused. Silent compiler warning. */
683 (void) toe; /* Unused. Silent compiler warning. */ 683 (void) toe; /* Unused. Silent compiler warning. */
diff --git a/doc/examples/simplepost.c b/doc/examples/simplepost.c
index 1e52e5dd..ea3899d1 100644
--- a/doc/examples/simplepost.c
+++ b/doc/examples/simplepost.c
@@ -105,9 +105,9 @@ iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key,
105 105
106static void 106static void
107request_completed (void *cls, struct MHD_Connection *connection, 107request_completed (void *cls, struct MHD_Connection *connection,
108 void **con_cls, enum MHD_RequestTerminationCode toe) 108 void **req_cls, enum MHD_RequestTerminationCode toe)
109{ 109{
110 struct connection_info_struct *con_info = *con_cls; 110 struct connection_info_struct *con_info = *req_cls;
111 (void) cls; /* Unused. Silent compiler warning. */ 111 (void) cls; /* Unused. Silent compiler warning. */
112 (void) connection; /* Unused. Silent compiler warning. */ 112 (void) connection; /* Unused. Silent compiler warning. */
113 (void) toe; /* Unused. Silent compiler warning. */ 113 (void) toe; /* Unused. Silent compiler warning. */
@@ -123,7 +123,7 @@ request_completed (void *cls, struct MHD_Connection *connection,
123 } 123 }
124 124
125 free (con_info); 125 free (con_info);
126 *con_cls = NULL; 126 *req_cls = NULL;
127} 127}
128 128
129 129
@@ -131,13 +131,13 @@ static enum MHD_Result
131answer_to_connection (void *cls, struct MHD_Connection *connection, 131answer_to_connection (void *cls, struct MHD_Connection *connection,
132 const char *url, const char *method, 132 const char *url, const char *method,
133 const char *version, const char *upload_data, 133 const char *version, const char *upload_data,
134 size_t *upload_data_size, void **con_cls) 134 size_t *upload_data_size, void **req_cls)
135{ 135{
136 (void) cls; /* Unused. Silent compiler warning. */ 136 (void) cls; /* Unused. Silent compiler warning. */
137 (void) url; /* Unused. Silent compiler warning. */ 137 (void) url; /* Unused. Silent compiler warning. */
138 (void) version; /* Unused. Silent compiler warning. */ 138 (void) version; /* Unused. Silent compiler warning. */
139 139
140 if (NULL == *con_cls) 140 if (NULL == *req_cls)
141 { 141 {
142 struct connection_info_struct *con_info; 142 struct connection_info_struct *con_info;
143 143
@@ -163,7 +163,7 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
163 else 163 else
164 con_info->connectiontype = GET; 164 con_info->connectiontype = GET;
165 165
166 *con_cls = (void *) con_info; 166 *req_cls = (void *) con_info;
167 167
168 return MHD_YES; 168 return MHD_YES;
169 } 169 }
@@ -175,7 +175,7 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
175 175
176 if (0 == strcmp (method, "POST")) 176 if (0 == strcmp (method, "POST"))
177 { 177 {
178 struct connection_info_struct *con_info = *con_cls; 178 struct connection_info_struct *con_info = *req_cls;
179 179
180 if (*upload_data_size != 0) 180 if (*upload_data_size != 0)
181 { 181 {
diff --git a/doc/examples/tlsauthentication.c b/doc/examples/tlsauthentication.c
index b31eab43..4db00b7f 100644
--- a/doc/examples/tlsauthentication.c
+++ b/doc/examples/tlsauthentication.c
@@ -225,7 +225,7 @@ static enum MHD_Result
225answer_to_connection (void *cls, struct MHD_Connection *connection, 225answer_to_connection (void *cls, struct MHD_Connection *connection,
226 const char *url, const char *method, 226 const char *url, const char *method,
227 const char *version, const char *upload_data, 227 const char *version, const char *upload_data,
228 size_t *upload_data_size, void **con_cls) 228 size_t *upload_data_size, void **req_cls)
229{ 229{
230 (void) cls; /* Unused. Silent compiler warning. */ 230 (void) cls; /* Unused. Silent compiler warning. */
231 (void) url; /* Unused. Silent compiler warning. */ 231 (void) url; /* Unused. Silent compiler warning. */
@@ -235,9 +235,9 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
235 235
236 if (0 != strcmp (method, "GET")) 236 if (0 != strcmp (method, "GET"))
237 return MHD_NO; 237 return MHD_NO;
238 if (NULL == *con_cls) 238 if (NULL == *req_cls)
239 { 239 {
240 *con_cls = connection; 240 *req_cls = connection;
241 return MHD_YES; 241 return MHD_YES;
242 } 242 }
243 243
diff --git a/doc/examples/websocket.c b/doc/examples/websocket.c
index 4fa6f4ed..5cdf0423 100644
--- a/doc/examples/websocket.c
+++ b/doc/examples/websocket.c
@@ -80,7 +80,7 @@ make_blocking (MHD_socket fd);
80static void 80static void
81upgrade_handler (void *cls, 81upgrade_handler (void *cls,
82 struct MHD_Connection *connection, 82 struct MHD_Connection *connection,
83 void *con_cls, 83 void *req_cls,
84 const char *extra_in, 84 const char *extra_in,
85 size_t extra_in_size, 85 size_t extra_in_size,
86 MHD_socket fd, 86 MHD_socket fd,
@@ -307,7 +307,7 @@ access_handler (void *cls,
307 const char *version, 307 const char *version,
308 const char *upload_data, 308 const char *upload_data,
309 size_t *upload_data_size, 309 size_t *upload_data_size,
310 void **ptr) 310 void **req_cls)
311{ 311{
312 static int aptr; 312 static int aptr;
313 struct MHD_Response *response; 313 struct MHD_Response *response;
@@ -319,13 +319,13 @@ access_handler (void *cls,
319 319
320 if (0 != strcmp (method, "GET")) 320 if (0 != strcmp (method, "GET"))
321 return MHD_NO; /* unexpected method */ 321 return MHD_NO; /* unexpected method */
322 if (&aptr != *ptr) 322 if (&aptr != *req_cls)
323 { 323 {
324 /* do never respond on first call */ 324 /* do never respond on first call */
325 *ptr = &aptr; 325 *req_cls = &aptr;
326 return MHD_YES; 326 return MHD_YES;
327 } 327 }
328 *ptr = NULL; /* reset when done */ 328 *req_cls = NULL; /* reset when done */
329 329
330 if (0 == strcmp (url, "/")) 330 if (0 == strcmp (url, "/"))
331 { 331 {
diff --git a/doc/libmicrohttpd.texi b/doc/libmicrohttpd.texi
index a6bd12eb..a14c28d3 100644
--- a/doc/libmicrohttpd.texi
+++ b/doc/libmicrohttpd.texi
@@ -734,18 +734,15 @@ callback. The second pointer maybe @code{NULL}.
734 734
735@item MHD_OPTION_NOTIFY_CONNECTION 735@item MHD_OPTION_NOTIFY_CONNECTION
736Register a function that should be called when the TCP connection to a 736Register a function that should be called when the TCP connection to a
737client is opened or closed. Note that 737client is opened or closed. The registered callback is called twice per
738@code{MHD_OPTION_NOTIFY_COMPLETED} and the @code{con_cls} argument to 738TCP connection, with @code{MHD_CONNECTION_NOTIFY_STARTED} and
739the @code{MHD_AccessHandlerCallback} are per HTTP request (and there 739@code{MHD_CONNECTION_NOTIFY_CLOSED} respectively. An additional
740can be multiple HTTP requests per TCP connection). The registered
741callback is called twice per TCP connection, with
742@code{MHD_CONNECTION_NOTIFY_STARTED} and
743@code{MHD_CONNECTION_NOTIFY_CLOSED} respectively. An additional
744argument can be used to store TCP connection specific information, 740argument can be used to store TCP connection specific information,
745which can be retrieved using @code{MHD_CONNECTION_INFO_SOCKET_CONTEXT} 741which can be retrieved using @code{MHD_CONNECTION_INFO_SOCKET_CONTEXT}
746during the lifetime of the TCP connection. The respective location is 742during the lifetime of the TCP connection.
747not the same as the HTTP-request-specific @code{con_cls} from the 743Note @code{MHD_OPTION_NOTIFY_COMPLETED} and the @code{req_cls} argument
748@code{MHD_AccessHandlerCallback}. 744to the @code{MHD_AccessHandlerCallback} are per HTTP request (and there
745can be multiple HTTP requests per TCP connection).
749 746
750This option should be followed by @strong{TWO} pointers. First a 747This option should be followed by @strong{TWO} pointers. First a
751pointer to a function of type @code{MHD_NotifyConnectionCallback()} 748pointer to a function of type @code{MHD_NotifyConnectionCallback()}
@@ -820,12 +817,12 @@ one must be of the form
820 void * my_logger(void * cls, const char * uri, struct MHD_Connection *con) 817 void * my_logger(void * cls, const char * uri, struct MHD_Connection *con)
821@end example 818@end example
822where the return value will be passed as 819where the return value will be passed as
823@code{*con_cls} in calls to the @code{MHD_AccessHandlerCallback} 820@code{*req_cls} in calls to the @code{MHD_AccessHandlerCallback}
824when this request is processed later; returning a 821when this request is processed later; returning a
825value of @code{NULL} has no special significance; (however, 822value of @code{NULL} has no special significance; (however,
826note that if you return non-@code{NULL}, you can no longer 823note that if you return non-@code{NULL}, you can no longer
827rely on the first call to the access handler having 824rely on the first call to the access handler having
828@code{NULL == *con_cls} on entry) 825@code{NULL == *req_cls} on entry)
829@code{cls} will be set to the second argument following 826@code{cls} will be set to the second argument following
830MHD_OPTION_URI_LOG_CALLBACK. Finally, @code{uri} will 827MHD_OPTION_URI_LOG_CALLBACK. Finally, @code{uri} will
831be the 0-terminated URI of the request. 828be the 0-terminated URI of the request.
@@ -1808,7 +1805,7 @@ length of the address information.
1808@end deftypefn 1805@end deftypefn
1809 1806
1810 1807
1811@deftypefn {Function Pointer} enum MHD_Result {*MHD_AccessHandlerCallback} (void *cls, struct MHD_Connection * connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls) 1808@deftypefn {Function Pointer} enum MHD_Result {*MHD_AccessHandlerCallback} (void *cls, struct MHD_Connection * connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **req_cls)
1812Invoked in the context of a connection to answer a request from the 1809Invoked in the context of a connection to answer a request from the
1813client. This callback must call MHD functions (example: the 1810client. This callback must call MHD functions (example: the
1814@code{MHD_Response} ones) to provide content to give back to the client 1811@code{MHD_Response} ones) to provide content to give back to the client
@@ -1874,7 +1871,7 @@ and return an internal server error to the client. In order to
1874avoid this, clients must be able to process upload data incrementally 1871avoid this, clients must be able to process upload data incrementally
1875and reduce the value of @code{upload_data_size}. 1872and reduce the value of @code{upload_data_size}.
1876 1873
1877@item con_cls 1874@item req_cls
1878reference to a pointer, initially set to @code{NULL}, that this callback can 1875reference to a pointer, initially set to @code{NULL}, that this callback can
1879set to some address and that will be preserved by MHD for future 1876set to some address and that will be preserved by MHD for future
1880calls for this request; 1877calls for this request;
@@ -1890,7 +1887,7 @@ if necessary, this state can be cleaned up in the global
1890@end deftypefn 1887@end deftypefn
1891 1888
1892 1889
1893@deftypefn {Function Pointer} void {*MHD_RequestCompletedCallback} (void *cls, struct MHD_Connectionconnection, void **con_cls, enum MHD_RequestTerminationCode toe) 1890@deftypefn {Function Pointer} void {*MHD_RequestCompletedCallback} (void *cls, struct MHD_Connectionconnection, void **req_cls, enum MHD_RequestTerminationCode toe)
1894Signature of the callback used by MHD to notify the application about 1891Signature of the callback used by MHD to notify the application about
1895completed requests. 1892completed requests.
1896 1893
@@ -1901,7 +1898,7 @@ custom value selected at callback registration time;
1901@item connection 1898@item connection
1902connection handle; 1899connection handle;
1903 1900
1904@item con_cls 1901@item req_cls
1905value as set by the last call to the 1902value as set by the last call to the
1906@code{MHD_AccessHandlerCallback}; 1903@code{MHD_AccessHandlerCallback};
1907 1904
@@ -2944,8 +2941,8 @@ matches the @code{upgrade_handler_cls} that was given to @code{MHD_create_respon
2944@item connection 2941@item connection
2945identifies the connection that is being upgraded; 2942identifies the connection that is being upgraded;
2946 2943
2947@item con_cls 2944@item req_cls
2948last value left in `*con_cls` in the `MHD_AccessHandlerCallback` 2945last value left in `*req_cls` in the `MHD_AccessHandlerCallback`
2949 2946
2950@item extra_in 2947@item extra_in
2951buffer of bytes MHD read ``by accident'' from the socket already. This can happen if the client eagerly transmits more than just the HTTP request. The application should treat these as if it had read them from the socket. 2948buffer of bytes MHD read ``by accident'' from the socket already. This can happen if the client eagerly transmits more than just the HTTP request. The application should treat these as if it had read them from the socket.
@@ -3377,15 +3374,15 @@ process data as it arrives; at each invocation a new chunk of data must
3377be processed. The arguments @var{upload_data} and @var{upload_data_size} 3374be processed. The arguments @var{upload_data} and @var{upload_data_size}
3378are used to reference the chunk of data. 3375are used to reference the chunk of data.
3379 3376
3380When @code{MHD_AccessHandlerCallback} is invoked for a new connection: 3377When @code{MHD_AccessHandlerCallback} is invoked for a new request:
3381its @code{*@var{con_cls}} argument is set to @code{NULL}. When @code{POST} 3378its @code{*@var{req_cls}} argument is set to @code{NULL}. When @code{POST}
3382data comes in the upload buffer it is @strong{mandatory} to use the 3379data comes in the upload buffer it is @strong{mandatory} to use the
3383@var{con_cls} to store a reference to per-connection data. The fact 3380@var{req_cls} to store a reference to per-request data. The fact
3384that the pointer was initially @code{NULL} can be used to detect that 3381that the pointer was initially @code{NULL} can be used to detect that
3385this is a new request. 3382this is a new request.
3386 3383
3387One method to detect that a new connection was established is 3384One method to detect that a new request was started is
3388to set @code{*con_cls} to an unused integer: 3385to set @code{*req_cls} to an unused integer:
3389 3386
3390@example 3387@example
3391int 3388int
@@ -3394,15 +3391,15 @@ access_handler (void *cls,
3394 const char *url, 3391 const char *url,
3395 const char *method, const char *version, 3392 const char *method, const char *version,
3396 const char *upload_data, size_t *upload_data_size, 3393 const char *upload_data, size_t *upload_data_size,
3397 void **con_cls) 3394 void **req_cls)
3398@{ 3395@{
3399 static int old_connection_marker; 3396 static int old_connection_marker;
3400 int new_connection = (NULL == *con_cls); 3397 int new_connection = (NULL == *req_cls);
3401 3398
3402 if (new_connection) 3399 if (new_connection)
3403 @{ 3400 @{
3404 /* new connection with POST */ 3401 /* new connection with POST */
3405 *con_cls = &old_connection_marker; 3402 *req_cls = &old_connection_marker;
3406 @} 3403 @}
3407 3404
3408 ... 3405 ...
@@ -3411,7 +3408,7 @@ access_handler (void *cls,
3411 3408
3412@noindent 3409@noindent
3413In contrast to the previous example, for @code{POST} requests in particular, 3410In contrast to the previous example, for @code{POST} requests in particular,
3414it is more common to use the value of @code{*con_cls} to keep track of 3411it is more common to use the value of @code{*req_cls} to keep track of
3415actual state used during processing, such as the post processor (or a 3412actual state used during processing, such as the post processor (or a
3416struct containing a post processor): 3413struct containing a post processor):
3417 3414
@@ -3422,14 +3419,14 @@ access_handler (void *cls,
3422 const char *url, 3419 const char *url,
3423 const char *method, const char *version, 3420 const char *method, const char *version,
3424 const char *upload_data, size_t *upload_data_size, 3421 const char *upload_data, size_t *upload_data_size,
3425 void **con_cls) 3422 void **req_cls)
3426@{ 3423@{
3427 struct MHD_PostProcessor * pp = *con_cls; 3424 struct MHD_PostProcessor * pp = *req_cls;
3428 3425
3429 if (pp == NULL) 3426 if (pp == NULL)
3430 @{ 3427 @{
3431 pp = MHD_create_post_processor(connection, ...); 3428 pp = MHD_create_post_processor(connection, ...);
3432 *con_cls = pp; 3429 *req_cls = pp;
3433 return MHD_YES; 3430 return MHD_YES;
3434 @} 3431 @}
3435 if (*upload_data_size) 3432 if (*upload_data_size)
@@ -3719,8 +3716,8 @@ Takes no extra arguments.
3719Returns the client-specific pointer to a @code{void *} that was 3716Returns the client-specific pointer to a @code{void *} that was
3720(possibly) set during a @code{MHD_NotifyConnectionCallback} when the 3717(possibly) set during a @code{MHD_NotifyConnectionCallback} when the
3721socket was first accepted. Note that this is NOT the same as the 3718socket was first accepted. Note that this is NOT the same as the
3722@code{con_cls} argument of the @code{MHD_AccessHandlerCallback}. The 3719@code{req_cls} argument of the @code{MHD_AccessHandlerCallback}. The
3723@code{con_cls} is fresh for each HTTP request, while the 3720@code{req_cls} is fresh for each HTTP request, while the
3724@code{socket_context} is fresh for each socket. 3721@code{socket_context} is fresh for each socket.
3725 3722
3726Takes no extra arguments. 3723Takes no extra arguments.
diff --git a/src/examples/authorization_example.c b/src/examples/authorization_example.c
index f9500325..e7a099ed 100644
--- a/src/examples/authorization_example.c
+++ b/src/examples/authorization_example.c
@@ -45,7 +45,7 @@ ahc_echo (void *cls,
45 const char *url, 45 const char *url,
46 const char *method, 46 const char *method,
47 const char *version, 47 const char *version,
48 const char *upload_data, size_t *upload_data_size, void **ptr) 48 const char *upload_data, size_t *upload_data_size, void **req_cls)
49{ 49{
50 static int aptr; 50 static int aptr;
51 const char *me = cls; 51 const char *me = cls;
@@ -61,13 +61,13 @@ ahc_echo (void *cls,
61 61
62 if (0 != strcmp (method, "GET")) 62 if (0 != strcmp (method, "GET"))
63 return MHD_NO; /* unexpected method */ 63 return MHD_NO; /* unexpected method */
64 if (&aptr != *ptr) 64 if (&aptr != *req_cls)
65 { 65 {
66 /* do never respond on first call */ 66 /* do never respond on first call */
67 *ptr = &aptr; 67 *req_cls = &aptr;
68 return MHD_YES; 68 return MHD_YES;
69 } 69 }
70 *ptr = NULL; /* reset when done */ 70 *req_cls = NULL; /* reset when done */
71 71
72 /* require: "Aladdin" with password "open sesame" */ 72 /* require: "Aladdin" with password "open sesame" */
73 pass = NULL; 73 pass = NULL;
diff --git a/src/examples/benchmark.c b/src/examples/benchmark.c
index a579d42b..185e3824 100644
--- a/src/examples/benchmark.c
+++ b/src/examples/benchmark.c
@@ -62,7 +62,7 @@ static struct MHD_Response *response;
62 * 62 *
63 * @param cls client-defined closure 63 * @param cls client-defined closure
64 * @param connection connection handle 64 * @param connection connection handle
65 * @param con_cls value as set by the last call to 65 * @param req_cls value as set by the last call to
66 * the MHD_AccessHandlerCallback 66 * the MHD_AccessHandlerCallback
67 * @param toe reason for request termination 67 * @param toe reason for request termination
68 * @see MHD_OPTION_NOTIFY_COMPLETED 68 * @see MHD_OPTION_NOTIFY_COMPLETED
@@ -70,10 +70,10 @@ static struct MHD_Response *response;
70static void 70static void
71completed_callback (void *cls, 71completed_callback (void *cls,
72 struct MHD_Connection *connection, 72 struct MHD_Connection *connection,
73 void **con_cls, 73 void **req_cls,
74 enum MHD_RequestTerminationCode toe) 74 enum MHD_RequestTerminationCode toe)
75{ 75{
76 struct timeval *tv = *con_cls; 76 struct timeval *tv = *req_cls;
77 struct timeval tve; 77 struct timeval tve;
78 uint64_t delta; 78 uint64_t delta;
79 (void) cls; /* Unused. Silent compiler warning. */ 79 (void) cls; /* Unused. Silent compiler warning. */
@@ -119,14 +119,14 @@ ahc_echo (void *cls,
119 const char *url, 119 const char *url,
120 const char *method, 120 const char *method,
121 const char *version, 121 const char *version,
122 const char *upload_data, size_t *upload_data_size, void **ptr) 122 const char *upload_data, size_t *upload_data_size, void **req_cls)
123{ 123{
124 (void) cls; /* Unused. Silent compiler warning. */ 124 (void) cls; /* Unused. Silent compiler warning. */
125 (void) url; /* Unused. Silent compiler warning. */ 125 (void) url; /* Unused. Silent compiler warning. */
126 (void) version; /* Unused. Silent compiler warning. */ 126 (void) version; /* Unused. Silent compiler warning. */
127 (void) upload_data; /* Unused. Silent compiler warning. */ 127 (void) upload_data; /* Unused. Silent compiler warning. */
128 (void) upload_data_size; /* Unused. Silent compiler warning. */ 128 (void) upload_data_size; /* Unused. Silent compiler warning. */
129 (void) ptr; /* Unused. Silent compiler warning. */ 129 (void) req_cls; /* Unused. Silent compiler warning. */
130 130
131 if (0 != strcmp (method, "GET")) 131 if (0 != strcmp (method, "GET"))
132 return MHD_NO; /* unexpected method */ 132 return MHD_NO; /* unexpected method */
diff --git a/src/examples/benchmark_https.c b/src/examples/benchmark_https.c
index ddc3be19..36a46aa8 100644
--- a/src/examples/benchmark_https.c
+++ b/src/examples/benchmark_https.c
@@ -62,7 +62,7 @@ static struct MHD_Response *response;
62 * 62 *
63 * @param cls client-defined closure 63 * @param cls client-defined closure
64 * @param connection connection handle 64 * @param connection connection handle
65 * @param con_cls value as set by the last call to 65 * @param req_cls value as set by the last call to
66 * the MHD_AccessHandlerCallback 66 * the MHD_AccessHandlerCallback
67 * @param toe reason for request termination 67 * @param toe reason for request termination
68 * @see MHD_OPTION_NOTIFY_COMPLETED 68 * @see MHD_OPTION_NOTIFY_COMPLETED
@@ -70,10 +70,10 @@ static struct MHD_Response *response;
70static void 70static void
71completed_callback (void *cls, 71completed_callback (void *cls,
72 struct MHD_Connection *connection, 72 struct MHD_Connection *connection,
73 void **con_cls, 73 void **req_cls,
74 enum MHD_RequestTerminationCode toe) 74 enum MHD_RequestTerminationCode toe)
75{ 75{
76 struct timeval *tv = *con_cls; 76 struct timeval *tv = *req_cls;
77 struct timeval tve; 77 struct timeval tve;
78 uint64_t delta; 78 uint64_t delta;
79 (void) cls; /* Unused. Silent compiler warning. */ 79 (void) cls; /* Unused. Silent compiler warning. */
@@ -119,14 +119,14 @@ ahc_echo (void *cls,
119 const char *url, 119 const char *url,
120 const char *method, 120 const char *method,
121 const char *version, 121 const char *version,
122 const char *upload_data, size_t *upload_data_size, void **ptr) 122 const char *upload_data, size_t *upload_data_size, void **req_cls)
123{ 123{
124 (void) cls; /* Unused. Silent compiler warning. */ 124 (void) cls; /* Unused. Silent compiler warning. */
125 (void) url; /* Unused. Silent compiler warning. */ 125 (void) url; /* Unused. Silent compiler warning. */
126 (void) version; /* Unused. Silent compiler warning. */ 126 (void) version; /* Unused. Silent compiler warning. */
127 (void) upload_data; /* Unused. Silent compiler warning. */ 127 (void) upload_data; /* Unused. Silent compiler warning. */
128 (void) upload_data_size; /* Unused. Silent compiler warning. */ 128 (void) upload_data_size; /* Unused. Silent compiler warning. */
129 (void) ptr; /* Unused. Silent compiler warning. */ 129 (void) req_cls; /* Unused. Silent compiler warning. */
130 130
131 if (0 != strcmp (method, "GET")) 131 if (0 != strcmp (method, "GET"))
132 return MHD_NO; /* unexpected method */ 132 return MHD_NO; /* unexpected method */
diff --git a/src/examples/chunked_example.c b/src/examples/chunked_example.c
index 68b7ea1e..5a4c0ced 100644
--- a/src/examples/chunked_example.c
+++ b/src/examples/chunked_example.c
@@ -97,7 +97,7 @@ ahc_echo (void *cls,
97 const char *version, 97 const char *version,
98 const char *upload_data, 98 const char *upload_data,
99 size_t *upload_data_size, 99 size_t *upload_data_size,
100 void **ptr) 100 void **req_cls)
101{ 101{
102 static int aptr; 102 static int aptr;
103 struct ResponseContentCallbackParam *callback_param; 103 struct ResponseContentCallbackParam *callback_param;
@@ -111,10 +111,10 @@ ahc_echo (void *cls,
111 111
112 if (0 != strcmp (method, "GET")) 112 if (0 != strcmp (method, "GET"))
113 return MHD_NO; /* unexpected method */ 113 return MHD_NO; /* unexpected method */
114 if (&aptr != *ptr) 114 if (&aptr != *req_cls)
115 { 115 {
116 /* do never respond on first call */ 116 /* do never respond on first call */
117 *ptr = &aptr; 117 *req_cls = &aptr;
118 return MHD_YES; 118 return MHD_YES;
119 } 119 }
120 120
@@ -126,7 +126,7 @@ ahc_echo (void *cls,
126 callback_param->response_size = (sizeof(simple_response_text) 126 callback_param->response_size = (sizeof(simple_response_text)
127 / sizeof(char)) - 1; 127 / sizeof(char)) - 1;
128 128
129 *ptr = NULL; /* reset when done */ 129 *req_cls = NULL; /* reset when done */
130 response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, 130 response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN,
131 1024, 131 1024,
132 &callback, 132 &callback,
diff --git a/src/examples/connection_close.c b/src/examples/connection_close.c
index 5629a687..e5f787a3 100644
--- a/src/examples/connection_close.c
+++ b/src/examples/connection_close.c
@@ -41,7 +41,7 @@ ahc_echo (void *cls,
41 const char *url, 41 const char *url,
42 const char *method, 42 const char *method,
43 const char *version, 43 const char *version,
44 const char *upload_data, size_t *upload_data_size, void **ptr) 44 const char *upload_data, size_t *upload_data_size, void **req_cls)
45{ 45{
46 static int aptr; 46 static int aptr;
47 const char *me = cls; 47 const char *me = cls;
@@ -54,13 +54,13 @@ ahc_echo (void *cls,
54 54
55 if (0 != strcmp (method, "GET")) 55 if (0 != strcmp (method, "GET"))
56 return MHD_NO; /* unexpected method */ 56 return MHD_NO; /* unexpected method */
57 if (&aptr != *ptr) 57 if (&aptr != *req_cls)
58 { 58 {
59 /* do never respond on first call */ 59 /* do never respond on first call */
60 *ptr = &aptr; 60 *req_cls = &aptr;
61 return MHD_YES; 61 return MHD_YES;
62 } 62 }
63 *ptr = NULL; /* reset when done */ 63 *req_cls = NULL; /* reset when done */
64 response = MHD_create_response_from_buffer (strlen (me), 64 response = MHD_create_response_from_buffer (strlen (me),
65 (void *) me, 65 (void *) me,
66 MHD_RESPMEM_PERSISTENT); 66 MHD_RESPMEM_PERSISTENT);
@@ -75,7 +75,7 @@ ahc_echo (void *cls,
75static void 75static void
76request_completed (void *cls, 76request_completed (void *cls,
77 struct MHD_Connection *connection, 77 struct MHD_Connection *connection,
78 void **con_cls, 78 void **req_cls,
79 enum MHD_RequestTerminationCode toe) 79 enum MHD_RequestTerminationCode toe)
80{ 80{
81 fprintf (stderr, 81 fprintf (stderr,
diff --git a/src/examples/demo.c b/src/examples/demo.c
index 0b6dc5f9..6ff7adae 100644
--- a/src/examples/demo.c
+++ b/src/examples/demo.c
@@ -619,7 +619,7 @@ process_upload_data (void *cls,
619 * 619 *
620 * @param cls client-defined closure, NULL 620 * @param cls client-defined closure, NULL
621 * @param connection connection handle 621 * @param connection connection handle
622 * @param con_cls value as set by the last call to 622 * @param req_cls value as set by the last call to
623 * the MHD_AccessHandlerCallback, points to NULL if this was 623 * the MHD_AccessHandlerCallback, points to NULL if this was
624 * not an upload 624 * not an upload
625 * @param toe reason for request termination 625 * @param toe reason for request termination
@@ -627,10 +627,10 @@ process_upload_data (void *cls,
627static void 627static void
628response_completed_callback (void *cls, 628response_completed_callback (void *cls,
629 struct MHD_Connection *connection, 629 struct MHD_Connection *connection,
630 void **con_cls, 630 void **req_cls,
631 enum MHD_RequestTerminationCode toe) 631 enum MHD_RequestTerminationCode toe)
632{ 632{
633 struct UploadContext *uc = *con_cls; 633 struct UploadContext *uc = *req_cls;
634 (void) cls; /* Unused. Silent compiler warning. */ 634 (void) cls; /* Unused. Silent compiler warning. */
635 (void) connection; /* Unused. Silent compiler warning. */ 635 (void) connection; /* Unused. Silent compiler warning. */
636 (void) toe; /* Unused. Silent compiler warning. */ 636 (void) toe; /* Unused. Silent compiler warning. */
@@ -694,7 +694,7 @@ return_directory_response (struct MHD_Connection *connection)
694 * @param version HTTP version 694 * @param version HTTP version
695 * @param upload_data data from upload (PUT/POST) 695 * @param upload_data data from upload (PUT/POST)
696 * @param upload_data_size number of bytes in @a upload_data 696 * @param upload_data_size number of bytes in @a upload_data
697 * @param ptr our context 697 * @param req_cls our context
698 * @return #MHD_YES on success, #MHD_NO to drop connection 698 * @return #MHD_YES on success, #MHD_NO to drop connection
699 */ 699 */
700static enum MHD_Result 700static enum MHD_Result
@@ -704,7 +704,7 @@ generate_page (void *cls,
704 const char *method, 704 const char *method,
705 const char *version, 705 const char *version,
706 const char *upload_data, 706 const char *upload_data,
707 size_t *upload_data_size, void **ptr) 707 size_t *upload_data_size, void **req_cls)
708{ 708{
709 struct MHD_Response *response; 709 struct MHD_Response *response;
710 enum MHD_Result ret; 710 enum MHD_Result ret;
@@ -775,7 +775,7 @@ generate_page (void *cls,
775 if (0 == strcmp (method, MHD_HTTP_METHOD_POST)) 775 if (0 == strcmp (method, MHD_HTTP_METHOD_POST))
776 { 776 {
777 /* upload! */ 777 /* upload! */
778 struct UploadContext *uc = *ptr; 778 struct UploadContext *uc = *req_cls;
779 779
780 if (NULL == uc) 780 if (NULL == uc)
781 { 781 {
@@ -793,7 +793,7 @@ generate_page (void *cls,
793 free (uc); 793 free (uc);
794 return MHD_NO; 794 return MHD_NO;
795 } 795 }
796 *ptr = uc; 796 *req_cls = uc;
797 return MHD_YES; 797 return MHD_YES;
798 } 798 }
799 if (0 != *upload_data_size) 799 if (0 != *upload_data_size)
diff --git a/src/examples/demo_https.c b/src/examples/demo_https.c
index d4e1d77f..ef59e7d9 100644
--- a/src/examples/demo_https.c
+++ b/src/examples/demo_https.c
@@ -621,7 +621,7 @@ process_upload_data (void *cls,
621 * 621 *
622 * @param cls client-defined closure, NULL 622 * @param cls client-defined closure, NULL
623 * @param connection connection handle 623 * @param connection connection handle
624 * @param con_cls value as set by the last call to 624 * @param req_cls value as set by the last call to
625 * the MHD_AccessHandlerCallback, points to NULL if this was 625 * the MHD_AccessHandlerCallback, points to NULL if this was
626 * not an upload 626 * not an upload
627 * @param toe reason for request termination 627 * @param toe reason for request termination
@@ -629,10 +629,10 @@ process_upload_data (void *cls,
629static void 629static void
630response_completed_callback (void *cls, 630response_completed_callback (void *cls,
631 struct MHD_Connection *connection, 631 struct MHD_Connection *connection,
632 void **con_cls, 632 void **req_cls,
633 enum MHD_RequestTerminationCode toe) 633 enum MHD_RequestTerminationCode toe)
634{ 634{
635 struct UploadContext *uc = *con_cls; 635 struct UploadContext *uc = *req_cls;
636 (void) cls; /* Unused. Silent compiler warning. */ 636 (void) cls; /* Unused. Silent compiler warning. */
637 (void) connection; /* Unused. Silent compiler warning. */ 637 (void) connection; /* Unused. Silent compiler warning. */
638 (void) toe; /* Unused. Silent compiler warning. */ 638 (void) toe; /* Unused. Silent compiler warning. */
@@ -696,7 +696,7 @@ return_directory_response (struct MHD_Connection *connection)
696 * @param version HTTP version 696 * @param version HTTP version
697 * @param upload_data data from upload (PUT/POST) 697 * @param upload_data data from upload (PUT/POST)
698 * @param upload_data_size number of bytes in "upload_data" 698 * @param upload_data_size number of bytes in "upload_data"
699 * @param ptr our context 699 * @param req_cls our context
700 * @return #MHD_YES on success, #MHD_NO to drop connection 700 * @return #MHD_YES on success, #MHD_NO to drop connection
701 */ 701 */
702static enum MHD_Result 702static enum MHD_Result
@@ -706,7 +706,7 @@ generate_page (void *cls,
706 const char *method, 706 const char *method,
707 const char *version, 707 const char *version,
708 const char *upload_data, 708 const char *upload_data,
709 size_t *upload_data_size, void **ptr) 709 size_t *upload_data_size, void **req_cls)
710{ 710{
711 struct MHD_Response *response; 711 struct MHD_Response *response;
712 enum MHD_Result ret; 712 enum MHD_Result ret;
@@ -776,7 +776,7 @@ generate_page (void *cls,
776 if (0 == strcmp (method, MHD_HTTP_METHOD_POST)) 776 if (0 == strcmp (method, MHD_HTTP_METHOD_POST))
777 { 777 {
778 /* upload! */ 778 /* upload! */
779 struct UploadContext *uc = *ptr; 779 struct UploadContext *uc = *req_cls;
780 780
781 if (NULL == uc) 781 if (NULL == uc)
782 { 782 {
@@ -794,7 +794,7 @@ generate_page (void *cls,
794 free (uc); 794 free (uc);
795 return MHD_NO; 795 return MHD_NO;
796 } 796 }
797 *ptr = uc; 797 *req_cls = uc;
798 return MHD_YES; 798 return MHD_YES;
799 } 799 }
800 if (0 != *upload_data_size) 800 if (0 != *upload_data_size)
diff --git a/src/examples/digest_auth_example.c b/src/examples/digest_auth_example.c
index 073726ad..44faefeb 100644
--- a/src/examples/digest_auth_example.c
+++ b/src/examples/digest_auth_example.c
@@ -40,7 +40,7 @@ ahc_echo (void *cls,
40 const char *url, 40 const char *url,
41 const char *method, 41 const char *method,
42 const char *version, 42 const char *version,
43 const char *upload_data, size_t *upload_data_size, void **ptr) 43 const char *upload_data, size_t *upload_data_size, void **req_cls)
44{ 44{
45 struct MHD_Response *response; 45 struct MHD_Response *response;
46 char *username; 46 char *username;
@@ -54,7 +54,7 @@ ahc_echo (void *cls,
54 (void) version; /* Unused. Silent compiler warning. */ 54 (void) version; /* Unused. Silent compiler warning. */
55 (void) upload_data; /* Unused. Silent compiler warning. */ 55 (void) upload_data; /* Unused. Silent compiler warning. */
56 (void) upload_data_size; /* Unused. Silent compiler warning. */ 56 (void) upload_data_size; /* Unused. Silent compiler warning. */
57 (void) ptr; /* Unused. Silent compiler warning. */ 57 (void) req_cls; /* Unused. Silent compiler warning. */
58 58
59 username = MHD_digest_auth_get_username (connection); 59 username = MHD_digest_auth_get_username (connection);
60 if (NULL == username) 60 if (NULL == username)
diff --git a/src/examples/dual_stack_example.c b/src/examples/dual_stack_example.c
index 15bafc44..175583ac 100644
--- a/src/examples/dual_stack_example.c
+++ b/src/examples/dual_stack_example.c
@@ -34,7 +34,7 @@ ahc_echo (void *cls,
34 const char *url, 34 const char *url,
35 const char *method, 35 const char *method,
36 const char *version, 36 const char *version,
37 const char *upload_data, size_t *upload_data_size, void **ptr) 37 const char *upload_data, size_t *upload_data_size, void **req_cls)
38{ 38{
39 static int aptr; 39 static int aptr;
40 const char *me = cls; 40 const char *me = cls;
@@ -47,13 +47,13 @@ ahc_echo (void *cls,
47 47
48 if (0 != strcmp (method, "GET")) 48 if (0 != strcmp (method, "GET"))
49 return MHD_NO; /* unexpected method */ 49 return MHD_NO; /* unexpected method */
50 if (&aptr != *ptr) 50 if (&aptr != *req_cls)
51 { 51 {
52 /* do never respond on first call */ 52 /* do never respond on first call */
53 *ptr = &aptr; 53 *req_cls = &aptr;
54 return MHD_YES; 54 return MHD_YES;
55 } 55 }
56 *ptr = NULL; /* reset when done */ 56 *req_cls = NULL; /* reset when done */
57 response = MHD_create_response_from_buffer (strlen (me), 57 response = MHD_create_response_from_buffer (strlen (me),
58 (void *) me, 58 (void *) me,
59 MHD_RESPMEM_PERSISTENT); 59 MHD_RESPMEM_PERSISTENT);
diff --git a/src/examples/fileserver_example.c b/src/examples/fileserver_example.c
index 94c2ca95..76879eec 100644
--- a/src/examples/fileserver_example.c
+++ b/src/examples/fileserver_example.c
@@ -48,7 +48,7 @@ ahc_echo (void *cls,
48 const char *method, 48 const char *method,
49 const char *version, 49 const char *version,
50 const char *upload_data, 50 const char *upload_data,
51 size_t *upload_data_size, void **ptr) 51 size_t *upload_data_size, void **req_cls)
52{ 52{
53 static int aptr; 53 static int aptr;
54 struct MHD_Response *response; 54 struct MHD_Response *response;
@@ -63,13 +63,13 @@ ahc_echo (void *cls,
63 if ( (0 != strcmp (method, MHD_HTTP_METHOD_GET)) && 63 if ( (0 != strcmp (method, MHD_HTTP_METHOD_GET)) &&
64 (0 != strcmp (method, MHD_HTTP_METHOD_HEAD)) ) 64 (0 != strcmp (method, MHD_HTTP_METHOD_HEAD)) )
65 return MHD_NO; /* unexpected method */ 65 return MHD_NO; /* unexpected method */
66 if (&aptr != *ptr) 66 if (&aptr != *req_cls)
67 { 67 {
68 /* do never respond on first call */ 68 /* do never respond on first call */
69 *ptr = &aptr; 69 *req_cls = &aptr;
70 return MHD_YES; 70 return MHD_YES;
71 } 71 }
72 *ptr = NULL; /* reset when done */ 72 *req_cls = NULL; /* reset when done */
73 /* WARNING: direct usage of url as filename is for example only! 73 /* WARNING: direct usage of url as filename is for example only!
74 * NEVER pass received data directly as parameter to file manipulation 74 * NEVER pass received data directly as parameter to file manipulation
75 * functions. Always check validity of data before using. 75 * functions. Always check validity of data before using.
diff --git a/src/examples/fileserver_example_dirs.c b/src/examples/fileserver_example_dirs.c
index e6c9ed1f..796cb42e 100644
--- a/src/examples/fileserver_example_dirs.c
+++ b/src/examples/fileserver_example_dirs.c
@@ -88,7 +88,7 @@ ahc_echo (void *cls,
88 const char *method, 88 const char *method,
89 const char *version, 89 const char *version,
90 const char *upload_data, 90 const char *upload_data,
91 size_t *upload_data_size, void **ptr) 91 size_t *upload_data_size, void **req_cls)
92{ 92{
93 static int aptr; 93 static int aptr;
94 struct MHD_Response *response; 94 struct MHD_Response *response;
@@ -105,13 +105,13 @@ ahc_echo (void *cls,
105 105
106 if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) 106 if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
107 return MHD_NO; /* unexpected method */ 107 return MHD_NO; /* unexpected method */
108 if (&aptr != *ptr) 108 if (&aptr != *req_cls)
109 { 109 {
110 /* do never respond on first call */ 110 /* do never respond on first call */
111 *ptr = &aptr; 111 *req_cls = &aptr;
112 return MHD_YES; 112 return MHD_YES;
113 } 113 }
114 *ptr = NULL; /* reset when done */ 114 *req_cls = NULL; /* reset when done */
115 115
116 file = fopen (&url[1], "rb"); 116 file = fopen (&url[1], "rb");
117 if (NULL != file) 117 if (NULL != file)
diff --git a/src/examples/fileserver_example_external_select.c b/src/examples/fileserver_example_external_select.c
index 7209751f..09f7be0a 100644
--- a/src/examples/fileserver_example_external_select.c
+++ b/src/examples/fileserver_example_external_select.c
@@ -55,7 +55,7 @@ ahc_echo (void *cls,
55 const char *method, 55 const char *method,
56 const char *version, 56 const char *version,
57 const char *upload_data, 57 const char *upload_data,
58 size_t *upload_data_size, void **ptr) 58 size_t *upload_data_size, void **req_cls)
59{ 59{
60 static int aptr; 60 static int aptr;
61 struct MHD_Response *response; 61 struct MHD_Response *response;
@@ -70,13 +70,13 @@ ahc_echo (void *cls,
70 70
71 if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) 71 if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
72 return MHD_NO; /* unexpected method */ 72 return MHD_NO; /* unexpected method */
73 if (&aptr != *ptr) 73 if (&aptr != *req_cls)
74 { 74 {
75 /* do never respond on first call */ 75 /* do never respond on first call */
76 *ptr = &aptr; 76 *req_cls = &aptr;
77 return MHD_YES; 77 return MHD_YES;
78 } 78 }
79 *ptr = NULL; /* reset when done */ 79 *req_cls = NULL; /* reset when done */
80 80
81 file = fopen (&url[1], "rb"); 81 file = fopen (&url[1], "rb");
82 if (NULL != file) 82 if (NULL != file)
diff --git a/src/examples/http_chunked_compression.c b/src/examples/http_chunked_compression.c
index f6baf0fd..7b8ed1fc 100644
--- a/src/examples/http_chunked_compression.c
+++ b/src/examples/http_chunked_compression.c
@@ -156,7 +156,7 @@ free_cb (void *cls)
156static enum MHD_Result 156static enum MHD_Result
157ahc_echo (void *cls, struct MHD_Connection *con, const char *url, const 157ahc_echo (void *cls, struct MHD_Connection *con, const char *url, const
158 char *method, const char *version, 158 char *method, const char *version,
159 const char *upload_data, size_t *upload_size, void **ptr) 159 const char *upload_data, size_t *upload_size, void **req_cls)
160{ 160{
161 struct Holder *holder; 161 struct Holder *holder;
162 struct MHD_Response *res; 162 struct MHD_Response *res;
@@ -167,12 +167,12 @@ ahc_echo (void *cls, struct MHD_Connection *con, const char *url, const
167 (void) version; 167 (void) version;
168 (void) upload_data; 168 (void) upload_data;
169 (void) upload_size; 169 (void) upload_size;
170 if (NULL == *ptr) 170 if (NULL == *req_cls)
171 { 171 {
172 *ptr = (void *) 1; 172 *req_cls = (void *) 1;
173 return MHD_YES; 173 return MHD_YES;
174 } 174 }
175 *ptr = NULL; 175 *req_cls = NULL;
176 holder = calloc (1, sizeof (struct Holder)); 176 holder = calloc (1, sizeof (struct Holder));
177 if (! holder) 177 if (! holder)
178 return MHD_NO; 178 return MHD_NO;
diff --git a/src/examples/http_compression.c b/src/examples/http_compression.c
index 0419a803..a91a39a3 100644
--- a/src/examples/http_compression.c
+++ b/src/examples/http_compression.c
@@ -96,7 +96,7 @@ ahc_echo (void *cls,
96 const char *url, 96 const char *url,
97 const char *method, 97 const char *method,
98 const char *version, 98 const char *version,
99 const char *upload_data, size_t *upload_data_size, void **ptr) 99 const char *upload_data, size_t *upload_data_size, void **req_cls)
100{ 100{
101 struct MHD_Response *response; 101 struct MHD_Response *response;
102 enum MHD_Result ret; 102 enum MHD_Result ret;
@@ -111,12 +111,12 @@ ahc_echo (void *cls,
111 111
112 if (0 != strcmp (method, "GET")) 112 if (0 != strcmp (method, "GET"))
113 return MHD_NO; /* unexpected method */ 113 return MHD_NO; /* unexpected method */
114 if (! *ptr) 114 if (! *req_cls)
115 { 115 {
116 *ptr = (void *) 1; 116 *req_cls = (void *) 1;
117 return MHD_YES; 117 return MHD_YES;
118 } 118 }
119 *ptr = NULL; 119 *req_cls = NULL;
120 120
121 body_str = strdup (PAGE); 121 body_str = strdup (PAGE);
122 if (NULL == body_str) 122 if (NULL == body_str)
diff --git a/src/examples/https_fileserver_example.c b/src/examples/https_fileserver_example.c
index babad604..5dc340f7 100644
--- a/src/examples/https_fileserver_example.c
+++ b/src/examples/https_fileserver_example.c
@@ -137,7 +137,7 @@ http_ahc (void *cls,
137 const char *method, 137 const char *method,
138 const char *version, 138 const char *version,
139 const char *upload_data, 139 const char *upload_data,
140 size_t *upload_data_size, void **ptr) 140 size_t *upload_data_size, void **req_cls)
141{ 141{
142 static int aptr; 142 static int aptr;
143 struct MHD_Response *response; 143 struct MHD_Response *response;
@@ -152,13 +152,13 @@ http_ahc (void *cls,
152 152
153 if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) 153 if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
154 return MHD_NO; /* unexpected method */ 154 return MHD_NO; /* unexpected method */
155 if (&aptr != *ptr) 155 if (&aptr != *req_cls)
156 { 156 {
157 /* do never respond on first call */ 157 /* do never respond on first call */
158 *ptr = &aptr; 158 *req_cls = &aptr;
159 return MHD_YES; 159 return MHD_YES;
160 } 160 }
161 *ptr = NULL; /* reset when done */ 161 *req_cls = NULL; /* reset when done */
162 162
163 file = fopen (&url[1], "rb"); 163 file = fopen (&url[1], "rb");
164 if (NULL != file) 164 if (NULL != file)
diff --git a/src/examples/minimal_example.c b/src/examples/minimal_example.c
index a02b5d50..ce604555 100644
--- a/src/examples/minimal_example.c
+++ b/src/examples/minimal_example.c
@@ -36,7 +36,7 @@ ahc_echo (void *cls,
36 const char *version, 36 const char *version,
37 const char *upload_data, 37 const char *upload_data,
38 size_t *upload_data_size, 38 size_t *upload_data_size,
39 void **ptr) 39 void **req_cls)
40{ 40{
41 static int aptr; 41 static int aptr;
42 const char *me = cls; 42 const char *me = cls;
@@ -50,13 +50,13 @@ ahc_echo (void *cls,
50 50
51 if (0 != strcmp (method, "GET")) 51 if (0 != strcmp (method, "GET"))
52 return MHD_NO; /* unexpected method */ 52 return MHD_NO; /* unexpected method */
53 if (&aptr != *ptr) 53 if (&aptr != *req_cls)
54 { 54 {
55 /* do never respond on first call */ 55 /* do never respond on first call */
56 *ptr = &aptr; 56 *req_cls = &aptr;
57 return MHD_YES; 57 return MHD_YES;
58 } 58 }
59 *ptr = NULL; /* reset when done */ 59 *req_cls = NULL; /* reset when done */
60 response = MHD_create_response_from_buffer (strlen (me), 60 response = MHD_create_response_from_buffer (strlen (me),
61 (void *) me, 61 (void *) me,
62 MHD_RESPMEM_PERSISTENT); 62 MHD_RESPMEM_PERSISTENT);
diff --git a/src/examples/minimal_example_comet.c b/src/examples/minimal_example_comet.c
index c36bf2ce..a8864d89 100644
--- a/src/examples/minimal_example_comet.c
+++ b/src/examples/minimal_example_comet.c
@@ -44,7 +44,7 @@ ahc_echo (void *cls,
44 const char *url, 44 const char *url,
45 const char *method, 45 const char *method,
46 const char *version, 46 const char *version,
47 const char *upload_data, size_t *upload_data_size, void **ptr) 47 const char *upload_data, size_t *upload_data_size, void **req_cls)
48{ 48{
49 static int aptr; 49 static int aptr;
50 struct MHD_Response *response; 50 struct MHD_Response *response;
@@ -57,13 +57,13 @@ ahc_echo (void *cls,
57 57
58 if (0 != strcmp (method, "GET")) 58 if (0 != strcmp (method, "GET"))
59 return MHD_NO; /* unexpected method */ 59 return MHD_NO; /* unexpected method */
60 if (&aptr != *ptr) 60 if (&aptr != *req_cls)
61 { 61 {
62 /* do never respond on first call */ 62 /* do never respond on first call */
63 *ptr = &aptr; 63 *req_cls = &aptr;
64 return MHD_YES; 64 return MHD_YES;
65 } 65 }
66 *ptr = NULL; /* reset when done */ 66 *req_cls = NULL; /* reset when done */
67 response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, 67 response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN,
68 80, 68 80,
69 &data_generator, NULL, NULL); 69 &data_generator, NULL, NULL);
diff --git a/src/examples/minimal_example_empty.c b/src/examples/minimal_example_empty.c
index d692e0d8..43719a24 100644
--- a/src/examples/minimal_example_empty.c
+++ b/src/examples/minimal_example_empty.c
@@ -34,7 +34,7 @@ ahc_echo (void *cls,
34 const char *version, 34 const char *version,
35 const char *upload_data, 35 const char *upload_data,
36 size_t *upload_data_size, 36 size_t *upload_data_size,
37 void **ptr) 37 void **req_cls)
38{ 38{
39 static int aptr; 39 static int aptr;
40 struct MHD_Response *response; 40 struct MHD_Response *response;
@@ -48,13 +48,13 @@ ahc_echo (void *cls,
48 48
49 if (0 != strcmp (method, "GET")) 49 if (0 != strcmp (method, "GET"))
50 return MHD_NO; /* unexpected method */ 50 return MHD_NO; /* unexpected method */
51 if (&aptr != *ptr) 51 if (&aptr != *req_cls)
52 { 52 {
53 /* do never respond on first call */ 53 /* do never respond on first call */
54 *ptr = &aptr; 54 *req_cls = &aptr;
55 return MHD_YES; 55 return MHD_YES;
56 } 56 }
57 *ptr = NULL; /* reset when done */ 57 *req_cls = NULL; /* reset when done */
58 response = MHD_create_response_from_buffer (0, 58 response = MHD_create_response_from_buffer (0,
59 NULL, 59 NULL,
60 MHD_RESPMEM_PERSISTENT); 60 MHD_RESPMEM_PERSISTENT);
diff --git a/src/examples/minimal_example_empty_tls.c b/src/examples/minimal_example_empty_tls.c
index 70d7bd71..f03884c8 100644
--- a/src/examples/minimal_example_empty_tls.c
+++ b/src/examples/minimal_example_empty_tls.c
@@ -34,7 +34,7 @@ ahc_echo (void *cls,
34 const char *version, 34 const char *version,
35 const char *upload_data, 35 const char *upload_data,
36 size_t *upload_data_size, 36 size_t *upload_data_size,
37 void **ptr) 37 void **req_cls)
38{ 38{
39 static int aptr; 39 static int aptr;
40 struct MHD_Response *response; 40 struct MHD_Response *response;
@@ -48,13 +48,13 @@ ahc_echo (void *cls,
48 48
49 if (0 != strcmp (method, "GET")) 49 if (0 != strcmp (method, "GET"))
50 return MHD_NO; /* unexpected method */ 50 return MHD_NO; /* unexpected method */
51 if (&aptr != *ptr) 51 if (&aptr != *req_cls)
52 { 52 {
53 /* do never respond on first call */ 53 /* do never respond on first call */
54 *ptr = &aptr; 54 *req_cls = &aptr;
55 return MHD_YES; 55 return MHD_YES;
56 } 56 }
57 *ptr = NULL; /* reset when done */ 57 *req_cls = NULL; /* reset when done */
58 response = MHD_create_response_from_buffer (0, 58 response = MHD_create_response_from_buffer (0,
59 NULL, 59 NULL,
60 MHD_RESPMEM_PERSISTENT); 60 MHD_RESPMEM_PERSISTENT);
diff --git a/src/examples/msgs_i18n.c b/src/examples/msgs_i18n.c
index 56f9f501..5d563e4f 100644
--- a/src/examples/msgs_i18n.c
+++ b/src/examples/msgs_i18n.c
@@ -51,7 +51,7 @@ ahc_echo (void *cls,
51 const char *ver, 51 const char *ver,
52 const char *upd, 52 const char *upd,
53 size_t *upsz, 53 size_t *upsz,
54 void **ptr) 54 void **req_cls)
55{ 55{
56 return MHD_NO; 56 return MHD_NO;
57} 57}
diff --git a/src/examples/post_example.c b/src/examples/post_example.c
index 9f4fbcf9..d8f58d49 100644
--- a/src/examples/post_example.c
+++ b/src/examples/post_example.c
@@ -540,7 +540,7 @@ post_iterator (void *cls,
540 * @param upload_data_size set initially to the size of the 540 * @param upload_data_size set initially to the size of the
541 * upload_data provided; the method must update this 541 * upload_data provided; the method must update this
542 * value to the number of bytes NOT processed; 542 * value to the number of bytes NOT processed;
543 * @param ptr pointer that the callback can set to some 543 * @param req_cls pointer that the callback can set to some
544 * address and that will be preserved by MHD for future 544 * address and that will be preserved by MHD for future
545 * calls for this request; since the access handler may 545 * calls for this request; since the access handler may
546 * be called many times (i.e., for a PUT/POST operation 546 * be called many times (i.e., for a PUT/POST operation
@@ -549,7 +549,7 @@ post_iterator (void *cls,
549 * If necessary, this state can be cleaned up in the 549 * If necessary, this state can be cleaned up in the
550 * global "MHD_RequestCompleted" callback (which 550 * global "MHD_RequestCompleted" callback (which
551 * can be set with the MHD_OPTION_NOTIFY_COMPLETED). 551 * can be set with the MHD_OPTION_NOTIFY_COMPLETED).
552 * Initially, <tt>*con_cls</tt> will be NULL. 552 * Initially, <tt>*req_cls</tt> will be NULL.
553 * @return MHS_YES if the connection was handled successfully, 553 * @return MHS_YES if the connection was handled successfully,
554 * MHS_NO if the socket must be closed due to a serious 554 * MHS_NO if the socket must be closed due to a serious
555 * error while handling the request 555 * error while handling the request
@@ -562,7 +562,7 @@ create_response (void *cls,
562 const char *version, 562 const char *version,
563 const char *upload_data, 563 const char *upload_data,
564 size_t *upload_data_size, 564 size_t *upload_data_size,
565 void **ptr) 565 void **req_cls)
566{ 566{
567 struct MHD_Response *response; 567 struct MHD_Response *response;
568 struct Request *request; 568 struct Request *request;
@@ -572,7 +572,7 @@ create_response (void *cls,
572 (void) cls; /* Unused. Silent compiler warning. */ 572 (void) cls; /* Unused. Silent compiler warning. */
573 (void) version; /* Unused. Silent compiler warning. */ 573 (void) version; /* Unused. Silent compiler warning. */
574 574
575 request = *ptr; 575 request = *req_cls;
576 if (NULL == request) 576 if (NULL == request)
577 { 577 {
578 request = calloc (1, sizeof (struct Request)); 578 request = calloc (1, sizeof (struct Request));
@@ -581,7 +581,7 @@ create_response (void *cls,
581 fprintf (stderr, "calloc error: %s\n", strerror (errno)); 581 fprintf (stderr, "calloc error: %s\n", strerror (errno));
582 return MHD_NO; 582 return MHD_NO;
583 } 583 }
584 *ptr = request; 584 *req_cls = request;
585 if (0 == strcmp (method, MHD_HTTP_METHOD_POST)) 585 if (0 == strcmp (method, MHD_HTTP_METHOD_POST))
586 { 586 {
587 request->pp = MHD_create_post_processor (connection, 1024, 587 request->pp = MHD_create_post_processor (connection, 1024,
@@ -660,16 +660,16 @@ create_response (void *cls,
660 * 660 *
661 * @param cls not used 661 * @param cls not used
662 * @param connection connection that completed 662 * @param connection connection that completed
663 * @param con_cls session handle 663 * @param req_cls session handle
664 * @param toe status code 664 * @param toe status code
665 */ 665 */
666static void 666static void
667request_completed_callback (void *cls, 667request_completed_callback (void *cls,
668 struct MHD_Connection *connection, 668 struct MHD_Connection *connection,
669 void **con_cls, 669 void **req_cls,
670 enum MHD_RequestTerminationCode toe) 670 enum MHD_RequestTerminationCode toe)
671{ 671{
672 struct Request *request = *con_cls; 672 struct Request *request = *req_cls;
673 (void) cls; /* Unused. Silent compiler warning. */ 673 (void) cls; /* Unused. Silent compiler warning. */
674 (void) connection; /* Unused. Silent compiler warning. */ 674 (void) connection; /* Unused. Silent compiler warning. */
675 (void) toe; /* Unused. Silent compiler warning. */ 675 (void) toe; /* Unused. Silent compiler warning. */
diff --git a/src/examples/querystring_example.c b/src/examples/querystring_example.c
index 975d17f2..d33767cb 100644
--- a/src/examples/querystring_example.c
+++ b/src/examples/querystring_example.c
@@ -35,7 +35,7 @@ ahc_echo (void *cls,
35 const char *url, 35 const char *url,
36 const char *method, 36 const char *method,
37 const char *version, 37 const char *version,
38 const char *upload_data, size_t *upload_data_size, void **ptr) 38 const char *upload_data, size_t *upload_data_size, void **req_cls)
39{ 39{
40 static int aptr; 40 static int aptr;
41 const char *fmt = cls; 41 const char *fmt = cls;
@@ -51,13 +51,13 @@ ahc_echo (void *cls,
51 51
52 if (0 != strcmp (method, "GET")) 52 if (0 != strcmp (method, "GET"))
53 return MHD_NO; /* unexpected method */ 53 return MHD_NO; /* unexpected method */
54 if (&aptr != *ptr) 54 if (&aptr != *req_cls)
55 { 55 {
56 /* do never respond on first call */ 56 /* do never respond on first call */
57 *ptr = &aptr; 57 *req_cls = &aptr;
58 return MHD_YES; 58 return MHD_YES;
59 } 59 }
60 *ptr = NULL; /* reset when done */ 60 *req_cls = NULL; /* reset when done */
61 if (NULL == fmt) 61 if (NULL == fmt)
62 return MHD_NO; /* The cls must not be NULL */ 62 return MHD_NO; /* The cls must not be NULL */
63 val = MHD_lookup_connection_value (connection, MHD_GET_ARGUMENT_KIND, "q"); 63 val = MHD_lookup_connection_value (connection, MHD_GET_ARGUMENT_KIND, "q");
diff --git a/src/examples/refuse_post_example.c b/src/examples/refuse_post_example.c
index 7e100d9f..dc261575 100644
--- a/src/examples/refuse_post_example.c
+++ b/src/examples/refuse_post_example.c
@@ -41,7 +41,7 @@ ahc_echo (void *cls,
41 const char *url, 41 const char *url,
42 const char *method, 42 const char *method,
43 const char *version, 43 const char *version,
44 const char *upload_data, size_t *upload_data_size, void **ptr) 44 const char *upload_data, size_t *upload_data_size, void **req_cls)
45{ 45{
46 static int aptr; 46 static int aptr;
47 const char *me = cls; 47 const char *me = cls;
@@ -56,9 +56,9 @@ ahc_echo (void *cls,
56 if ((0 != strcmp (method, "GET")) && (0 != strcmp (method, "POST"))) 56 if ((0 != strcmp (method, "GET")) && (0 != strcmp (method, "POST")))
57 return MHD_NO; /* unexpected method */ 57 return MHD_NO; /* unexpected method */
58 58
59 if (&aptr != *ptr) 59 if (&aptr != *req_cls)
60 { 60 {
61 *ptr = &aptr; 61 *req_cls = &aptr;
62 62
63 /* always to busy for POST requests */ 63 /* always to busy for POST requests */
64 if (0 == strcmp (method, "POST")) 64 if (0 == strcmp (method, "POST"))
@@ -74,7 +74,7 @@ ahc_echo (void *cls,
74 } 74 }
75 } 75 }
76 76
77 *ptr = NULL; /* reset when done */ 77 *req_cls = NULL; /* reset when done */
78 response = MHD_create_response_from_buffer (strlen (me), 78 response = MHD_create_response_from_buffer (strlen (me),
79 (void *) me, 79 (void *) me,
80 MHD_RESPMEM_PERSISTENT); 80 MHD_RESPMEM_PERSISTENT);
diff --git a/src/examples/suspend_resume_epoll.c b/src/examples/suspend_resume_epoll.c
index d25c3b21..6b660b00 100644
--- a/src/examples/suspend_resume_epoll.c
+++ b/src/examples/suspend_resume_epoll.c
@@ -49,7 +49,7 @@ ahc_echo (void *cls,
49 const char *url, 49 const char *url,
50 const char *method, 50 const char *method,
51 const char *version, 51 const char *version,
52 const char *upload_data, size_t *upload_data_size, void **ptr) 52 const char *upload_data, size_t *upload_data_size, void **req_cls)
53{ 53{
54 struct MHD_Response *response; 54 struct MHD_Response *response;
55 enum MHD_Result ret; 55 enum MHD_Result ret;
@@ -62,7 +62,7 @@ ahc_echo (void *cls,
62 (void) version; /* Unused. Silence compiler warning. */ 62 (void) version; /* Unused. Silence compiler warning. */
63 (void) upload_data; /* Unused. Silence compiler warning. */ 63 (void) upload_data; /* Unused. Silence compiler warning. */
64 (void) upload_data_size; /* Unused. Silence compiler warning. */ 64 (void) upload_data_size; /* Unused. Silence compiler warning. */
65 req = *ptr; 65 req = *req_cls;
66 if (NULL == req) 66 if (NULL == req)
67 { 67 {
68 68
@@ -71,7 +71,7 @@ ahc_echo (void *cls,
71 return MHD_NO; 71 return MHD_NO;
72 req->connection = connection; 72 req->connection = connection;
73 req->timerfd = -1; 73 req->timerfd = -1;
74 *ptr = req; 74 *req_cls = req;
75 return MHD_YES; 75 return MHD_YES;
76 } 76 }
77 77
@@ -120,10 +120,10 @@ ahc_echo (void *cls,
120static void 120static void
121connection_done (void *cls, 121connection_done (void *cls,
122 struct MHD_Connection *connection, 122 struct MHD_Connection *connection,
123 void **con_cls, 123 void **req_cls,
124 enum MHD_RequestTerminationCode toe) 124 enum MHD_RequestTerminationCode toe)
125{ 125{
126 struct Request *req = *con_cls; 126 struct Request *req = *req_cls;
127 127
128 (void) cls; 128 (void) cls;
129 (void) connection; 129 (void) connection;
diff --git a/src/examples/timeout.c b/src/examples/timeout.c
index b31ff21f..b52f508f 100644
--- a/src/examples/timeout.c
+++ b/src/examples/timeout.c
@@ -37,7 +37,7 @@ answer_to_connection (void *cls,
37 const char *version, 37 const char *version,
38 const char *upload_data, 38 const char *upload_data,
39 size_t *upload_data_size, 39 size_t *upload_data_size,
40 void **con_cls) 40 void **req_cls)
41{ 41{
42 const char *page = "<html><body>Hello timeout!</body></html>"; 42 const char *page = "<html><body>Hello timeout!</body></html>";
43 struct MHD_Response *response; 43 struct MHD_Response *response;
@@ -48,7 +48,7 @@ answer_to_connection (void *cls,
48 (void) method; /* Unused. Silent compiler warning. */ 48 (void) method; /* Unused. Silent compiler warning. */
49 (void) upload_data; /* Unused. Silent compiler warning. */ 49 (void) upload_data; /* Unused. Silent compiler warning. */
50 (void) upload_data_size; /* Unused. Silent compiler warning. */ 50 (void) upload_data_size; /* Unused. Silent compiler warning. */
51 (void) con_cls; /* Unused. Silent compiler warning. */ 51 (void) req_cls; /* Unused. Silent compiler warning. */
52 52
53 response = MHD_create_response_from_buffer (strlen (page), 53 response = MHD_create_response_from_buffer (strlen (page),
54 (void *) page, 54 (void *) page,
diff --git a/src/examples/upgrade_example.c b/src/examples/upgrade_example.c
index 08c718d0..547f1b6c 100644
--- a/src/examples/upgrade_example.c
+++ b/src/examples/upgrade_example.c
@@ -169,7 +169,7 @@ run_usock (void *cls)
169 * @param connection original HTTP connection handle, 169 * @param connection original HTTP connection handle,
170 * giving the function a last chance 170 * giving the function a last chance
171 * to inspect the original HTTP request 171 * to inspect the original HTTP request
172 * @param con_cls last value left in `con_cls` of the `MHD_AccessHandlerCallback` 172 * @param req_cls last value left in `req_cls` of the `MHD_AccessHandlerCallback`
173 * @param extra_in if we happened to have read bytes after the 173 * @param extra_in if we happened to have read bytes after the
174 * HTTP header already (because the client sent 174 * HTTP header already (because the client sent
175 * more than the HTTP header of the request before 175 * more than the HTTP header of the request before
@@ -194,7 +194,7 @@ run_usock (void *cls)
194static void 194static void
195uh_cb (void *cls, 195uh_cb (void *cls,
196 struct MHD_Connection *connection, 196 struct MHD_Connection *connection,
197 void *con_cls, 197 void *req_cls,
198 const char *extra_in, 198 const char *extra_in,
199 size_t extra_in_size, 199 size_t extra_in_size,
200 MHD_socket sock, 200 MHD_socket sock,
@@ -204,7 +204,7 @@ uh_cb (void *cls,
204 pthread_t pt; 204 pthread_t pt;
205 (void) cls; /* Unused. Silent compiler warning. */ 205 (void) cls; /* Unused. Silent compiler warning. */
206 (void) connection; /* Unused. Silent compiler warning. */ 206 (void) connection; /* Unused. Silent compiler warning. */
207 (void) con_cls; /* Unused. Silent compiler warning. */ 207 (void) req_cls; /* Unused. Silent compiler warning. */
208 208
209 md = malloc (sizeof (struct MyData)); 209 md = malloc (sizeof (struct MyData));
210 if (NULL == md) 210 if (NULL == md)
@@ -247,7 +247,7 @@ ahc_echo (void *cls,
247 const char *version, 247 const char *version,
248 const char *upload_data, 248 const char *upload_data,
249 size_t *upload_data_size, 249 size_t *upload_data_size,
250 void **ptr) 250 void **req_cls)
251{ 251{
252 static int aptr; 252 static int aptr;
253 struct MHD_Response *response; 253 struct MHD_Response *response;
@@ -260,13 +260,13 @@ ahc_echo (void *cls,
260 260
261 if (0 != strcmp (method, "GET")) 261 if (0 != strcmp (method, "GET"))
262 return MHD_NO; /* unexpected method */ 262 return MHD_NO; /* unexpected method */
263 if (&aptr != *ptr) 263 if (&aptr != *req_cls)
264 { 264 {
265 /* do never respond on first call */ 265 /* do never respond on first call */
266 *ptr = &aptr; 266 *req_cls = &aptr;
267 return MHD_YES; 267 return MHD_YES;
268 } 268 }
269 *ptr = NULL; /* reset when done */ 269 *req_cls = NULL; /* reset when done */
270 response = MHD_create_response_for_upgrade (&uh_cb, 270 response = MHD_create_response_for_upgrade (&uh_cb,
271 NULL); 271 NULL);
272 272
diff --git a/src/examples/websocket_chatserver_example.c b/src/examples/websocket_chatserver_example.c
index 0c39d5f0..052b4221 100644
--- a/src/examples/websocket_chatserver_example.c
+++ b/src/examples/websocket_chatserver_example.c
@@ -2044,7 +2044,7 @@ connecteduser_receive_messages (void *cls)
2044 * @param connection original HTTP connection handle, 2044 * @param connection original HTTP connection handle,
2045 * giving the function a last chance 2045 * giving the function a last chance
2046 * to inspect the original HTTP request 2046 * to inspect the original HTTP request
2047 * @param con_cls last value left in `con_cls` of the `MHD_AccessHandlerCallback` 2047 * @param req_cls last value left in `req_cls` of the `MHD_AccessHandlerCallback`
2048 * @param extra_in if we happened to have read bytes after the 2048 * @param extra_in if we happened to have read bytes after the
2049 * HTTP header already (because the client sent 2049 * HTTP header already (because the client sent
2050 * more than the HTTP header of the request before 2050 * more than the HTTP header of the request before
@@ -2069,7 +2069,7 @@ connecteduser_receive_messages (void *cls)
2069static void 2069static void
2070upgrade_handler (void *cls, 2070upgrade_handler (void *cls,
2071 struct MHD_Connection *connection, 2071 struct MHD_Connection *connection,
2072 void *con_cls, 2072 void *req_cls,
2073 const char *extra_in, 2073 const char *extra_in,
2074 size_t extra_in_size, 2074 size_t extra_in_size,
2075 MHD_socket fd, 2075 MHD_socket fd,
@@ -2079,7 +2079,7 @@ upgrade_handler (void *cls,
2079 pthread_t pt; 2079 pthread_t pt;
2080 (void) cls; /* Unused. Silent compiler warning. */ 2080 (void) cls; /* Unused. Silent compiler warning. */
2081 (void) connection; /* Unused. Silent compiler warning. */ 2081 (void) connection; /* Unused. Silent compiler warning. */
2082 (void) con_cls; /* Unused. Silent compiler warning. */ 2082 (void) req_cls; /* Unused. Silent compiler warning. */
2083 2083
2084 /* This callback must return as soon as possible. */ 2084 /* This callback must return as soon as possible. */
2085 2085
@@ -2130,7 +2130,7 @@ upgrade_handler (void *cls,
2130 * @param version The HTTP version 2130 * @param version The HTTP version
2131 * @param upload_data Given upload data for POST requests 2131 * @param upload_data Given upload data for POST requests
2132 * @param upload_data_size The size of the upload data 2132 * @param upload_data_size The size of the upload data
2133 * @param ptr A pointer for request specific data 2133 * @param req_cls A pointer for request specific data
2134 * @return MHD_YES on success or MHD_NO on error. 2134 * @return MHD_YES on success or MHD_NO on error.
2135 */ 2135 */
2136static enum MHD_Result 2136static enum MHD_Result
@@ -2141,7 +2141,7 @@ access_handler (void *cls,
2141 const char *version, 2141 const char *version,
2142 const char *upload_data, 2142 const char *upload_data,
2143 size_t *upload_data_size, 2143 size_t *upload_data_size,
2144 void **ptr) 2144 void **req_cls)
2145{ 2145{
2146 static int aptr; 2146 static int aptr;
2147 struct MHD_Response *response; 2147 struct MHD_Response *response;
@@ -2153,13 +2153,13 @@ access_handler (void *cls,
2153 2153
2154 if (0 != strcmp (method, "GET")) 2154 if (0 != strcmp (method, "GET"))
2155 return MHD_NO; /* unexpected method */ 2155 return MHD_NO; /* unexpected method */
2156 if (&aptr != *ptr) 2156 if (&aptr != *req_cls)
2157 { 2157 {
2158 /* do never respond on first call */ 2158 /* do never respond on first call */
2159 *ptr = &aptr; 2159 *req_cls = &aptr;
2160 return MHD_YES; 2160 return MHD_YES;
2161 } 2161 }
2162 *ptr = NULL; /* reset when done */ 2162 *req_cls = NULL; /* reset when done */
2163 if (0 == strcmp (url, "/")) 2163 if (0 == strcmp (url, "/"))
2164 { 2164 {
2165 /* Default page for visiting the server */ 2165 /* Default page for visiting the server */
diff --git a/src/examples/websocket_threaded_example.c b/src/examples/websocket_threaded_example.c
index b3c7f111..04b972d4 100644
--- a/src/examples/websocket_threaded_example.c
+++ b/src/examples/websocket_threaded_example.c
@@ -763,7 +763,7 @@ run_usock (void *cls)
763 763
764 764
765static void 765static void
766uh_cb (void *cls, struct MHD_Connection *con, void *con_cls, 766uh_cb (void *cls, struct MHD_Connection *con, void *req_cls,
767 const char *extra_in, size_t extra_in_size, MHD_socket sock, 767 const char *extra_in, size_t extra_in_size, MHD_socket sock,
768 struct MHD_UpgradeResponseHandle *urh) 768 struct MHD_UpgradeResponseHandle *urh)
769{ 769{
@@ -774,7 +774,7 @@ uh_cb (void *cls, struct MHD_Connection *con, void *con_cls,
774 774
775 (void) cls; /* Unused. Silent compiler warning. */ 775 (void) cls; /* Unused. Silent compiler warning. */
776 (void) con; /* Unused. Silent compiler warning. */ 776 (void) con; /* Unused. Silent compiler warning. */
777 (void) con_cls; /* Unused. Silent compiler warning. */ 777 (void) req_cls; /* Unused. Silent compiler warning. */
778 (void) extra_in; /* Unused. Silent compiler warning. */ 778 (void) extra_in; /* Unused. Silent compiler warning. */
779 (void) extra_in_size; /* Unused. Silent compiler warning. */ 779 (void) extra_in_size; /* Unused. Silent compiler warning. */
780 780
@@ -814,7 +814,7 @@ uh_cb (void *cls, struct MHD_Connection *con, void *con_cls,
814static enum MHD_Result 814static enum MHD_Result
815ahc_cb (void *cls, struct MHD_Connection *con, const char *url, 815ahc_cb (void *cls, struct MHD_Connection *con, const char *url,
816 const char *method, const char *version, const char *upload_data, 816 const char *method, const char *version, const char *upload_data,
817 size_t *upload_data_size, void **ptr) 817 size_t *upload_data_size, void **req_cls)
818{ 818{
819 struct MHD_Response *res; 819 struct MHD_Response *res;
820 const char *upg_header; 820 const char *upg_header;
@@ -830,12 +830,12 @@ ahc_cb (void *cls, struct MHD_Connection *con, const char *url,
830 (void) upload_data; /* Unused. Silent compiler warning. */ 830 (void) upload_data; /* Unused. Silent compiler warning. */
831 (void) upload_data_size; /* Unused. Silent compiler warning. */ 831 (void) upload_data_size; /* Unused. Silent compiler warning. */
832 832
833 if (NULL == *ptr) 833 if (NULL == *req_cls)
834 { 834 {
835 *ptr = (void *) 1; 835 *req_cls = (void *) 1;
836 return MHD_YES; 836 return MHD_YES;
837 } 837 }
838 *ptr = NULL; 838 *req_cls = NULL;
839 upg_header = MHD_lookup_connection_value (con, MHD_HEADER_KIND, 839 upg_header = MHD_lookup_connection_value (con, MHD_HEADER_KIND,
840 MHD_HTTP_HEADER_UPGRADE); 840 MHD_HTTP_HEADER_UPGRADE);
841 con_header = MHD_lookup_connection_value (con, MHD_HEADER_KIND, 841 con_header = MHD_lookup_connection_value (con, MHD_HEADER_KIND,
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 811b2fc0..87d2f86e 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -1629,12 +1629,12 @@ enum MHD_OPTION
1629 * void * my_logger(void *cls, const char *uri, struct MHD_Connection *con) 1629 * void * my_logger(void *cls, const char *uri, struct MHD_Connection *con)
1630 * 1630 *
1631 * where the return value will be passed as 1631 * where the return value will be passed as
1632 * (`* con_cls`) in calls to the #MHD_AccessHandlerCallback 1632 * (`* req_cls`) in calls to the #MHD_AccessHandlerCallback
1633 * when this request is processed later; returning a 1633 * when this request is processed later; returning a
1634 * value of NULL has no special significance (however, 1634 * value of NULL has no special significance (however,
1635 * note that if you return non-NULL, you can no longer 1635 * note that if you return non-NULL, you can no longer
1636 * rely on the first call to the access handler having 1636 * rely on the first call to the access handler having
1637 * `NULL == *con_cls` on entry;) 1637 * `NULL == *req_cls` on entry;)
1638 * "cls" will be set to the second argument following 1638 * "cls" will be set to the second argument following
1639 * #MHD_OPTION_URI_LOG_CALLBACK. Finally, uri will 1639 * #MHD_OPTION_URI_LOG_CALLBACK. Finally, uri will
1640 * be the 0-terminated URI of the request. 1640 * be the 0-terminated URI of the request.
@@ -2252,10 +2252,10 @@ enum MHD_ConnectionInfoType
2252 /** 2252 /**
2253 * Returns the client-specific pointer to a `void *` that was (possibly) 2253 * Returns the client-specific pointer to a `void *` that was (possibly)
2254 * set during a #MHD_NotifyConnectionCallback when the socket was 2254 * set during a #MHD_NotifyConnectionCallback when the socket was
2255 * first accepted. Note that this is NOT the same as the "con_cls" 2255 * first accepted.
2256 * argument of the #MHD_AccessHandlerCallback. The "con_cls" is 2256 * Note that this is NOT the same as the "req_cls" argument of
2257 * fresh for each HTTP request, while the "socket_context" is fresh 2257 * the #MHD_AccessHandlerCallback. The "req_cls" is fresh for each
2258 * for each socket. 2258 * HTTP request, while the "socket_context" is fresh for each socket.
2259 */ 2259 */
2260 MHD_CONNECTION_INFO_SOCKET_CONTEXT, 2260 MHD_CONNECTION_INFO_SOCKET_CONTEXT,
2261 2261
@@ -2428,7 +2428,7 @@ typedef enum MHD_Result
2428 * @param[in,out] upload_data_size set initially to the size of the 2428 * @param[in,out] upload_data_size set initially to the size of the
2429 * @a upload_data provided; the method must update this 2429 * @a upload_data provided; the method must update this
2430 * value to the number of bytes NOT processed; 2430 * value to the number of bytes NOT processed;
2431 * @param[in,out] con_cls pointer that the callback can set to some 2431 * @param[in,out] req_cls pointer that the callback can set to some
2432 * address and that will be preserved by MHD for future 2432 * address and that will be preserved by MHD for future
2433 * calls for this request; since the access handler may 2433 * calls for this request; since the access handler may
2434 * be called many times (i.e., for a PUT/POST operation 2434 * be called many times (i.e., for a PUT/POST operation
@@ -2437,7 +2437,7 @@ typedef enum MHD_Result
2437 * If necessary, this state can be cleaned up in the 2437 * If necessary, this state can be cleaned up in the
2438 * global #MHD_RequestCompletedCallback (which 2438 * global #MHD_RequestCompletedCallback (which
2439 * can be set with the #MHD_OPTION_NOTIFY_COMPLETED). 2439 * can be set with the #MHD_OPTION_NOTIFY_COMPLETED).
2440 * Initially, `*con_cls` will be NULL. 2440 * Initially, `*req_cls` will be NULL.
2441 * @return #MHD_YES if the connection was handled successfully, 2441 * @return #MHD_YES if the connection was handled successfully,
2442 * #MHD_NO if the socket must be closed due to a serious 2442 * #MHD_NO if the socket must be closed due to a serious
2443 * error while handling the request 2443 * error while handling the request
@@ -2452,7 +2452,7 @@ typedef enum MHD_Result
2452 const char *version, 2452 const char *version,
2453 const char *upload_data, 2453 const char *upload_data,
2454 size_t *upload_data_size, 2454 size_t *upload_data_size,
2455 void **con_cls); 2455 void **req_cls);
2456 2456
2457 2457
2458/** 2458/**
@@ -2461,7 +2461,7 @@ typedef enum MHD_Result
2461 * 2461 *
2462 * @param cls client-defined closure 2462 * @param cls client-defined closure
2463 * @param connection connection handle 2463 * @param connection connection handle
2464 * @param con_cls value as set by the last call to 2464 * @param req_cls value as set by the last call to
2465 * the #MHD_AccessHandlerCallback 2465 * the #MHD_AccessHandlerCallback
2466 * @param toe reason for request termination 2466 * @param toe reason for request termination
2467 * @see #MHD_OPTION_NOTIFY_COMPLETED 2467 * @see #MHD_OPTION_NOTIFY_COMPLETED
@@ -2470,7 +2470,7 @@ typedef enum MHD_Result
2470typedef void 2470typedef void
2471(*MHD_RequestCompletedCallback) (void *cls, 2471(*MHD_RequestCompletedCallback) (void *cls,
2472 struct MHD_Connection *connection, 2472 struct MHD_Connection *connection,
2473 void **con_cls, 2473 void **req_cls,
2474 enum MHD_RequestTerminationCode toe); 2474 enum MHD_RequestTerminationCode toe);
2475 2475
2476 2476
@@ -2483,7 +2483,7 @@ typedef void
2483 * @param socket_context socket-specific pointer where the 2483 * @param socket_context socket-specific pointer where the
2484 * client can associate some state specific 2484 * client can associate some state specific
2485 * to the TCP connection; note that this is 2485 * to the TCP connection; note that this is
2486 * different from the "con_cls" which is per 2486 * different from the "req_cls" which is per
2487 * HTTP request. The client can initialize 2487 * HTTP request. The client can initialize
2488 * during #MHD_CONNECTION_NOTIFY_STARTED and 2488 * during #MHD_CONNECTION_NOTIFY_STARTED and
2489 * cleanup during #MHD_CONNECTION_NOTIFY_CLOSED 2489 * cleanup during #MHD_CONNECTION_NOTIFY_CLOSED
@@ -3790,7 +3790,7 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
3790 * @param connection original HTTP connection handle, 3790 * @param connection original HTTP connection handle,
3791 * giving the function a last chance 3791 * giving the function a last chance
3792 * to inspect the original HTTP request 3792 * to inspect the original HTTP request
3793 * @param con_cls last value left in `con_cls` of the `MHD_AccessHandlerCallback` 3793 * @param req_cls last value left in `req_cls` of the `MHD_AccessHandlerCallback`
3794 * @param extra_in if we happened to have read bytes after the 3794 * @param extra_in if we happened to have read bytes after the
3795 * HTTP header already (because the client sent 3795 * HTTP header already (because the client sent
3796 * more than the HTTP header of the request before 3796 * more than the HTTP header of the request before
@@ -3815,7 +3815,7 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh,
3815typedef void 3815typedef void
3816(*MHD_UpgradeHandler)(void *cls, 3816(*MHD_UpgradeHandler)(void *cls,
3817 struct MHD_Connection *connection, 3817 struct MHD_Connection *connection,
3818 void *con_cls, 3818 void *req_cls,
3819 const char *extra_in, 3819 const char *extra_in,
3820 size_t extra_in_size, 3820 size_t extra_in_size,
3821 MHD_socket sock, 3821 MHD_socket sock,
diff --git a/src/include/microhttpd2.h b/src/include/microhttpd2.h
index 924814f9..5bf125ef 100644
--- a/src/include/microhttpd2.h
+++ b/src/include/microhttpd2.h
@@ -2429,7 +2429,7 @@ enum MHD_ConnectionNotificationCode
2429 * @param socket_context socket-specific pointer where the 2429 * @param socket_context socket-specific pointer where the
2430 * client can associate some state specific 2430 * client can associate some state specific
2431 * to the TCP connection; note that this is 2431 * to the TCP connection; note that this is
2432 * different from the "con_cls" which is per 2432 * different from the "req_cls" which is per
2433 * HTTP request. The client can initialize 2433 * HTTP request. The client can initialize
2434 * during #MHD_CONNECTION_NOTIFY_STARTED and 2434 * during #MHD_CONNECTION_NOTIFY_STARTED and
2435 * cleanup during #MHD_CONNECTION_NOTIFY_CLOSED 2435 * cleanup during #MHD_CONNECTION_NOTIFY_CLOSED
@@ -3303,7 +3303,7 @@ MHD_NONNULL (1);
3303 * @param connection original HTTP connection handle, 3303 * @param connection original HTTP connection handle,
3304 * giving the function a last chance 3304 * giving the function a last chance
3305 * to inspect the original HTTP request 3305 * to inspect the original HTTP request
3306 * @param con_cls last value left in `con_cls` of the `MHD_AccessHandlerCallback` 3306 * @param req_cls last value left in `req_cls` of the `MHD_AccessHandlerCallback`
3307 * @param extra_in if we happened to have read bytes after the 3307 * @param extra_in if we happened to have read bytes after the
3308 * HTTP header already (because the client sent 3308 * HTTP header already (because the client sent
3309 * more than the HTTP header of the request before 3309 * more than the HTTP header of the request before
@@ -3328,7 +3328,7 @@ MHD_NONNULL (1);
3328typedef void 3328typedef void
3329(*MHD_UpgradeHandler)(void *cls, 3329(*MHD_UpgradeHandler)(void *cls,
3330 struct MHD_Connection *connection, 3330 struct MHD_Connection *connection,
3331 void *con_cls, 3331 void *req_cls,
3332 const char *extra_in, 3332 const char *extra_in,
3333 size_t extra_in_size, 3333 size_t extra_in_size,
3334 MHD_socket sock, 3334 MHD_socket sock,
@@ -3644,8 +3644,8 @@ enum MHD_ConnectionInformationType
3644 /** 3644 /**
3645 * Returns the client-specific pointer to a `void *` that was (possibly) 3645 * Returns the client-specific pointer to a `void *` that was (possibly)
3646 * set during a #MHD_NotifyConnectionCallback when the socket was 3646 * set during a #MHD_NotifyConnectionCallback when the socket was
3647 * first accepted. Note that this is NOT the same as the "con_cls" 3647 * first accepted. Note that this is NOT the same as the "req_cls"
3648 * argument of the #MHD_AccessHandlerCallback. The "con_cls" is 3648 * argument of the #MHD_AccessHandlerCallback. The "req_cls" is
3649 * fresh for each HTTP request, while the "socket_context" is fresh 3649 * fresh for each HTTP request, while the "socket_context" is fresh
3650 * for each socket. 3650 * for each socket.
3651 */ 3651 */
diff --git a/src/microhttpd/test_client_put_stop.c b/src/microhttpd/test_client_put_stop.c
index c1707c5c..6c641e6f 100644
--- a/src/microhttpd/test_client_put_stop.c
+++ b/src/microhttpd/test_client_put_stop.c
@@ -1052,12 +1052,12 @@ struct term_notif_cb_param
1052static void 1052static void
1053term_cb (void *cls, 1053term_cb (void *cls,
1054 struct MHD_Connection *c, 1054 struct MHD_Connection *c,
1055 void **con_cls, 1055 void **req_cls,
1056 enum MHD_RequestTerminationCode term_code) 1056 enum MHD_RequestTerminationCode term_code)
1057{ 1057{
1058 struct term_notif_cb_param *param = (struct term_notif_cb_param *) cls; 1058 struct term_notif_cb_param *param = (struct term_notif_cb_param *) cls;
1059 if (NULL == con_cls) 1059 if (NULL == req_cls)
1060 mhdErrorExitDesc ("'con_cls' pointer is NULL"); 1060 mhdErrorExitDesc ("'req_cls' pointer is NULL");
1061 if (NULL == c) 1061 if (NULL == c)
1062 mhdErrorExitDesc ("'connection' pointer is NULL"); 1062 mhdErrorExitDesc ("'connection' pointer is NULL");
1063 if (NULL == param) 1063 if (NULL == param)
@@ -1220,7 +1220,7 @@ ahcCheck (void *cls,
1220 const char *method, 1220 const char *method,
1221 const char *version, 1221 const char *version,
1222 const char *upload_data, size_t *upload_data_size, 1222 const char *upload_data, size_t *upload_data_size,
1223 void **con_cls) 1223 void **req_cls)
1224{ 1224{
1225 static int marker; 1225 static int marker;
1226 enum MHD_Result ret; 1226 enum MHD_Result ret;
@@ -1273,13 +1273,13 @@ ahcCheck (void *cls,
1273 *upload_data_size = 0; 1273 *upload_data_size = 0;
1274 } 1274 }
1275 1275
1276 if (&marker != *con_cls) 1276 if (&marker != *req_cls)
1277 { 1277 {
1278 /* The first call of the callback for this connection */ 1278 /* The first call of the callback for this connection */
1279 mhd_assert (NULL == upload_data); 1279 mhd_assert (NULL == upload_data);
1280 param->req_body_uploaded = 0; 1280 param->req_body_uploaded = 0;
1281 1281
1282 *con_cls = &marker; 1282 *req_cls = &marker;
1283 return MHD_YES; 1283 return MHD_YES;
1284 } 1284 }
1285 1285
diff --git a/src/microhttpd/test_daemon.c b/src/microhttpd/test_daemon.c
index 14a77832..7a55ff65 100644
--- a/src/microhttpd/test_daemon.c
+++ b/src/microhttpd/test_daemon.c
@@ -81,11 +81,11 @@ ahc_nothing (void *cls,
81 const char *method, 81 const char *method,
82 const char *version, 82 const char *version,
83 const char *upload_data, size_t *upload_data_size, 83 const char *upload_data, size_t *upload_data_size,
84 void **unused) 84 void **req_cls)
85{ 85{
86 (void) cls; (void) connection; (void) url; /* Unused. Silent compiler warning. */ 86 (void) cls; (void) connection; (void) url; /* Unused. Silent compiler warning. */
87 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */ 87 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
88 (void) upload_data_size; (void) unused; /* Unused. Silent compiler warning. */ 88 (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */
89 89
90 return MHD_NO; 90 return MHD_NO;
91} 91}
diff --git a/src/microhttpd/test_options.c b/src/microhttpd/test_options.c
index 575b6a2b..b79ddb01 100644
--- a/src/microhttpd/test_options.c
+++ b/src/microhttpd/test_options.c
@@ -42,7 +42,7 @@ ahc_echo (void *cls,
42 const char *method, 42 const char *method,
43 const char *version, 43 const char *version,
44 const char *upload_data, size_t *upload_data_size, 44 const char *upload_data, size_t *upload_data_size,
45 void **unused) 45 void **req_cls)
46{ 46{
47 (void) cls; 47 (void) cls;
48 (void) connection; 48 (void) connection;
@@ -51,7 +51,7 @@ ahc_echo (void *cls,
51 (void) version; 51 (void) version;
52 (void) upload_data; 52 (void) upload_data;
53 (void) upload_data_size; 53 (void) upload_data_size;
54 (void) unused; 54 (void) req_cls;
55 55
56 return 0; 56 return 0;
57} 57}
diff --git a/src/microhttpd/test_start_stop.c b/src/microhttpd/test_start_stop.c
index db2d0684..34372090 100644
--- a/src/microhttpd/test_start_stop.c
+++ b/src/microhttpd/test_start_stop.c
@@ -42,11 +42,11 @@ ahc_echo (void *cls,
42 const char *method, 42 const char *method,
43 const char *version, 43 const char *version,
44 const char *upload_data, size_t *upload_data_size, 44 const char *upload_data, size_t *upload_data_size,
45 void **unused) 45 void **req_cls)
46{ 46{
47 (void) cls; (void) connection; (void) url; /* Unused. Silent compiler warning. */ 47 (void) cls; (void) connection; (void) url; /* Unused. Silent compiler warning. */
48 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */ 48 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
49 (void) upload_data_size; (void) unused; /* Unused. Silent compiler warning. */ 49 (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */
50 50
51 return MHD_NO; 51 return MHD_NO;
52} 52}
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
index fa91f7dc..0bbb08e9 100644
--- a/src/microhttpd/test_upgrade.c
+++ b/src/microhttpd/test_upgrade.c
@@ -628,14 +628,14 @@ term_reason_str (enum MHD_RequestTerminationCode term_code)
628 * 628 *
629 * @param cls client-defined closure 629 * @param cls client-defined closure
630 * @param connection connection handle 630 * @param connection connection handle
631 * @param con_cls value as set by the last call to 631 * @param req_cls value as set by the last call to
632 * the #MHD_AccessHandlerCallback 632 * the #MHD_AccessHandlerCallback
633 * @param toe reason for request termination 633 * @param toe reason for request termination
634 */ 634 */
635static void 635static void
636notify_completed_cb (void *cls, 636notify_completed_cb (void *cls,
637 struct MHD_Connection *connection, 637 struct MHD_Connection *connection,
638 void **con_cls, 638 void **req_cls,
639 enum MHD_RequestTerminationCode toe) 639 enum MHD_RequestTerminationCode toe)
640{ 640{
641 (void) cls; 641 (void) cls;
@@ -647,15 +647,15 @@ notify_completed_cb (void *cls,
647 (toe != MHD_REQUEST_TERMINATED_CLIENT_ABORT) && 647 (toe != MHD_REQUEST_TERMINATED_CLIENT_ABORT) &&
648 (toe != MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN) ) 648 (toe != MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN) )
649 mhdErrorExitDesc ("notify_completed_cb() called with wrong code"); 649 mhdErrorExitDesc ("notify_completed_cb() called with wrong code");
650 if (NULL == con_cls) 650 if (NULL == req_cls)
651 mhdErrorExitDesc ("'con_cls' parameter is NULL"); 651 mhdErrorExitDesc ("'req_cls' parameter is NULL");
652 if (NULL == *con_cls) 652 if (NULL == *req_cls)
653 mhdErrorExitDesc ("'*con_cls' pointer is NULL"); 653 mhdErrorExitDesc ("'*req_cls' pointer is NULL");
654 if (! pthread_equal (**((pthread_t **) con_cls), 654 if (! pthread_equal (**((pthread_t **) req_cls),
655 pthread_self ())) 655 pthread_self ()))
656 mhdErrorExitDesc ("notify_completed_cb() is called in wrong thread"); 656 mhdErrorExitDesc ("notify_completed_cb() is called in wrong thread");
657 free (*con_cls); 657 free (*req_cls);
658 *con_cls = NULL; 658 *req_cls = NULL;
659} 659}
660 660
661 661
@@ -700,7 +700,7 @@ log_cb (void *cls,
700 * @param socket_context socket-specific pointer where the 700 * @param socket_context socket-specific pointer where the
701 * client can associate some state specific 701 * client can associate some state specific
702 * to the TCP connection; note that this is 702 * to the TCP connection; note that this is
703 * different from the "con_cls" which is per 703 * different from the "req_cls" which is per
704 * HTTP request. The client can initialize 704 * HTTP request. The client can initialize
705 * during #MHD_CONNECTION_NOTIFY_STARTED and 705 * during #MHD_CONNECTION_NOTIFY_STARTED and
706 * cleanup during #MHD_CONNECTION_NOTIFY_CLOSED 706 * cleanup during #MHD_CONNECTION_NOTIFY_CLOSED
@@ -956,7 +956,7 @@ run_usock_client (void *cls)
956 * @param connection original HTTP connection handle, 956 * @param connection original HTTP connection handle,
957 * giving the function a last chance 957 * giving the function a last chance
958 * to inspect the original HTTP request 958 * to inspect the original HTTP request
959 * @param con_cls last value left in `con_cls` of the `MHD_AccessHandlerCallback` 959 * @param req_cls last value left in `req_cls` of the `MHD_AccessHandlerCallback`
960 * @param extra_in if we happened to have read bytes after the 960 * @param extra_in if we happened to have read bytes after the
961 * HTTP header already (because the client sent 961 * HTTP header already (because the client sent
962 * more than the HTTP header of the request before 962 * more than the HTTP header of the request before
@@ -981,7 +981,7 @@ run_usock_client (void *cls)
981static void 981static void
982upgrade_cb (void *cls, 982upgrade_cb (void *cls,
983 struct MHD_Connection *connection, 983 struct MHD_Connection *connection,
984 void *con_cls, 984 void *req_cls,
985 const char *extra_in, 985 const char *extra_in,
986 size_t extra_in_size, 986 size_t extra_in_size,
987 MHD_socket sock, 987 MHD_socket sock,
@@ -989,7 +989,7 @@ upgrade_cb (void *cls,
989{ 989{
990 (void) cls; 990 (void) cls;
991 (void) connection; 991 (void) connection;
992 (void) con_cls; 992 (void) req_cls;
993 (void) extra_in; /* Unused. Silent compiler warning. */ 993 (void) extra_in; /* Unused. Silent compiler warning. */
994 994
995 usock = wr_create_from_plain_sckt (sock); 995 usock = wr_create_from_plain_sckt (sock);
@@ -1028,7 +1028,7 @@ upgrade_cb (void *cls,
1028 * @param upload_data_size set initially to the size of the 1028 * @param upload_data_size set initially to the size of the
1029 * @a upload_data provided; the method must update this 1029 * @a upload_data provided; the method must update this
1030 * value to the number of bytes NOT processed; 1030 * value to the number of bytes NOT processed;
1031 * @param con_cls pointer that the callback can set to some 1031 * @param req_cls pointer that the callback can set to some
1032 * address and that will be preserved by MHD for future 1032 * address and that will be preserved by MHD for future
1033 * calls for this request; since the access handler may 1033 * calls for this request; since the access handler may
1034 * be called many times (i.e., for a PUT/POST operation 1034 * be called many times (i.e., for a PUT/POST operation
@@ -1037,7 +1037,7 @@ upgrade_cb (void *cls,
1037 * If necessary, this state can be cleaned up in the 1037 * If necessary, this state can be cleaned up in the
1038 * global #MHD_RequestCompletedCallback (which 1038 * global #MHD_RequestCompletedCallback (which
1039 * can be set with the #MHD_OPTION_NOTIFY_COMPLETED). 1039 * can be set with the #MHD_OPTION_NOTIFY_COMPLETED).
1040 * Initially, `*con_cls` will be NULL. 1040 * Initially, `*req_cls` will be NULL.
1041 * @return #MHD_YES if the connection was handled successfully, 1041 * @return #MHD_YES if the connection was handled successfully,
1042 * #MHD_NO if the socket must be closed due to a serious 1042 * #MHD_NO if the socket must be closed due to a serious
1043 * error while handling the request 1043 * error while handling the request
@@ -1050,7 +1050,7 @@ ahc_upgrade (void *cls,
1050 const char *version, 1050 const char *version,
1051 const char *upload_data, 1051 const char *upload_data,
1052 size_t *upload_data_size, 1052 size_t *upload_data_size,
1053 void **con_cls) 1053 void **req_cls)
1054{ 1054{
1055 struct MHD_Response *resp; 1055 struct MHD_Response *resp;
1056 (void) cls; 1056 (void) cls;
@@ -1060,11 +1060,11 @@ ahc_upgrade (void *cls,
1060 (void) upload_data; 1060 (void) upload_data;
1061 (void) upload_data_size; /* Unused. Silent compiler warning. */ 1061 (void) upload_data_size; /* Unused. Silent compiler warning. */
1062 1062
1063 if (NULL == con_cls) 1063 if (NULL == req_cls)
1064 mhdErrorExitDesc ("'con_cls' is NULL"); 1064 mhdErrorExitDesc ("'req_cls' is NULL");
1065 if (NULL == *con_cls) 1065 if (NULL == *req_cls)
1066 mhdErrorExitDesc ("'*con_cls' value is NULL"); 1066 mhdErrorExitDesc ("'*req_cls' value is NULL");
1067 if (! pthread_equal (**((pthread_t **) con_cls), pthread_self ())) 1067 if (! pthread_equal (**((pthread_t **) req_cls), pthread_self ()))
1068 mhdErrorExitDesc ("ahc_upgrade() is called in wrong thread"); 1068 mhdErrorExitDesc ("ahc_upgrade() is called in wrong thread");
1069 resp = MHD_create_response_for_upgrade (&upgrade_cb, 1069 resp = MHD_create_response_for_upgrade (&upgrade_cb,
1070 NULL); 1070 NULL);
diff --git a/src/microhttpd/test_upgrade_large.c b/src/microhttpd/test_upgrade_large.c
index 3ccb1985..1928080d 100644
--- a/src/microhttpd/test_upgrade_large.c
+++ b/src/microhttpd/test_upgrade_large.c
@@ -796,14 +796,14 @@ term_reason_str (enum MHD_RequestTerminationCode term_code)
796 * 796 *
797 * @param cls client-defined closure 797 * @param cls client-defined closure
798 * @param connection connection handle 798 * @param connection connection handle
799 * @param con_cls value as set by the last call to 799 * @param req_cls value as set by the last call to
800 * the #MHD_AccessHandlerCallback 800 * the #MHD_AccessHandlerCallback
801 * @param toe reason for request termination 801 * @param toe reason for request termination
802 */ 802 */
803static void 803static void
804notify_completed_cb (void *cls, 804notify_completed_cb (void *cls,
805 struct MHD_Connection *connection, 805 struct MHD_Connection *connection,
806 void **con_cls, 806 void **req_cls,
807 enum MHD_RequestTerminationCode toe) 807 enum MHD_RequestTerminationCode toe)
808{ 808{
809 (void) cls; 809 (void) cls;
@@ -815,15 +815,15 @@ notify_completed_cb (void *cls,
815 (toe != MHD_REQUEST_TERMINATED_CLIENT_ABORT) && 815 (toe != MHD_REQUEST_TERMINATED_CLIENT_ABORT) &&
816 (toe != MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN) ) 816 (toe != MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN) )
817 mhdErrorExitDesc ("notify_completed_cb() called with wrong code"); 817 mhdErrorExitDesc ("notify_completed_cb() called with wrong code");
818 if (NULL == con_cls) 818 if (NULL == req_cls)
819 mhdErrorExitDesc ("'con_cls' parameter is NULL"); 819 mhdErrorExitDesc ("'req_cls' parameter is NULL");
820 if (NULL == *con_cls) 820 if (NULL == *req_cls)
821 mhdErrorExitDesc ("'*con_cls' pointer is NULL"); 821 mhdErrorExitDesc ("'*req_cls' pointer is NULL");
822 if (! pthread_equal (**((pthread_t **) con_cls), 822 if (! pthread_equal (**((pthread_t **) req_cls),
823 pthread_self ())) 823 pthread_self ()))
824 mhdErrorExitDesc ("notify_completed_cb() is called in wrong thread"); 824 mhdErrorExitDesc ("notify_completed_cb() is called in wrong thread");
825 free (*con_cls); 825 free (*req_cls);
826 *con_cls = NULL; 826 *req_cls = NULL;
827} 827}
828 828
829 829
@@ -868,7 +868,7 @@ log_cb (void *cls,
868 * @param socket_context socket-specific pointer where the 868 * @param socket_context socket-specific pointer where the
869 * client can associate some state specific 869 * client can associate some state specific
870 * to the TCP connection; note that this is 870 * to the TCP connection; note that this is
871 * different from the "con_cls" which is per 871 * different from the "req_cls" which is per
872 * HTTP request. The client can initialize 872 * HTTP request. The client can initialize
873 * during #MHD_CONNECTION_NOTIFY_STARTED and 873 * during #MHD_CONNECTION_NOTIFY_STARTED and
874 * cleanup during #MHD_CONNECTION_NOTIFY_CLOSED 874 * cleanup during #MHD_CONNECTION_NOTIFY_CLOSED
@@ -1139,7 +1139,7 @@ run_usock_client (void *cls)
1139 * @param connection original HTTP connection handle, 1139 * @param connection original HTTP connection handle,
1140 * giving the function a last chance 1140 * giving the function a last chance
1141 * to inspect the original HTTP request 1141 * to inspect the original HTTP request
1142 * @param con_cls last value left in `con_cls` of the `MHD_AccessHandlerCallback` 1142 * @param req_cls last value left in `req_cls` of the `MHD_AccessHandlerCallback`
1143 * @param extra_in if we happened to have read bytes after the 1143 * @param extra_in if we happened to have read bytes after the
1144 * HTTP header already (because the client sent 1144 * HTTP header already (because the client sent
1145 * more than the HTTP header of the request before 1145 * more than the HTTP header of the request before
@@ -1164,7 +1164,7 @@ run_usock_client (void *cls)
1164static void 1164static void
1165upgrade_cb (void *cls, 1165upgrade_cb (void *cls,
1166 struct MHD_Connection *connection, 1166 struct MHD_Connection *connection,
1167 void *con_cls, 1167 void *req_cls,
1168 const char *extra_in, 1168 const char *extra_in,
1169 size_t extra_in_size, 1169 size_t extra_in_size,
1170 MHD_socket sock, 1170 MHD_socket sock,
@@ -1172,7 +1172,7 @@ upgrade_cb (void *cls,
1172{ 1172{
1173 (void) cls; 1173 (void) cls;
1174 (void) connection; 1174 (void) connection;
1175 (void) con_cls; 1175 (void) req_cls;
1176 (void) extra_in; /* Unused. Silent compiler warning. */ 1176 (void) extra_in; /* Unused. Silent compiler warning. */
1177 1177
1178 usock = wr_create_from_plain_sckt (sock); 1178 usock = wr_create_from_plain_sckt (sock);
@@ -1211,7 +1211,7 @@ upgrade_cb (void *cls,
1211 * @param upload_data_size set initially to the size of the 1211 * @param upload_data_size set initially to the size of the
1212 * @a upload_data provided; the method must update this 1212 * @a upload_data provided; the method must update this
1213 * value to the number of bytes NOT processed; 1213 * value to the number of bytes NOT processed;
1214 * @param con_cls pointer that the callback can set to some 1214 * @param req_cls pointer that the callback can set to some
1215 * address and that will be preserved by MHD for future 1215 * address and that will be preserved by MHD for future
1216 * calls for this request; since the access handler may 1216 * calls for this request; since the access handler may
1217 * be called many times (i.e., for a PUT/POST operation 1217 * be called many times (i.e., for a PUT/POST operation
@@ -1220,7 +1220,7 @@ upgrade_cb (void *cls,
1220 * If necessary, this state can be cleaned up in the 1220 * If necessary, this state can be cleaned up in the
1221 * global #MHD_RequestCompletedCallback (which 1221 * global #MHD_RequestCompletedCallback (which
1222 * can be set with the #MHD_OPTION_NOTIFY_COMPLETED). 1222 * can be set with the #MHD_OPTION_NOTIFY_COMPLETED).
1223 * Initially, `*con_cls` will be NULL. 1223 * Initially, `*req_cls` will be NULL.
1224 * @return #MHD_YES if the connection was handled successfully, 1224 * @return #MHD_YES if the connection was handled successfully,
1225 * #MHD_NO if the socket must be closed due to a serious 1225 * #MHD_NO if the socket must be closed due to a serious
1226 * error while handling the request 1226 * error while handling the request
@@ -1233,7 +1233,7 @@ ahc_upgrade (void *cls,
1233 const char *version, 1233 const char *version,
1234 const char *upload_data, 1234 const char *upload_data,
1235 size_t *upload_data_size, 1235 size_t *upload_data_size,
1236 void **con_cls) 1236 void **req_cls)
1237{ 1237{
1238 struct MHD_Response *resp; 1238 struct MHD_Response *resp;
1239 (void) cls; 1239 (void) cls;
@@ -1243,11 +1243,11 @@ ahc_upgrade (void *cls,
1243 (void) upload_data; 1243 (void) upload_data;
1244 (void) upload_data_size; /* Unused. Silent compiler warning. */ 1244 (void) upload_data_size; /* Unused. Silent compiler warning. */
1245 1245
1246 if (NULL == con_cls) 1246 if (NULL == req_cls)
1247 mhdErrorExitDesc ("'con_cls' is NULL"); 1247 mhdErrorExitDesc ("'req_cls' is NULL");
1248 if (NULL == *con_cls) 1248 if (NULL == *req_cls)
1249 mhdErrorExitDesc ("'*con_cls' value is NULL"); 1249 mhdErrorExitDesc ("'*req_cls' value is NULL");
1250 if (! pthread_equal (**((pthread_t **) con_cls), pthread_self ())) 1250 if (! pthread_equal (**((pthread_t **) req_cls), pthread_self ()))
1251 mhdErrorExitDesc ("ahc_upgrade() is called in wrong thread"); 1251 mhdErrorExitDesc ("ahc_upgrade() is called in wrong thread");
1252 resp = MHD_create_response_for_upgrade (&upgrade_cb, 1252 resp = MHD_create_response_for_upgrade (&upgrade_cb,
1253 NULL); 1253 NULL);
diff --git a/src/microhttpd_ws/test_websocket_browser.c b/src/microhttpd_ws/test_websocket_browser.c
index 72354257..96e7755f 100644
--- a/src/microhttpd_ws/test_websocket_browser.c
+++ b/src/microhttpd_ws/test_websocket_browser.c
@@ -194,7 +194,7 @@ make_blocking (MHD_socket fd);
194static void 194static void
195upgrade_handler (void *cls, 195upgrade_handler (void *cls,
196 struct MHD_Connection *connection, 196 struct MHD_Connection *connection,
197 void *con_cls, 197 void *req_cls,
198 const char *extra_in, 198 const char *extra_in,
199 size_t extra_in_size, 199 size_t extra_in_size,
200 MHD_socket fd, 200 MHD_socket fd,
@@ -404,7 +404,7 @@ access_handler (void *cls,
404 const char *version, 404 const char *version,
405 const char *upload_data, 405 const char *upload_data,
406 size_t *upload_data_size, 406 size_t *upload_data_size,
407 void **ptr) 407 void **req_cls)
408{ 408{
409 static int aptr; 409 static int aptr;
410 struct MHD_Response *response; 410 struct MHD_Response *response;
@@ -416,13 +416,13 @@ access_handler (void *cls,
416 416
417 if (0 != strcmp (method, "GET")) 417 if (0 != strcmp (method, "GET"))
418 return MHD_NO; /* unexpected method */ 418 return MHD_NO; /* unexpected method */
419 if (&aptr != *ptr) 419 if (&aptr != *req_cls)
420 { 420 {
421 /* do never respond on first call */ 421 /* do never respond on first call */
422 *ptr = &aptr; 422 *req_cls = &aptr;
423 return MHD_YES; 423 return MHD_YES;
424 } 424 }
425 *ptr = NULL; /* reset when done */ 425 *req_cls = NULL; /* reset when done */
426 426
427 if (0 == strcmp (url, "/")) 427 if (0 == strcmp (url, "/"))
428 { 428 {
diff --git a/src/testcurl/https/test_empty_response.c b/src/testcurl/https/test_empty_response.c
index 1a466dd7..c2dcf300 100644
--- a/src/testcurl/https/test_empty_response.c
+++ b/src/testcurl/https/test_empty_response.c
@@ -45,12 +45,12 @@ ahc_echo (void *cls,
45 const char *method, 45 const char *method,
46 const char *version, 46 const char *version,
47 const char *upload_data, size_t *upload_data_size, 47 const char *upload_data, size_t *upload_data_size,
48 void **unused) 48 void **req_cls)
49{ 49{
50 struct MHD_Response *response; 50 struct MHD_Response *response;
51 enum MHD_Result ret; 51 enum MHD_Result ret;
52 (void) cls; (void) url; (void) method; (void) version; /* Unused. Silent compiler warning. */ 52 (void) cls; (void) url; (void) method; (void) version; /* Unused. Silent compiler warning. */
53 (void) upload_data; (void) upload_data_size; (void) unused; /* Unused. Silent compiler warning. */ 53 (void) upload_data; (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */
54 54
55 response = MHD_create_response_from_buffer (0, NULL, 55 response = MHD_create_response_from_buffer (0, NULL,
56 MHD_RESPMEM_PERSISTENT); 56 MHD_RESPMEM_PERSISTENT);
diff --git a/src/testcurl/https/test_https_get.c b/src/testcurl/https/test_https_get.c
index 503191e0..968a0b96 100644
--- a/src/testcurl/https/test_https_get.c
+++ b/src/testcurl/https/test_https_get.c
@@ -99,7 +99,7 @@ ahc_empty (void *cls,
99 const char *version, 99 const char *version,
100 const char *upload_data, 100 const char *upload_data,
101 size_t *upload_data_size, 101 size_t *upload_data_size,
102 void **unused) 102 void **req_cls)
103{ 103{
104 static int ptr; 104 static int ptr;
105 struct MHD_Response *response; 105 struct MHD_Response *response;
@@ -114,12 +114,12 @@ ahc_empty (void *cls,
114 if (0 != strcmp ("GET", 114 if (0 != strcmp ("GET",
115 method)) 115 method))
116 return MHD_NO; /* unexpected method */ 116 return MHD_NO; /* unexpected method */
117 if (&ptr != *unused) 117 if (&ptr != *req_cls)
118 { 118 {
119 *unused = &ptr; 119 *req_cls = &ptr;
120 return MHD_YES; 120 return MHD_YES;
121 } 121 }
122 *unused = NULL; 122 *req_cls = NULL;
123 response = MHD_create_response_from_buffer (0, 123 response = MHD_create_response_from_buffer (0,
124 NULL, 124 NULL,
125 MHD_RESPMEM_PERSISTENT); 125 MHD_RESPMEM_PERSISTENT);
diff --git a/src/testcurl/https/test_https_get_iovec.c b/src/testcurl/https/test_https_get_iovec.c
index 615ef340..3bdb610f 100644
--- a/src/testcurl/https/test_https_get_iovec.c
+++ b/src/testcurl/https/test_https_get_iovec.c
@@ -91,7 +91,7 @@ iovec_ahc (void *cls,
91 const char *version, 91 const char *version,
92 const char *upload_data, 92 const char *upload_data,
93 size_t *upload_data_size, 93 size_t *upload_data_size,
94 void **ptr) 94 void **req_cls)
95{ 95{
96 static int aptr; 96 static int aptr;
97 struct MHD_Response *response; 97 struct MHD_Response *response;
@@ -105,13 +105,13 @@ iovec_ahc (void *cls,
105 105
106 if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) 106 if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
107 return MHD_NO; /* unexpected method */ 107 return MHD_NO; /* unexpected method */
108 if (&aptr != *ptr) 108 if (&aptr != *req_cls)
109 { 109 {
110 /* do never respond on first call */ 110 /* do never respond on first call */
111 *ptr = &aptr; 111 *req_cls = &aptr;
112 return MHD_YES; 112 return MHD_YES;
113 } 113 }
114 *ptr = NULL; /* reset when done */ 114 *req_cls = NULL; /* reset when done */
115 115
116 /* Create some test data. */ 116 /* Create some test data. */
117 if (NULL == (data = malloc (TESTSTR_SIZE))) 117 if (NULL == (data = malloc (TESTSTR_SIZE)))
@@ -248,7 +248,7 @@ ahc_empty (void *cls,
248 const char *version, 248 const char *version,
249 const char *upload_data, 249 const char *upload_data,
250 size_t *upload_data_size, 250 size_t *upload_data_size,
251 void **unused) 251 void **req_cls)
252{ 252{
253 static int ptr; 253 static int ptr;
254 struct MHD_Response *response; 254 struct MHD_Response *response;
@@ -264,12 +264,12 @@ ahc_empty (void *cls,
264 if (0 != strcmp ("GET", 264 if (0 != strcmp ("GET",
265 method)) 265 method))
266 return MHD_NO; /* unexpected method */ 266 return MHD_NO; /* unexpected method */
267 if (&ptr != *unused) 267 if (&ptr != *req_cls)
268 { 268 {
269 *unused = &ptr; 269 *req_cls = &ptr;
270 return MHD_YES; 270 return MHD_YES;
271 } 271 }
272 *unused = NULL; 272 *req_cls = NULL;
273 273
274 iov.iov_base = NULL; 274 iov.iov_base = NULL;
275 iov.iov_len = 0; 275 iov.iov_len = 0;
diff --git a/src/testcurl/https/test_https_get_select.c b/src/testcurl/https/test_https_get_select.c
index 5c04aaab..65570aab 100644
--- a/src/testcurl/https/test_https_get_select.c
+++ b/src/testcurl/https/test_https_get_select.c
@@ -46,7 +46,7 @@ ahc_echo (void *cls,
46 const char *method, 46 const char *method,
47 const char *version, 47 const char *version,
48 const char *upload_data, size_t *upload_data_size, 48 const char *upload_data, size_t *upload_data_size,
49 void **unused) 49 void **req_cls)
50{ 50{
51 static int ptr; 51 static int ptr;
52 const char *me = cls; 52 const char *me = cls;
@@ -56,12 +56,12 @@ ahc_echo (void *cls,
56 56
57 if (0 != strcmp (me, method)) 57 if (0 != strcmp (me, method))
58 return MHD_NO; /* unexpected method */ 58 return MHD_NO; /* unexpected method */
59 if (&ptr != *unused) 59 if (&ptr != *req_cls)
60 { 60 {
61 *unused = &ptr; 61 *req_cls = &ptr;
62 return MHD_YES; 62 return MHD_YES;
63 } 63 }
64 *unused = NULL; 64 *req_cls = NULL;
65 response = MHD_create_response_from_buffer (strlen (url), 65 response = MHD_create_response_from_buffer (strlen (url),
66 (void *) url, 66 (void *) url,
67 MHD_RESPMEM_MUST_COPY); 67 MHD_RESPMEM_MUST_COPY);
diff --git a/src/testcurl/https/test_https_session_info.c b/src/testcurl/https/test_https_session_info.c
index 3a49ce60..e428e278 100644
--- a/src/testcurl/https/test_https_session_info.c
+++ b/src/testcurl/https/test_https_session_info.c
@@ -47,7 +47,7 @@ static enum MHD_Result
47query_session_ahc (void *cls, struct MHD_Connection *connection, 47query_session_ahc (void *cls, struct MHD_Connection *connection,
48 const char *url, const char *method, 48 const char *url, const char *method,
49 const char *version, const char *upload_data, 49 const char *version, const char *upload_data,
50 size_t *upload_data_size, void **ptr) 50 size_t *upload_data_size, void **req_cls)
51{ 51{
52 struct MHD_Response *response; 52 struct MHD_Response *response;
53 enum MHD_Result ret; 53 enum MHD_Result ret;
@@ -55,9 +55,9 @@ query_session_ahc (void *cls, struct MHD_Connection *connection,
55 (void) cls; (void) url; (void) method; (void) version; /* Unused. Silent compiler warning. */ 55 (void) cls; (void) url; (void) method; (void) version; /* Unused. Silent compiler warning. */
56 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 56 (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
57 57
58 if (NULL == *ptr) 58 if (NULL == *req_cls)
59 { 59 {
60 *ptr = (void *) &query_session_ahc; 60 *req_cls = (void *) &query_session_ahc;
61 return MHD_YES; 61 return MHD_YES;
62 } 62 }
63 63
diff --git a/src/testcurl/https/tls_test_common.c b/src/testcurl/https/tls_test_common.c
index 9cce3d94..606ac7a3 100644
--- a/src/testcurl/https/tls_test_common.c
+++ b/src/testcurl/https/tls_test_common.c
@@ -207,7 +207,7 @@ http_ahc (void *cls,
207 const char *version, 207 const char *version,
208 const char *upload_data, 208 const char *upload_data,
209 size_t *upload_data_size, 209 size_t *upload_data_size,
210 void **ptr) 210 void **req_cls)
211{ 211{
212 static int aptr; 212 static int aptr;
213 struct MHD_Response *response; 213 struct MHD_Response *response;
@@ -217,13 +217,13 @@ http_ahc (void *cls,
217 217
218 if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) 218 if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
219 return MHD_NO; /* unexpected method */ 219 return MHD_NO; /* unexpected method */
220 if (&aptr != *ptr) 220 if (&aptr != *req_cls)
221 { 221 {
222 /* do never respond on first call */ 222 /* do never respond on first call */
223 *ptr = &aptr; 223 *req_cls = &aptr;
224 return MHD_YES; 224 return MHD_YES;
225 } 225 }
226 *ptr = NULL; /* reset when done */ 226 *req_cls = NULL; /* reset when done */
227 response = MHD_create_response_from_buffer (strlen (test_data), 227 response = MHD_create_response_from_buffer (strlen (test_data),
228 (void *) test_data, 228 (void *) test_data,
229 MHD_RESPMEM_PERSISTENT); 229 MHD_RESPMEM_PERSISTENT);
@@ -242,7 +242,7 @@ http_dummy_ahc (void *cls,
242 const char *version, 242 const char *version,
243 const char *upload_data, 243 const char *upload_data,
244 size_t *upload_data_size, 244 size_t *upload_data_size,
245 void **ptr) 245 void **req_cls)
246{ 246{
247 (void) cls; 247 (void) cls;
248 (void) connection; 248 (void) connection;
@@ -251,7 +251,7 @@ http_dummy_ahc (void *cls,
251 (void) version; /* Unused. Silent compiler warning. */ 251 (void) version; /* Unused. Silent compiler warning. */
252 (void) upload_data; 252 (void) upload_data;
253 (void) upload_data_size; 253 (void) upload_data_size;
254 (void) ptr; /* Unused. Silent compiler warning. */ 254 (void) req_cls; /* Unused. Silent compiler warning. */
255 return 0; 255 return 0;
256} 256}
257 257
diff --git a/src/testcurl/https/tls_test_common.h b/src/testcurl/https/tls_test_common.h
index a9af504d..b6a11172 100644
--- a/src/testcurl/https/tls_test_common.h
+++ b/src/testcurl/https/tls_test_common.h
@@ -106,13 +106,13 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx);
106enum MHD_Result 106enum MHD_Result
107http_ahc (void *cls, struct MHD_Connection *connection, 107http_ahc (void *cls, struct MHD_Connection *connection,
108 const char *url, const char *method, const char *upload_data, 108 const char *url, const char *method, const char *upload_data,
109 const char *version, size_t *upload_data_size, void **ptr); 109 const char *version, size_t *upload_data_size, void **req_cls);
110 110
111enum MHD_Result 111enum MHD_Result
112http_dummy_ahc (void *cls, struct MHD_Connection *connection, 112http_dummy_ahc (void *cls, struct MHD_Connection *connection,
113 const char *url, const char *method, const char *upload_data, 113 const char *url, const char *method, const char *upload_data,
114 const char *version, size_t *upload_data_size, 114 const char *version, size_t *upload_data_size,
115 void **ptr); 115 void **req_cls);
116 116
117 117
118/** 118/**
diff --git a/src/testcurl/perf_get.c b/src/testcurl/perf_get.c
index 9a7e3e08..3ee1c388 100644
--- a/src/testcurl/perf_get.c
+++ b/src/testcurl/perf_get.c
@@ -168,7 +168,7 @@ ahc_echo (void *cls,
168 const char *method, 168 const char *method,
169 const char *version, 169 const char *version,
170 const char *upload_data, size_t *upload_data_size, 170 const char *upload_data, size_t *upload_data_size,
171 void **unused) 171 void **req_cls)
172{ 172{
173 static int ptr; 173 static int ptr;
174 const char *me = cls; 174 const char *me = cls;
@@ -178,12 +178,12 @@ ahc_echo (void *cls,
178 178
179 if (0 != strcmp (me, method)) 179 if (0 != strcmp (me, method))
180 return MHD_NO; /* unexpected method */ 180 return MHD_NO; /* unexpected method */
181 if (&ptr != *unused) 181 if (&ptr != *req_cls)
182 { 182 {
183 *unused = &ptr; 183 *req_cls = &ptr;
184 return MHD_YES; 184 return MHD_YES;
185 } 185 }
186 *unused = NULL; 186 *req_cls = NULL;
187 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 187 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
188 if (ret == MHD_NO) 188 if (ret == MHD_NO)
189 abort (); 189 abort ();
diff --git a/src/testcurl/perf_get_concurrent.c b/src/testcurl/perf_get_concurrent.c
index 7427ef42..ea282874 100644
--- a/src/testcurl/perf_get_concurrent.c
+++ b/src/testcurl/perf_get_concurrent.c
@@ -159,7 +159,7 @@ ahc_echo (void *cls,
159 const char *method, 159 const char *method,
160 const char *version, 160 const char *version,
161 const char *upload_data, size_t *upload_data_size, 161 const char *upload_data, size_t *upload_data_size,
162 void **unused) 162 void **req_cls)
163{ 163{
164 static int ptr; 164 static int ptr;
165 const char *me = cls; 165 const char *me = cls;
@@ -169,12 +169,12 @@ ahc_echo (void *cls,
169 169
170 if (0 != strcmp (me, method)) 170 if (0 != strcmp (me, method))
171 return MHD_NO; /* unexpected method */ 171 return MHD_NO; /* unexpected method */
172 if (&ptr != *unused) 172 if (&ptr != *req_cls)
173 { 173 {
174 *unused = &ptr; 174 *req_cls = &ptr;
175 return MHD_YES; 175 return MHD_YES;
176 } 176 }
177 *unused = NULL; 177 *req_cls = NULL;
178 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 178 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
179 if (ret == MHD_NO) 179 if (ret == MHD_NO)
180 abort (); 180 abort ();
diff --git a/src/testcurl/test_add_conn.c b/src/testcurl/test_add_conn.c
index 746ecbaf..811bfba4 100644
--- a/src/testcurl/test_add_conn.c
+++ b/src/testcurl/test_add_conn.c
@@ -148,7 +148,7 @@ ahc_echo (void *cls,
148 const char *method, 148 const char *method,
149 const char *version, 149 const char *version,
150 const char *upload_data, size_t *upload_data_size, 150 const char *upload_data, size_t *upload_data_size,
151 void **unused) 151 void **req_cls)
152{ 152{
153 static int ptr; 153 static int ptr;
154 const char *me = cls; 154 const char *me = cls;
@@ -161,12 +161,12 @@ ahc_echo (void *cls,
161 161
162 if (0 != strcmp (me, method)) 162 if (0 != strcmp (me, method))
163 return MHD_NO; /* unexpected method */ 163 return MHD_NO; /* unexpected method */
164 if (&ptr != *unused) 164 if (&ptr != *req_cls)
165 { 165 {
166 *unused = &ptr; 166 *req_cls = &ptr;
167 return MHD_YES; 167 return MHD_YES;
168 } 168 }
169 *unused = NULL; 169 *req_cls = NULL;
170 v = MHD_lookup_connection_value (connection, 170 v = MHD_lookup_connection_value (connection,
171 MHD_GET_ARGUMENT_KIND, 171 MHD_GET_ARGUMENT_KIND,
172 "a"); 172 "a");
diff --git a/src/testcurl/test_callback.c b/src/testcurl/test_callback.c
index 8290851c..8b23ed02 100644
--- a/src/testcurl/test_callback.c
+++ b/src/testcurl/test_callback.c
@@ -69,7 +69,7 @@ callback (void *cls,
69 const char *version, 69 const char *version,
70 const char *upload_data, 70 const char *upload_data,
71 size_t *upload_data_size, 71 size_t *upload_data_size,
72 void **con_cls) 72 void **req_cls)
73{ 73{
74 struct callback_closure *cbc = calloc (1, sizeof(struct callback_closure)); 74 struct callback_closure *cbc = calloc (1, sizeof(struct callback_closure));
75 struct MHD_Response *r; 75 struct MHD_Response *r;
@@ -81,7 +81,7 @@ callback (void *cls,
81 (void) version; 81 (void) version;
82 (void) upload_data; /* Unused. Silent compiler warning. */ 82 (void) upload_data; /* Unused. Silent compiler warning. */
83 (void) upload_data_size; 83 (void) upload_data_size;
84 (void) con_cls; /* Unused. Silent compiler warning. */ 84 (void) req_cls; /* Unused. Silent compiler warning. */
85 85
86 if (NULL == cbc) 86 if (NULL == cbc)
87 return MHD_NO; 87 return MHD_NO;
diff --git a/src/testcurl/test_concurrent_stop.c b/src/testcurl/test_concurrent_stop.c
index ee41ef94..306b2b5b 100644
--- a/src/testcurl/test_concurrent_stop.c
+++ b/src/testcurl/test_concurrent_stop.c
@@ -143,7 +143,7 @@ ahc_echo (void *cls,
143 const char *version, 143 const char *version,
144 const char *upload_data, 144 const char *upload_data,
145 size_t *upload_data_size, 145 size_t *upload_data_size,
146 void **usr_data) 146 void **req_cls)
147{ 147{
148 static int marker; 148 static int marker;
149 const char *me = cls; 149 const char *me = cls;
@@ -153,12 +153,12 @@ ahc_echo (void *cls,
153 153
154 if (0 != strcmp (me, method)) 154 if (0 != strcmp (me, method))
155 return MHD_NO; /* unexpected method */ 155 return MHD_NO; /* unexpected method */
156 if (&marker != *usr_data) 156 if (&marker != *req_cls)
157 { 157 {
158 *usr_data = &marker; 158 *req_cls = &marker;
159 return MHD_YES; 159 return MHD_YES;
160 } 160 }
161 *usr_data = NULL; 161 *req_cls = NULL;
162 ret = MHD_queue_response (connection, 162 ret = MHD_queue_response (connection,
163 MHD_HTTP_OK, 163 MHD_HTTP_OK,
164 response); 164 response);
diff --git a/src/testcurl/test_delete.c b/src/testcurl/test_delete.c
index 43bd2840..f0e89395 100644
--- a/src/testcurl/test_delete.c
+++ b/src/testcurl/test_delete.c
@@ -90,12 +90,12 @@ ahc_echo (void *cls,
90 const char *method, 90 const char *method,
91 const char *version, 91 const char *version,
92 const char *upload_data, size_t *upload_data_size, 92 const char *upload_data, size_t *upload_data_size,
93 void **unused) 93 void **req_cls)
94{ 94{
95 int *done = cls; 95 int *done = cls;
96 struct MHD_Response *response; 96 struct MHD_Response *response;
97 enum MHD_Result ret; 97 enum MHD_Result ret;
98 (void) version; (void) unused; /* Unused. Silent compiler warning. */ 98 (void) version; (void) req_cls; /* Unused. Silent compiler warning. */
99 99
100 if (0 != strcmp ("DELETE", method)) 100 if (0 != strcmp ("DELETE", method))
101 return MHD_NO; /* unexpected method */ 101 return MHD_NO; /* unexpected method */
diff --git a/src/testcurl/test_digestauth.c b/src/testcurl/test_digestauth.c
index 3b2f2501..13c9c826 100644
--- a/src/testcurl/test_digestauth.c
+++ b/src/testcurl/test_digestauth.c
@@ -86,7 +86,7 @@ ahc_echo (void *cls,
86 const char *version, 86 const char *version,
87 const char *upload_data, 87 const char *upload_data,
88 size_t *upload_data_size, 88 size_t *upload_data_size,
89 void **unused) 89 void **req_cls)
90{ 90{
91 struct MHD_Response *response; 91 struct MHD_Response *response;
92 char *username; 92 char *username;
@@ -96,7 +96,7 @@ ahc_echo (void *cls,
96 int ret_i; 96 int ret_i;
97 (void) cls; (void) url; /* Unused. Silent compiler warning. */ 97 (void) cls; (void) url; /* Unused. Silent compiler warning. */
98 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */ 98 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
99 (void) upload_data_size; (void) unused; /* Unused. Silent compiler warning. */ 99 (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */
100 100
101 username = MHD_digest_auth_get_username (connection); 101 username = MHD_digest_auth_get_username (connection);
102 if ( (username == NULL) || 102 if ( (username == NULL) ||
diff --git a/src/testcurl/test_digestauth_sha256.c b/src/testcurl/test_digestauth_sha256.c
index a720c69b..7f8ebcd5 100644
--- a/src/testcurl/test_digestauth_sha256.c
+++ b/src/testcurl/test_digestauth_sha256.c
@@ -87,7 +87,7 @@ ahc_echo (void *cls,
87 const char *version, 87 const char *version,
88 const char *upload_data, 88 const char *upload_data,
89 size_t *upload_data_size, 89 size_t *upload_data_size,
90 void **unused) 90 void **req_cls)
91{ 91{
92 struct MHD_Response *response; 92 struct MHD_Response *response;
93 char *username; 93 char *username;
@@ -97,7 +97,7 @@ ahc_echo (void *cls,
97 int ret_i; 97 int ret_i;
98 (void) cls; (void) url; /* Unused. Silent compiler warning. */ 98 (void) cls; (void) url; /* Unused. Silent compiler warning. */
99 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */ 99 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
100 (void) upload_data_size; (void) unused; /* Unused. Silent compiler warning. */ 100 (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */
101 101
102 username = MHD_digest_auth_get_username (connection); 102 username = MHD_digest_auth_get_username (connection);
103 if ( (username == NULL) || 103 if ( (username == NULL) ||
diff --git a/src/testcurl/test_digestauth_with_arguments.c b/src/testcurl/test_digestauth_with_arguments.c
index 523c9552..ce4b8970 100644
--- a/src/testcurl/test_digestauth_with_arguments.c
+++ b/src/testcurl/test_digestauth_with_arguments.c
@@ -80,7 +80,7 @@ ahc_echo (void *cls,
80 const char *method, 80 const char *method,
81 const char *version, 81 const char *version,
82 const char *upload_data, size_t *upload_data_size, 82 const char *upload_data, size_t *upload_data_size,
83 void **unused) 83 void **req_cls)
84{ 84{
85 struct MHD_Response *response; 85 struct MHD_Response *response;
86 char *username; 86 char *username;
@@ -90,7 +90,7 @@ ahc_echo (void *cls,
90 int ret_i; 90 int ret_i;
91 (void) cls; (void) url; /* Unused. Silent compiler warning. */ 91 (void) cls; (void) url; /* Unused. Silent compiler warning. */
92 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */ 92 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
93 (void) upload_data_size; (void) unused; /* Unused. Silent compiler warning. */ 93 (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */
94 94
95 username = MHD_digest_auth_get_username (connection); 95 username = MHD_digest_auth_get_username (connection);
96 if ( (username == NULL) || 96 if ( (username == NULL) ||
diff --git a/src/testcurl/test_get.c b/src/testcurl/test_get.c
index 58febf7a..a60c0797 100644
--- a/src/testcurl/test_get.c
+++ b/src/testcurl/test_get.c
@@ -107,7 +107,7 @@ ahc_echo (void *cls,
107 const char *method, 107 const char *method,
108 const char *version, 108 const char *version,
109 const char *upload_data, size_t *upload_data_size, 109 const char *upload_data, size_t *upload_data_size,
110 void **unused) 110 void **req_cls)
111{ 111{
112 static int ptr; 112 static int ptr;
113 const char *me = cls; 113 const char *me = cls;
@@ -120,12 +120,12 @@ ahc_echo (void *cls,
120 120
121 if (0 != strcmp (me, method)) 121 if (0 != strcmp (me, method))
122 return MHD_NO; /* unexpected method */ 122 return MHD_NO; /* unexpected method */
123 if (&ptr != *unused) 123 if (&ptr != *req_cls)
124 { 124 {
125 *unused = &ptr; 125 *req_cls = &ptr;
126 return MHD_YES; 126 return MHD_YES;
127 } 127 }
128 *unused = NULL; 128 *req_cls = NULL;
129 v = MHD_lookup_connection_value (connection, 129 v = MHD_lookup_connection_value (connection,
130 MHD_GET_ARGUMENT_KIND, 130 MHD_GET_ARGUMENT_KIND,
131 "a"); 131 "a");
@@ -745,7 +745,7 @@ ahc_empty (void *cls,
745 const char *version, 745 const char *version,
746 const char *upload_data, 746 const char *upload_data,
747 size_t *upload_data_size, 747 size_t *upload_data_size,
748 void **unused) 748 void **req_cls)
749{ 749{
750 static int ptr; 750 static int ptr;
751 struct MHD_Response *response; 751 struct MHD_Response *response;
@@ -759,12 +759,12 @@ ahc_empty (void *cls,
759 759
760 if (0 != strcmp ("GET", method)) 760 if (0 != strcmp ("GET", method))
761 return MHD_NO; /* unexpected method */ 761 return MHD_NO; /* unexpected method */
762 if (&ptr != *unused) 762 if (&ptr != *req_cls)
763 { 763 {
764 *unused = &ptr; 764 *req_cls = &ptr;
765 return MHD_YES; 765 return MHD_YES;
766 } 766 }
767 *unused = NULL; 767 *req_cls = NULL;
768 response = MHD_create_response_from_buffer (0, 768 response = MHD_create_response_from_buffer (0,
769 NULL, 769 NULL,
770 MHD_RESPMEM_PERSISTENT); 770 MHD_RESPMEM_PERSISTENT);
diff --git a/src/testcurl/test_get_chunked.c b/src/testcurl/test_get_chunked.c
index 5a19a24e..876016cc 100644
--- a/src/testcurl/test_get_chunked.c
+++ b/src/testcurl/test_get_chunked.c
@@ -180,7 +180,7 @@ ahc_echo (void *cls,
180 const char *url, 180 const char *url,
181 const char *method, 181 const char *method,
182 const char *version, 182 const char *version,
183 const char *upload_data, size_t *upload_data_size, void **ptr) 183 const char *upload_data, size_t *upload_data_size, void **req_cls)
184{ 184{
185 static int aptr; 185 static int aptr;
186 const char *me = cls; 186 const char *me = cls;
@@ -194,10 +194,10 @@ ahc_echo (void *cls,
194 194
195 if (0 != strcmp (me, method)) 195 if (0 != strcmp (me, method))
196 return MHD_NO; /* unexpected method */ 196 return MHD_NO; /* unexpected method */
197 if (&aptr != *ptr) 197 if (&aptr != *req_cls)
198 { 198 {
199 /* do never respond on first call */ 199 /* do never respond on first call */
200 *ptr = &aptr; 200 *req_cls = &aptr;
201 return MHD_YES; 201 return MHD_YES;
202 } 202 }
203 if (! resp_string) 203 if (! resp_string)
diff --git a/src/testcurl/test_get_close_keep_alive.c b/src/testcurl/test_get_close_keep_alive.c
index 2fca0ce3..1cb46e68 100644
--- a/src/testcurl/test_get_close_keep_alive.c
+++ b/src/testcurl/test_get_close_keep_alive.c
@@ -312,7 +312,7 @@ ahc_echo (void *cls,
312 const char *method, 312 const char *method,
313 const char *version, 313 const char *version,
314 const char *upload_data, size_t *upload_data_size, 314 const char *upload_data, size_t *upload_data_size,
315 void **unused) 315 void **req_cls)
316{ 316{
317 static int ptr; 317 static int ptr;
318 const char *me = cls; 318 const char *me = cls;
@@ -324,12 +324,12 @@ ahc_echo (void *cls,
324 324
325 if (0 != strcmp (me, method)) 325 if (0 != strcmp (me, method))
326 return MHD_NO; /* unexpected method */ 326 return MHD_NO; /* unexpected method */
327 if (&ptr != *unused) 327 if (&ptr != *req_cls)
328 { 328 {
329 *unused = &ptr; 329 *req_cls = &ptr;
330 return MHD_YES; 330 return MHD_YES;
331 } 331 }
332 *unused = NULL; 332 *req_cls = NULL;
333 if (slow_reply) 333 if (slow_reply)
334 usleep (200000); 334 usleep (200000);
335 335
diff --git a/src/testcurl/test_get_empty.c b/src/testcurl/test_get_empty.c
index 5ed71ab9..fdbb2d42 100644
--- a/src/testcurl/test_get_empty.c
+++ b/src/testcurl/test_get_empty.c
@@ -107,7 +107,7 @@ ahc_echo (void *cls,
107 const char *method, 107 const char *method,
108 const char *version, 108 const char *version,
109 const char *upload_data, size_t *upload_data_size, 109 const char *upload_data, size_t *upload_data_size,
110 void **unused) 110 void **req_cls)
111{ 111{
112 static int ptr; 112 static int ptr;
113 const char *me = cls; 113 const char *me = cls;
@@ -119,12 +119,12 @@ ahc_echo (void *cls,
119 119
120 if (0 != strcmp (me, method)) 120 if (0 != strcmp (me, method))
121 return MHD_NO; /* unexpected method */ 121 return MHD_NO; /* unexpected method */
122 if (&ptr != *unused) 122 if (&ptr != *req_cls)
123 { 123 {
124 *unused = &ptr; 124 *req_cls = &ptr;
125 return MHD_YES; 125 return MHD_YES;
126 } 126 }
127 *unused = NULL; 127 *req_cls = NULL;
128 response = MHD_create_response_from_buffer (0, 128 response = MHD_create_response_from_buffer (0,
129 NULL, 129 NULL,
130 MHD_RESPMEM_PERSISTENT); 130 MHD_RESPMEM_PERSISTENT);
@@ -703,7 +703,7 @@ ahc_empty (void *cls,
703 const char *method, 703 const char *method,
704 const char *version, 704 const char *version,
705 const char *upload_data, size_t *upload_data_size, 705 const char *upload_data, size_t *upload_data_size,
706 void **unused) 706 void **req_cls)
707{ 707{
708 static int ptr; 708 static int ptr;
709 struct MHD_Response *response; 709 struct MHD_Response *response;
@@ -717,12 +717,12 @@ ahc_empty (void *cls,
717 717
718 if (0 != strcmp ("GET", method)) 718 if (0 != strcmp ("GET", method))
719 return MHD_NO; /* unexpected method */ 719 return MHD_NO; /* unexpected method */
720 if (&ptr != *unused) 720 if (&ptr != *req_cls)
721 { 721 {
722 *unused = &ptr; 722 *req_cls = &ptr;
723 return MHD_YES; 723 return MHD_YES;
724 } 724 }
725 *unused = NULL; 725 *req_cls = NULL;
726 response = MHD_create_response_from_buffer (0, 726 response = MHD_create_response_from_buffer (0,
727 NULL, 727 NULL,
728 MHD_RESPMEM_PERSISTENT); 728 MHD_RESPMEM_PERSISTENT);
diff --git a/src/testcurl/test_get_iovec.c b/src/testcurl/test_get_iovec.c
index ae30f6d6..bcb610dc 100644
--- a/src/testcurl/test_get_iovec.c
+++ b/src/testcurl/test_get_iovec.c
@@ -132,7 +132,7 @@ ahc_echo (void *cls,
132 const char *method, 132 const char *method,
133 const char *version, 133 const char *version,
134 const char *upload_data, size_t *upload_data_size, 134 const char *upload_data, size_t *upload_data_size,
135 void **unused) 135 void **req_cls)
136{ 136{
137 static int ptr; 137 static int ptr;
138 const char *me = cls; 138 const char *me = cls;
@@ -146,12 +146,12 @@ ahc_echo (void *cls,
146 146
147 if (0 != strcmp (me, method)) 147 if (0 != strcmp (me, method))
148 return MHD_NO; /* unexpected method */ 148 return MHD_NO; /* unexpected method */
149 if (&ptr != *unused) 149 if (&ptr != *req_cls)
150 { 150 {
151 *unused = &ptr; 151 *req_cls = &ptr;
152 return MHD_YES; 152 return MHD_YES;
153 } 153 }
154 *unused = NULL; 154 *req_cls = NULL;
155 155
156 /* Create some test data. */ 156 /* Create some test data. */
157 if (NULL == (data = malloc (TESTSTR_SIZE))) 157 if (NULL == (data = malloc (TESTSTR_SIZE)))
@@ -188,7 +188,7 @@ ncont_echo (void *cls,
188 const char *method, 188 const char *method,
189 const char *version, 189 const char *version,
190 const char *upload_data, size_t *upload_data_size, 190 const char *upload_data, size_t *upload_data_size,
191 void **unused) 191 void **req_cls)
192{ 192{
193 static int ptr; 193 static int ptr;
194 const char *me = cls; 194 const char *me = cls;
@@ -202,12 +202,12 @@ ncont_echo (void *cls,
202 202
203 if (0 != strcmp (me, method)) 203 if (0 != strcmp (me, method))
204 return MHD_NO; /* unexpected method */ 204 return MHD_NO; /* unexpected method */
205 if (&ptr != *unused) 205 if (&ptr != *req_cls)
206 { 206 {
207 *unused = &ptr; 207 *req_cls = &ptr;
208 return MHD_YES; 208 return MHD_YES;
209 } 209 }
210 *unused = NULL; 210 *req_cls = NULL;
211 211
212 if (NULL == (iov = malloc (sizeof(struct MHD_IoVec) * TESTSTR_IOVCNT))) 212 if (NULL == (iov = malloc (sizeof(struct MHD_IoVec) * TESTSTR_IOVCNT)))
213 return MHD_NO; 213 return MHD_NO;
diff --git a/src/testcurl/test_get_response_cleanup.c b/src/testcurl/test_get_response_cleanup.c
index efec5144..ededc88b 100644
--- a/src/testcurl/test_get_response_cleanup.c
+++ b/src/testcurl/test_get_response_cleanup.c
@@ -122,7 +122,7 @@ ahc_echo (void *cls,
122 const char *method, 122 const char *method,
123 const char *version, 123 const char *version,
124 const char *upload_data, size_t *upload_data_size, 124 const char *upload_data, size_t *upload_data_size,
125 void **unused) 125 void **req_cls)
126{ 126{
127 static int ptr; 127 static int ptr;
128 const char *me = cls; 128 const char *me = cls;
@@ -134,12 +134,12 @@ ahc_echo (void *cls,
134 // fprintf (stderr, "In CB: %s!\n", method); 134 // fprintf (stderr, "In CB: %s!\n", method);
135 if (0 != strcmp (me, method)) 135 if (0 != strcmp (me, method))
136 return MHD_NO; /* unexpected method */ 136 return MHD_NO; /* unexpected method */
137 if (&ptr != *unused) 137 if (&ptr != *req_cls)
138 { 138 {
139 *unused = &ptr; 139 *req_cls = &ptr;
140 return MHD_YES; 140 return MHD_YES;
141 } 141 }
142 *unused = NULL; 142 *req_cls = NULL;
143 response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, 143 response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN,
144 32 * 1024, 144 32 * 1024,
145 &push_callback, 145 &push_callback,
diff --git a/src/testcurl/test_get_sendfile.c b/src/testcurl/test_get_sendfile.c
index 84929d81..4ca57e23 100644
--- a/src/testcurl/test_get_sendfile.c
+++ b/src/testcurl/test_get_sendfile.c
@@ -84,7 +84,7 @@ ahc_echo (void *cls,
84 const char *method, 84 const char *method,
85 const char *version, 85 const char *version,
86 const char *upload_data, size_t *upload_data_size, 86 const char *upload_data, size_t *upload_data_size,
87 void **unused) 87 void **req_cls)
88{ 88{
89 static int ptr; 89 static int ptr;
90 const char *me = cls; 90 const char *me = cls;
@@ -96,12 +96,12 @@ ahc_echo (void *cls,
96 96
97 if (0 != strcmp (me, method)) 97 if (0 != strcmp (me, method))
98 return MHD_NO; /* unexpected method */ 98 return MHD_NO; /* unexpected method */
99 if (&ptr != *unused) 99 if (&ptr != *req_cls)
100 { 100 {
101 *unused = &ptr; 101 *req_cls = &ptr;
102 return MHD_YES; 102 return MHD_YES;
103 } 103 }
104 *unused = NULL; 104 *req_cls = NULL;
105 fd = open (sourcefile, O_RDONLY); 105 fd = open (sourcefile, O_RDONLY);
106 if (fd == -1) 106 if (fd == -1)
107 { 107 {
diff --git a/src/testcurl/test_get_wait.c b/src/testcurl/test_get_wait.c
index 40fcaf6d..708c82bd 100644
--- a/src/testcurl/test_get_wait.c
+++ b/src/testcurl/test_get_wait.c
@@ -86,7 +86,7 @@ ahc_echo (void *cls,
86 const char *method, 86 const char *method,
87 const char *version, 87 const char *version,
88 const char *upload_data, size_t *upload_data_size, 88 const char *upload_data, size_t *upload_data_size,
89 void **unused) 89 void **req_cls)
90{ 90{
91 static int ptr; 91 static int ptr;
92 const char *me = cls; 92 const char *me = cls;
@@ -96,12 +96,12 @@ ahc_echo (void *cls,
96 96
97 if (0 != strcmp (me, method)) 97 if (0 != strcmp (me, method))
98 return MHD_NO; /* unexpected method */ 98 return MHD_NO; /* unexpected method */
99 if (&ptr != *unused) 99 if (&ptr != *req_cls)
100 { 100 {
101 *unused = &ptr; 101 *req_cls = &ptr;
102 return MHD_YES; 102 return MHD_YES;
103 } 103 }
104 *unused = NULL; 104 *req_cls = NULL;
105 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 105 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
106 if (ret == MHD_NO) 106 if (ret == MHD_NO)
107 abort (); 107 abort ();
diff --git a/src/testcurl/test_iplimit.c b/src/testcurl/test_iplimit.c
index 09fe7773..509e3955 100644
--- a/src/testcurl/test_iplimit.c
+++ b/src/testcurl/test_iplimit.c
@@ -82,7 +82,7 @@ ahc_echo (void *cls,
82 const char *method, 82 const char *method,
83 const char *version, 83 const char *version,
84 const char *upload_data, size_t *upload_data_size, 84 const char *upload_data, size_t *upload_data_size,
85 void **unused) 85 void **req_cls)
86{ 86{
87 static int ptr; 87 static int ptr;
88 const char *me = cls; 88 const char *me = cls;
@@ -92,12 +92,12 @@ ahc_echo (void *cls,
92 92
93 if (0 != strcmp (me, method)) 93 if (0 != strcmp (me, method))
94 return MHD_NO; /* unexpected method */ 94 return MHD_NO; /* unexpected method */
95 if (&ptr != *unused) 95 if (&ptr != *req_cls)
96 { 96 {
97 *unused = &ptr; 97 *req_cls = &ptr;
98 return MHD_YES; 98 return MHD_YES;
99 } 99 }
100 *unused = NULL; 100 *req_cls = NULL;
101 response = MHD_create_response_from_buffer (strlen (url), 101 response = MHD_create_response_from_buffer (strlen (url),
102 (void *) url, 102 (void *) url,
103 MHD_RESPMEM_MUST_COPY); 103 MHD_RESPMEM_MUST_COPY);
diff --git a/src/testcurl/test_large_put.c b/src/testcurl/test_large_put.c
index b00d0e1a..161e0f0b 100644
--- a/src/testcurl/test_large_put.c
+++ b/src/testcurl/test_large_put.c
@@ -233,7 +233,7 @@ ahc_echo (void *cls,
233 const char *method, 233 const char *method,
234 const char *version, 234 const char *version,
235 const char *upload_data, size_t *upload_data_size, 235 const char *upload_data, size_t *upload_data_size,
236 void **pparam) 236 void **req_cls)
237{ 237{
238 int *done = cls; 238 int *done = cls;
239 struct MHD_Response *response; 239 struct MHD_Response *response;
@@ -259,13 +259,13 @@ ahc_echo (void *cls,
259 if ((*done) == 0) 259 if ((*done) == 0)
260 { 260 {
261 size_t *pproc; 261 size_t *pproc;
262 if (NULL == *pparam) 262 if (NULL == *req_cls)
263 { 263 {
264 processed = 0; 264 processed = 0;
265 /* Safe as long as only one parallel request served. */ 265 /* Safe as long as only one parallel request served. */
266 *pparam = &processed; 266 *req_cls = &processed;
267 } 267 }
268 pproc = (size_t *) *pparam; 268 pproc = (size_t *) *req_cls;
269 269
270 if (0 == *upload_data_size) 270 if (0 == *upload_data_size)
271 return MHD_YES; /* No data to process. */ 271 return MHD_YES; /* No data to process. */
diff --git a/src/testcurl/test_long_header.c b/src/testcurl/test_long_header.c
index b76ea90d..329c3955 100644
--- a/src/testcurl/test_long_header.c
+++ b/src/testcurl/test_long_header.c
@@ -78,13 +78,13 @@ ahc_echo (void *cls,
78 const char *method, 78 const char *method,
79 const char *version, 79 const char *version,
80 const char *upload_data, size_t *upload_data_size, 80 const char *upload_data, size_t *upload_data_size,
81 void **unused) 81 void **req_cls)
82{ 82{
83 const char *me = cls; 83 const char *me = cls;
84 struct MHD_Response *response; 84 struct MHD_Response *response;
85 enum MHD_Result ret; 85 enum MHD_Result ret;
86 (void) version; (void) upload_data; /* Unused. Silent compiler warning. */ 86 (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
87 (void) upload_data_size; (void) unused; /* Unused. Silent compiler warning. */ 87 (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */
88 88
89 if (0 != strcmp (me, method)) 89 if (0 != strcmp (me, method))
90 return MHD_NO; /* unexpected method */ 90 return MHD_NO; /* unexpected method */
diff --git a/src/testcurl/test_parse_cookies.c b/src/testcurl/test_parse_cookies.c
index 07c67567..0fc5ffc1 100644
--- a/src/testcurl/test_parse_cookies.c
+++ b/src/testcurl/test_parse_cookies.c
@@ -68,7 +68,7 @@ ahc_echo (void *cls,
68 const char *method, 68 const char *method,
69 const char *version, 69 const char *version,
70 const char *upload_data, size_t *upload_data_size, 70 const char *upload_data, size_t *upload_data_size,
71 void **unused) 71 void **req_cls)
72{ 72{
73 static int ptr; 73 static int ptr;
74 const char *me = cls; 74 const char *me = cls;
@@ -79,12 +79,12 @@ ahc_echo (void *cls,
79 79
80 if (0 != strcmp (me, method)) 80 if (0 != strcmp (me, method))
81 return MHD_NO; /* unexpected method */ 81 return MHD_NO; /* unexpected method */
82 if (&ptr != *unused) 82 if (&ptr != *req_cls)
83 { 83 {
84 *unused = &ptr; 84 *req_cls = &ptr;
85 return MHD_YES; 85 return MHD_YES;
86 } 86 }
87 *unused = NULL; 87 *req_cls = NULL;
88 88
89 hdr = MHD_lookup_connection_value (connection, MHD_COOKIE_KIND, "name1"); 89 hdr = MHD_lookup_connection_value (connection, MHD_COOKIE_KIND, "name1");
90 if ((hdr == NULL) || (0 != strcmp (hdr, "var1"))) 90 if ((hdr == NULL) || (0 != strcmp (hdr, "var1")))
diff --git a/src/testcurl/test_patch.c b/src/testcurl/test_patch.c
index f443ad08..100242a5 100644
--- a/src/testcurl/test_patch.c
+++ b/src/testcurl/test_patch.c
@@ -90,12 +90,12 @@ ahc_echo (void *cls,
90 const char *method, 90 const char *method,
91 const char *version, 91 const char *version,
92 const char *upload_data, size_t *upload_data_size, 92 const char *upload_data, size_t *upload_data_size,
93 void **unused) 93 void **req_cls)
94{ 94{
95 int *done = cls; 95 int *done = cls;
96 struct MHD_Response *response; 96 struct MHD_Response *response;
97 enum MHD_Result ret; 97 enum MHD_Result ret;
98 (void) version; (void) unused; /* Unused. Silent compiler warning. */ 98 (void) version; (void) req_cls; /* Unused. Silent compiler warning. */
99 99
100 if (0 != strcmp ("PATCH", method)) 100 if (0 != strcmp ("PATCH", method))
101 return MHD_NO; /* unexpected method */ 101 return MHD_NO; /* unexpected method */
diff --git a/src/testcurl/test_post.c b/src/testcurl/test_post.c
index 1bf9be70..90b8f48a 100644
--- a/src/testcurl/test_post.c
+++ b/src/testcurl/test_post.c
@@ -69,15 +69,15 @@ struct CBC
69static void 69static void
70completed_cb (void *cls, 70completed_cb (void *cls,
71 struct MHD_Connection *connection, 71 struct MHD_Connection *connection,
72 void **con_cls, 72 void **req_cls,
73 enum MHD_RequestTerminationCode toe) 73 enum MHD_RequestTerminationCode toe)
74{ 74{
75 struct MHD_PostProcessor *pp = *con_cls; 75 struct MHD_PostProcessor *pp = *req_cls;
76 (void) cls; (void) connection; (void) toe; /* Unused. Silent compiler warning. */ 76 (void) cls; (void) connection; (void) toe; /* Unused. Silent compiler warning. */
77 77
78 if (NULL != pp) 78 if (NULL != pp)
79 MHD_destroy_post_processor (pp); 79 MHD_destroy_post_processor (pp);
80 *con_cls = NULL; 80 *req_cls = NULL;
81} 81}
82 82
83 83
@@ -129,7 +129,7 @@ ahc_echo (void *cls,
129 const char *method, 129 const char *method,
130 const char *version, 130 const char *version,
131 const char *upload_data, size_t *upload_data_size, 131 const char *upload_data, size_t *upload_data_size,
132 void **unused) 132 void **req_cls)
133{ 133{
134 static int eok; 134 static int eok;
135 struct MHD_Response *response; 135 struct MHD_Response *response;
@@ -142,12 +142,12 @@ ahc_echo (void *cls,
142 printf ("METHOD: %s\n", method); 142 printf ("METHOD: %s\n", method);
143 return MHD_NO; /* unexpected method */ 143 return MHD_NO; /* unexpected method */
144 } 144 }
145 pp = *unused; 145 pp = *req_cls;
146 if (pp == NULL) 146 if (pp == NULL)
147 { 147 {
148 eok = 0; 148 eok = 0;
149 pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok); 149 pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok);
150 *unused = pp; 150 *req_cls = pp;
151 } 151 }
152 MHD_post_process (pp, upload_data, *upload_data_size); 152 MHD_post_process (pp, upload_data, *upload_data_size);
153 if ((eok == 3) && (0 == *upload_data_size)) 153 if ((eok == 3) && (0 == *upload_data_size))
@@ -158,7 +158,7 @@ ahc_echo (void *cls,
158 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 158 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
159 MHD_destroy_response (response); 159 MHD_destroy_response (response);
160 MHD_destroy_post_processor (pp); 160 MHD_destroy_post_processor (pp);
161 *unused = NULL; 161 *req_cls = NULL;
162 return ret; 162 return ret;
163 } 163 }
164 *upload_data_size = 0; 164 *upload_data_size = 0;
@@ -592,7 +592,7 @@ ahc_cancel (void *cls,
592 const char *method, 592 const char *method,
593 const char *version, 593 const char *version,
594 const char *upload_data, size_t *upload_data_size, 594 const char *upload_data, size_t *upload_data_size,
595 void **unused) 595 void **req_cls)
596{ 596{
597 struct MHD_Response *response; 597 struct MHD_Response *response;
598 enum MHD_Result ret; 598 enum MHD_Result ret;
@@ -606,9 +606,9 @@ ahc_cancel (void *cls,
606 return MHD_NO; 606 return MHD_NO;
607 } 607 }
608 608
609 if (*unused == NULL) 609 if (*req_cls == NULL)
610 { 610 {
611 *unused = "wibble"; 611 *req_cls = "wibble";
612 /* We don't want the body. Send a 500. */ 612 /* We don't want the body. Send a 500. */
613 response = MHD_create_response_from_buffer (0, NULL, 613 response = MHD_create_response_from_buffer (0, NULL,
614 MHD_RESPMEM_PERSISTENT); 614 MHD_RESPMEM_PERSISTENT);
diff --git a/src/testcurl/test_post_loop.c b/src/testcurl/test_post_loop.c
index ec929904..c36fba7f 100644
--- a/src/testcurl/test_post_loop.c
+++ b/src/testcurl/test_post_loop.c
@@ -86,7 +86,7 @@ ahc_echo (void *cls,
86 const char *method, 86 const char *method,
87 const char *version, 87 const char *version,
88 const char *upload_data, size_t *upload_data_size, 88 const char *upload_data, size_t *upload_data_size,
89 void **mptr) 89 void **req_cls)
90{ 90{
91 static int marker; 91 static int marker;
92 struct MHD_Response *response; 92 struct MHD_Response *response;
@@ -99,21 +99,21 @@ ahc_echo (void *cls,
99 printf ("METHOD: %s\n", method); 99 printf ("METHOD: %s\n", method);
100 return MHD_NO; /* unexpected method */ 100 return MHD_NO; /* unexpected method */
101 } 101 }
102 if ((*mptr != NULL) && (0 == *upload_data_size)) 102 if ((*req_cls != NULL) && (0 == *upload_data_size))
103 { 103 {
104 if (*mptr != &marker) 104 if (*req_cls != &marker)
105 abort (); 105 abort ();
106 response = MHD_create_response_from_buffer (2, "OK", 106 response = MHD_create_response_from_buffer (2, "OK",
107 MHD_RESPMEM_PERSISTENT); 107 MHD_RESPMEM_PERSISTENT);
108 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 108 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
109 MHD_destroy_response (response); 109 MHD_destroy_response (response);
110 *mptr = NULL; 110 *req_cls = NULL;
111 return ret; 111 return ret;
112 } 112 }
113 if (strlen (POST_DATA) != *upload_data_size) 113 if (strlen (POST_DATA) != *upload_data_size)
114 return MHD_YES; 114 return MHD_YES;
115 *upload_data_size = 0; 115 *upload_data_size = 0;
116 *mptr = &marker; 116 *req_cls = &marker;
117 return MHD_YES; 117 return MHD_YES;
118} 118}
119 119
diff --git a/src/testcurl/test_postform.c b/src/testcurl/test_postform.c
index 1f60fb06..87febcbc 100644
--- a/src/testcurl/test_postform.c
+++ b/src/testcurl/test_postform.c
@@ -65,15 +65,15 @@ struct CBC
65static void 65static void
66completed_cb (void *cls, 66completed_cb (void *cls,
67 struct MHD_Connection *connection, 67 struct MHD_Connection *connection,
68 void **con_cls, 68 void **req_cls,
69 enum MHD_RequestTerminationCode toe) 69 enum MHD_RequestTerminationCode toe)
70{ 70{
71 struct MHD_PostProcessor *pp = *con_cls; 71 struct MHD_PostProcessor *pp = *req_cls;
72 (void) cls; (void) connection; (void) toe; /* Unused. Silent compiler warning. */ 72 (void) cls; (void) connection; (void) toe; /* Unused. Silent compiler warning. */
73 73
74 if (NULL != pp) 74 if (NULL != pp)
75 MHD_destroy_post_processor (pp); 75 MHD_destroy_post_processor (pp);
76 *con_cls = NULL; 76 *req_cls = NULL;
77} 77}
78 78
79 79
@@ -128,7 +128,7 @@ ahc_echo (void *cls,
128 const char *method, 128 const char *method,
129 const char *version, 129 const char *version,
130 const char *upload_data, size_t *upload_data_size, 130 const char *upload_data, size_t *upload_data_size,
131 void **unused) 131 void **req_cls)
132{ 132{
133 static int eok; 133 static int eok;
134 struct MHD_Response *response; 134 struct MHD_Response *response;
@@ -141,14 +141,14 @@ ahc_echo (void *cls,
141 printf ("METHOD: %s\n", method); 141 printf ("METHOD: %s\n", method);
142 return MHD_NO; /* unexpected method */ 142 return MHD_NO; /* unexpected method */
143 } 143 }
144 pp = *unused; 144 pp = *req_cls;
145 if (pp == NULL) 145 if (pp == NULL)
146 { 146 {
147 eok = 0; 147 eok = 0;
148 pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok); 148 pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok);
149 if (pp == NULL) 149 if (pp == NULL)
150 abort (); 150 abort ();
151 *unused = pp; 151 *req_cls = pp;
152 } 152 }
153 MHD_post_process (pp, upload_data, *upload_data_size); 153 MHD_post_process (pp, upload_data, *upload_data_size);
154 if ((eok == 3) && (0 == *upload_data_size)) 154 if ((eok == 3) && (0 == *upload_data_size))
@@ -159,7 +159,7 @@ ahc_echo (void *cls,
159 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 159 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
160 MHD_destroy_response (response); 160 MHD_destroy_response (response);
161 MHD_destroy_post_processor (pp); 161 MHD_destroy_post_processor (pp);
162 *unused = NULL; 162 *req_cls = NULL;
163 return ret; 163 return ret;
164 } 164 }
165 *upload_data_size = 0; 165 *upload_data_size = 0;
diff --git a/src/testcurl/test_process_arguments.c b/src/testcurl/test_process_arguments.c
index aaf9681e..24d5e72f 100644
--- a/src/testcurl/test_process_arguments.c
+++ b/src/testcurl/test_process_arguments.c
@@ -69,7 +69,7 @@ ahc_echo (void *cls,
69 const char *method, 69 const char *method,
70 const char *version, 70 const char *version,
71 const char *upload_data, size_t *upload_data_size, 71 const char *upload_data, size_t *upload_data_size,
72 void **unused) 72 void **req_cls)
73{ 73{
74 static int ptr; 74 static int ptr;
75 const char *me = cls; 75 const char *me = cls;
@@ -80,12 +80,12 @@ ahc_echo (void *cls,
80 80
81 if (0 != strcmp (me, method)) 81 if (0 != strcmp (me, method))
82 return MHD_NO; /* unexpected method */ 82 return MHD_NO; /* unexpected method */
83 if (&ptr != *unused) 83 if (&ptr != *req_cls)
84 { 84 {
85 *unused = &ptr; 85 *req_cls = &ptr;
86 return MHD_YES; 86 return MHD_YES;
87 } 87 }
88 *unused = NULL; 88 *req_cls = NULL;
89 hdr = MHD_lookup_connection_value (connection, MHD_GET_ARGUMENT_KIND, "k"); 89 hdr = MHD_lookup_connection_value (connection, MHD_GET_ARGUMENT_KIND, "k");
90 if ((hdr == NULL) || (0 != strcmp (hdr, "v x"))) 90 if ((hdr == NULL) || (0 != strcmp (hdr, "v x")))
91 abort (); 91 abort ();
diff --git a/src/testcurl/test_process_headers.c b/src/testcurl/test_process_headers.c
index 9a84b3ef..98b08fbc 100644
--- a/src/testcurl/test_process_headers.c
+++ b/src/testcurl/test_process_headers.c
@@ -89,7 +89,7 @@ ahc_echo (void *cls,
89 const char *method, 89 const char *method,
90 const char *version, 90 const char *version,
91 const char *upload_data, size_t *upload_data_size, 91 const char *upload_data, size_t *upload_data_size,
92 void **unused) 92 void **req_cls)
93{ 93{
94 static int ptr; 94 static int ptr;
95 const char *me = cls; 95 const char *me = cls;
@@ -100,12 +100,12 @@ ahc_echo (void *cls,
100 100
101 if (0 != strcmp (me, method)) 101 if (0 != strcmp (me, method))
102 return MHD_NO; /* unexpected method */ 102 return MHD_NO; /* unexpected method */
103 if (&ptr != *unused) 103 if (&ptr != *req_cls)
104 { 104 {
105 *unused = &ptr; 105 *req_cls = &ptr;
106 return MHD_YES; 106 return MHD_YES;
107 } 107 }
108 *unused = NULL; 108 *req_cls = NULL;
109 ret = 0; 109 ret = 0;
110 MHD_get_connection_values (connection, MHD_HEADER_KIND, &kv_cb, &ret); 110 MHD_get_connection_values (connection, MHD_HEADER_KIND, &kv_cb, &ret);
111 if (ret != 1) 111 if (ret != 1)
diff --git a/src/testcurl/test_put.c b/src/testcurl/test_put.c
index f572a9a8..761e1c5f 100644
--- a/src/testcurl/test_put.c
+++ b/src/testcurl/test_put.c
@@ -90,12 +90,12 @@ ahc_echo (void *cls,
90 const char *method, 90 const char *method,
91 const char *version, 91 const char *version,
92 const char *upload_data, size_t *upload_data_size, 92 const char *upload_data, size_t *upload_data_size,
93 void **unused) 93 void **req_cls)
94{ 94{
95 int *done = cls; 95 int *done = cls;
96 struct MHD_Response *response; 96 struct MHD_Response *response;
97 enum MHD_Result ret; 97 enum MHD_Result ret;
98 (void) version; (void) unused; /* Unused. Silent compiler warning. */ 98 (void) version; (void) req_cls; /* Unused. Silent compiler warning. */
99 99
100 if (0 != strcmp ("PUT", method)) 100 if (0 != strcmp ("PUT", method))
101 return MHD_NO; /* unexpected method */ 101 return MHD_NO; /* unexpected method */
diff --git a/src/testcurl/test_put_chunked.c b/src/testcurl/test_put_chunked.c
index 897f52b1..5820f2e0 100644
--- a/src/testcurl/test_put_chunked.c
+++ b/src/testcurl/test_put_chunked.c
@@ -90,13 +90,13 @@ ahc_echo (void *cls,
90 const char *method, 90 const char *method,
91 const char *version, 91 const char *version,
92 const char *upload_data, size_t *upload_data_size, 92 const char *upload_data, size_t *upload_data_size,
93 void **unused) 93 void **req_cls)
94{ 94{
95 int *done = cls; 95 int *done = cls;
96 struct MHD_Response *response; 96 struct MHD_Response *response;
97 enum MHD_Result ret; 97 enum MHD_Result ret;
98 int have; 98 int have;
99 (void) version; (void) unused; /* Unused. Silent compiler warning. */ 99 (void) version; (void) req_cls; /* Unused. Silent compiler warning. */
100 100
101 if (0 != strcmp ("PUT", method)) 101 if (0 != strcmp ("PUT", method))
102 return MHD_NO; /* unexpected method */ 102 return MHD_NO; /* unexpected method */
diff --git a/src/testcurl/test_quiesce.c b/src/testcurl/test_quiesce.c
index 8b350237..1e0eb0c4 100644
--- a/src/testcurl/test_quiesce.c
+++ b/src/testcurl/test_quiesce.c
@@ -193,7 +193,7 @@ ahc_echo (void *cls,
193 const char *method, 193 const char *method,
194 const char *version, 194 const char *version,
195 const char *upload_data, size_t *upload_data_size, 195 const char *upload_data, size_t *upload_data_size,
196 void **unused) 196 void **req_cls)
197{ 197{
198 static int ptr; 198 static int ptr;
199 const char *me = cls; 199 const char *me = cls;
@@ -205,12 +205,12 @@ ahc_echo (void *cls,
205 fprintf (stderr, "Unexpected HTTP method '%s'. ", method); 205 fprintf (stderr, "Unexpected HTTP method '%s'. ", method);
206 externalErrorExit (); 206 externalErrorExit ();
207 } 207 }
208 if (&ptr != *unused) 208 if (&ptr != *req_cls)
209 { 209 {
210 *unused = &ptr; 210 *req_cls = &ptr;
211 return MHD_YES; 211 return MHD_YES;
212 } 212 }
213 *unused = NULL; 213 *req_cls = NULL;
214 response = MHD_create_response_from_buffer (strlen (url), 214 response = MHD_create_response_from_buffer (strlen (url),
215 (void *) url, 215 (void *) url,
216 MHD_RESPMEM_MUST_COPY); 216 MHD_RESPMEM_MUST_COPY);
@@ -229,10 +229,10 @@ ahc_echo (void *cls,
229 229
230static void 230static void
231request_completed (void *cls, struct MHD_Connection *connection, 231request_completed (void *cls, struct MHD_Connection *connection,
232 void **con_cls, enum MHD_RequestTerminationCode code) 232 void **req_cls, enum MHD_RequestTerminationCode code)
233{ 233{
234 int *done = (int *) cls; 234 int *done = (int *) cls;
235 (void) connection; (void) con_cls; (void) code; /* Unused. Silent compiler warning. */ 235 (void) connection; (void) req_cls; (void) code; /* Unused. Silent compiler warning. */
236 if (MHD_REQUEST_TERMINATED_COMPLETED_OK != code) 236 if (MHD_REQUEST_TERMINATED_COMPLETED_OK != code)
237 { 237 {
238 fprintf (stderr, "Unexpected termination code: %d. ", (int) code); 238 fprintf (stderr, "Unexpected termination code: %d. ", (int) code);
diff --git a/src/testcurl/test_quiesce_stream.c b/src/testcurl/test_quiesce_stream.c
index 6d0ea599..dbfd982b 100644
--- a/src/testcurl/test_quiesce_stream.c
+++ b/src/testcurl/test_quiesce_stream.c
@@ -142,7 +142,7 @@ http_AccessHandlerCallback (void *cls,
142 const char *version, 142 const char *version,
143 const char *upload_data, 143 const char *upload_data,
144 size_t *upload_data_size, 144 size_t *upload_data_size,
145 void **con_cls) 145 void **req_cls)
146{ 146{
147 enum MHD_Result ret; 147 enum MHD_Result ret;
148 struct MHD_Response *response; 148 struct MHD_Response *response;
@@ -151,7 +151,7 @@ http_AccessHandlerCallback (void *cls,
151 (void) upload_data_size; /* Unused. Silent compiler warning. */ 151 (void) upload_data_size; /* Unused. Silent compiler warning. */
152 152
153 /* Never respond on first call */ 153 /* Never respond on first call */
154 if (NULL == *con_cls) 154 if (NULL == *req_cls)
155 { 155 {
156 struct ContentReaderUserdata *userdata; 156 struct ContentReaderUserdata *userdata;
157 fprintf (stderr, 157 fprintf (stderr,
@@ -164,7 +164,7 @@ http_AccessHandlerCallback (void *cls,
164 return MHD_NO; 164 return MHD_NO;
165 userdata->bytes_written = 0; 165 userdata->bytes_written = 0;
166 userdata->connection = connection; 166 userdata->connection = connection;
167 *con_cls = userdata; 167 *req_cls = userdata;
168 return MHD_YES; 168 return MHD_YES;
169 } 169 }
170 170
@@ -173,7 +173,7 @@ http_AccessHandlerCallback (void *cls,
173 = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, 173 = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN,
174 32 * 1024, 174 32 * 1024,
175 &http_ContentReaderCallback, 175 &http_ContentReaderCallback,
176 *con_cls, 176 *req_cls,
177 &free_crc_data); 177 &free_crc_data);
178 ret = MHD_queue_response (connection, 178 ret = MHD_queue_response (connection,
179 MHD_HTTP_OK, 179 MHD_HTTP_OK,
diff --git a/src/testcurl/test_termination.c b/src/testcurl/test_termination.c
index 3e1c1f91..72b77219 100644
--- a/src/testcurl/test_termination.c
+++ b/src/testcurl/test_termination.c
@@ -56,7 +56,7 @@ connection_handler (void *cls,
56 const char *method, 56 const char *method,
57 const char *version, 57 const char *version,
58 const char *upload_data, size_t *upload_data_size, 58 const char *upload_data, size_t *upload_data_size,
59 void **ptr) 59 void **req_cls)
60{ 60{
61 static int i; 61 static int i;
62 struct MHD_Response *response; 62 struct MHD_Response *response;
@@ -65,9 +65,9 @@ connection_handler (void *cls,
65 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */ 65 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
66 (void) upload_data_size; /* Unused. Silent compiler warning. */ 66 (void) upload_data_size; /* Unused. Silent compiler warning. */
67 67
68 if (*ptr == NULL) 68 if (*req_cls == NULL)
69 { 69 {
70 *ptr = &i; 70 *req_cls = &i;
71 return MHD_YES; 71 return MHD_YES;
72 } 72 }
73 73
diff --git a/src/testcurl/test_timeout.c b/src/testcurl/test_timeout.c
index 2a39fa13..5c184a20 100644
--- a/src/testcurl/test_timeout.c
+++ b/src/testcurl/test_timeout.c
@@ -96,11 +96,11 @@ struct CBC
96static void 96static void
97termination_cb (void *cls, 97termination_cb (void *cls,
98 struct MHD_Connection *connection, 98 struct MHD_Connection *connection,
99 void **con_cls, 99 void **req_cls,
100 enum MHD_RequestTerminationCode toe) 100 enum MHD_RequestTerminationCode toe)
101{ 101{
102 int *test = cls; 102 int *test = cls;
103 (void) connection; (void) con_cls; /* Unused. Silent compiler warning. */ 103 (void) connection; (void) req_cls; /* Unused. Silent compiler warning. */
104 104
105 switch (toe) 105 switch (toe)
106 { 106 {
@@ -190,12 +190,12 @@ ahc_echo (void *cls,
190 const char *method, 190 const char *method,
191 const char *version, 191 const char *version,
192 const char *upload_data, size_t *upload_data_size, 192 const char *upload_data, size_t *upload_data_size,
193 void **unused) 193 void **req_cls)
194{ 194{
195 int *done = cls; 195 int *done = cls;
196 struct MHD_Response *response; 196 struct MHD_Response *response;
197 enum MHD_Result ret; 197 enum MHD_Result ret;
198 (void) version; (void) unused; /* Unused. Silent compiler warning. */ 198 (void) version; (void) req_cls; /* Unused. Silent compiler warning. */
199 199
200 if (0 != strcmp ("PUT", method)) 200 if (0 != strcmp ("PUT", method))
201 return MHD_NO; /* unexpected method */ 201 return MHD_NO; /* unexpected method */
diff --git a/src/testcurl/test_toolarge.c b/src/testcurl/test_toolarge.c
index 6f78d7ba..134fd8af 100644
--- a/src/testcurl/test_toolarge.c
+++ b/src/testcurl/test_toolarge.c
@@ -448,7 +448,7 @@ ahcCheck (void *cls,
448 const char *method, 448 const char *method,
449 const char *version, 449 const char *version,
450 const char *upload_data, size_t *upload_data_size, 450 const char *upload_data, size_t *upload_data_size,
451 void **con_cls) 451 void **req_cls)
452{ 452{
453 static int ptr; 453 static int ptr;
454 struct MHD_Response *response; 454 struct MHD_Response *response;
@@ -477,12 +477,12 @@ ahcCheck (void *cls,
477 if (0 != strcmp (param->rq_method, method)) 477 if (0 != strcmp (param->rq_method, method))
478 mhdErrorExitDesc ("Unexpected request method"); 478 mhdErrorExitDesc ("Unexpected request method");
479 479
480 if (&ptr != *con_cls) 480 if (&ptr != *req_cls)
481 { 481 {
482 *con_cls = &ptr; 482 *req_cls = &ptr;
483 return MHD_YES; 483 return MHD_YES;
484 } 484 }
485 *con_cls = NULL; 485 *req_cls = NULL;
486 486
487 if (1 > MHD_get_connection_values_n (connection, MHD_HEADER_KIND, 487 if (1 > MHD_get_connection_values_n (connection, MHD_HEADER_KIND,
488 &headerCheckerInterator, 488 &headerCheckerInterator,
diff --git a/src/testcurl/test_tricky.c b/src/testcurl/test_tricky.c
index 50af68a1..afb29bbd 100644
--- a/src/testcurl/test_tricky.c
+++ b/src/testcurl/test_tricky.c
@@ -385,7 +385,7 @@ ahcCheck (void *cls,
385 const char *method, 385 const char *method,
386 const char *version, 386 const char *version,
387 const char *upload_data, size_t *upload_data_size, 387 const char *upload_data, size_t *upload_data_size,
388 void **con_cls) 388 void **req_cls)
389{ 389{
390 static int ptr; 390 static int ptr;
391 struct MHD_Response *response; 391 struct MHD_Response *response;
@@ -413,12 +413,12 @@ ahcCheck (void *cls,
413 if (0 != strcmp (param->rq_method, method)) 413 if (0 != strcmp (param->rq_method, method))
414 mhdErrorExitDesc ("Unexpected request method"); 414 mhdErrorExitDesc ("Unexpected request method");
415 415
416 if (&ptr != *con_cls) 416 if (&ptr != *req_cls)
417 { 417 {
418 *con_cls = &ptr; 418 *req_cls = &ptr;
419 return MHD_YES; 419 return MHD_YES;
420 } 420 }
421 *con_cls = NULL; 421 *req_cls = NULL;
422 422
423 if (1 > MHD_get_connection_values_n (connection, MHD_HEADER_KIND, 423 if (1 > MHD_get_connection_values_n (connection, MHD_HEADER_KIND,
424 &headerCheckerInterator, 424 &headerCheckerInterator,
diff --git a/src/testcurl/test_urlparse.c b/src/testcurl/test_urlparse.c
index bc0411a9..0145b5f1 100644
--- a/src/testcurl/test_urlparse.c
+++ b/src/testcurl/test_urlparse.c
@@ -98,7 +98,7 @@ ahc_echo (void *cls,
98 const char *method, 98 const char *method,
99 const char *version, 99 const char *version,
100 const char *upload_data, size_t *upload_data_size, 100 const char *upload_data, size_t *upload_data_size,
101 void **unused) 101 void **req_cls)
102{ 102{
103 static int ptr; 103 static int ptr;
104 const char *me = cls; 104 const char *me = cls;
@@ -108,16 +108,16 @@ ahc_echo (void *cls,
108 108
109 if (0 != strcmp (me, method)) 109 if (0 != strcmp (me, method))
110 return MHD_NO; /* unexpected method */ 110 return MHD_NO; /* unexpected method */
111 if (&ptr != *unused) 111 if (&ptr != *req_cls)
112 { 112 {
113 *unused = &ptr; 113 *req_cls = &ptr;
114 return MHD_YES; 114 return MHD_YES;
115 } 115 }
116 MHD_get_connection_values (connection, 116 MHD_get_connection_values (connection,
117 MHD_GET_ARGUMENT_KIND, 117 MHD_GET_ARGUMENT_KIND,
118 &test_values, 118 &test_values,
119 NULL); 119 NULL);
120 *unused = NULL; 120 *req_cls = NULL;
121 response = MHD_create_response_from_buffer (strlen (url), 121 response = MHD_create_response_from_buffer (strlen (url),
122 (void *) url, 122 (void *) url,
123 MHD_RESPMEM_MUST_COPY); 123 MHD_RESPMEM_MUST_COPY);
diff --git a/src/testzzuf/test_get.c b/src/testzzuf/test_get.c
index 7d3173e7..c3f4a0fb 100644
--- a/src/testzzuf/test_get.c
+++ b/src/testzzuf/test_get.c
@@ -67,7 +67,7 @@ ahc_echo (void *cls,
67 const char *method, 67 const char *method,
68 const char *version, 68 const char *version,
69 const char *upload_data, size_t *upload_data_size, 69 const char *upload_data, size_t *upload_data_size,
70 void **unused) 70 void **req_cls)
71{ 71{
72 static int ptr; 72 static int ptr;
73 const char *me = cls; 73 const char *me = cls;
@@ -87,12 +87,12 @@ ahc_echo (void *cls,
87 fprintf (stderr, "Upload data is NULL with non-zero size.\n"); 87 fprintf (stderr, "Upload data is NULL with non-zero size.\n");
88 if (0 != strcmp (me, method)) 88 if (0 != strcmp (me, method))
89 return MHD_NO; /* unexpected method */ 89 return MHD_NO; /* unexpected method */
90 if (&ptr != *unused) 90 if (&ptr != *req_cls)
91 { 91 {
92 *unused = &ptr; 92 *req_cls = &ptr;
93 return MHD_YES; 93 return MHD_YES;
94 } 94 }
95 *unused = NULL; 95 *req_cls = NULL;
96 response = MHD_create_response_from_buffer (strlen (url), 96 response = MHD_create_response_from_buffer (strlen (url),
97 (void *) url, 97 (void *) url,
98 MHD_RESPMEM_MUST_COPY); 98 MHD_RESPMEM_MUST_COPY);
diff --git a/src/testzzuf/test_get_chunked.c b/src/testzzuf/test_get_chunked.c
index cc01b09b..491dab61 100644
--- a/src/testzzuf/test_get_chunked.c
+++ b/src/testzzuf/test_get_chunked.c
@@ -95,7 +95,7 @@ ahc_echo (void *cls,
95 const char *url, 95 const char *url,
96 const char *method, 96 const char *method,
97 const char *version, 97 const char *version,
98 const char *upload_data, size_t *upload_data_size, void **ptr) 98 const char *upload_data, size_t *upload_data_size, void **req_cls)
99{ 99{
100 static int aptr; 100 static int aptr;
101 const char *me = cls; 101 const char *me = cls;
@@ -120,10 +120,10 @@ ahc_echo (void *cls,
120 fprintf (stderr, "Upload data is NULL with non-zero size.\n"); 120 fprintf (stderr, "Upload data is NULL with non-zero size.\n");
121 if (0 != strcmp (me, method)) 121 if (0 != strcmp (me, method))
122 return MHD_NO; /* unexpected method */ 122 return MHD_NO; /* unexpected method */
123 if (&aptr != *ptr) 123 if (&aptr != *req_cls)
124 { 124 {
125 /* do never respond on first call */ 125 /* do never respond on first call */
126 *ptr = &aptr; 126 *req_cls = &aptr;
127 return MHD_YES; 127 return MHD_YES;
128 } 128 }
129 responseptr = malloc (sizeof (struct MHD_Response *)); 129 responseptr = malloc (sizeof (struct MHD_Response *));
diff --git a/src/testzzuf/test_long_header.c b/src/testzzuf/test_long_header.c
index ab21453c..f6a2d4a2 100644
--- a/src/testzzuf/test_long_header.c
+++ b/src/testzzuf/test_long_header.c
@@ -77,13 +77,13 @@ ahc_echo (void *cls,
77 const char *method, 77 const char *method,
78 const char *version, 78 const char *version,
79 const char *upload_data, size_t *upload_data_size, 79 const char *upload_data, size_t *upload_data_size,
80 void **unused) 80 void **req_cls)
81{ 81{
82 const char *me = cls; 82 const char *me = cls;
83 struct MHD_Response *response; 83 struct MHD_Response *response;
84 enum MHD_Result ret; 84 enum MHD_Result ret;
85 (void) version; (void) upload_data; /* Unused. Silent compiler warning. */ 85 (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
86 (void) upload_data_size; (void) unused; /* Unused. Silent compiler warning. */ 86 (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */
87 87
88 if (NULL == url) 88 if (NULL == url)
89 fprintf (stderr, "The \"url\" parameter is NULL.\n"); 89 fprintf (stderr, "The \"url\" parameter is NULL.\n");
diff --git a/src/testzzuf/test_post.c b/src/testzzuf/test_post.c
index bf1416da..0b184467 100644
--- a/src/testzzuf/test_post.c
+++ b/src/testzzuf/test_post.c
@@ -54,15 +54,15 @@ struct CBC
54static void 54static void
55completed_cb (void *cls, 55completed_cb (void *cls,
56 struct MHD_Connection *connection, 56 struct MHD_Connection *connection,
57 void **con_cls, 57 void **req_cls,
58 enum MHD_RequestTerminationCode toe) 58 enum MHD_RequestTerminationCode toe)
59{ 59{
60 struct MHD_PostProcessor *pp = *con_cls; 60 struct MHD_PostProcessor *pp = *req_cls;
61 (void) cls; (void) connection; (void) toe; /* Unused. Silent compiler warning. */ 61 (void) cls; (void) connection; (void) toe; /* Unused. Silent compiler warning. */
62 62
63 if (NULL != pp) 63 if (NULL != pp)
64 MHD_destroy_post_processor (pp); 64 MHD_destroy_post_processor (pp);
65 *con_cls = NULL; 65 *req_cls = NULL;
66} 66}
67 67
68 68
@@ -114,7 +114,7 @@ ahc_echo (void *cls,
114 const char *method, 114 const char *method,
115 const char *version, 115 const char *version,
116 const char *upload_data, size_t *upload_data_size, 116 const char *upload_data, size_t *upload_data_size,
117 void **unused) 117 void **req_cls)
118{ 118{
119 static int eok; 119 static int eok;
120 struct MHD_Response *response; 120 struct MHD_Response *response;
@@ -136,12 +136,12 @@ ahc_echo (void *cls,
136 { 136 {
137 return MHD_NO; /* unexpected method */ 137 return MHD_NO; /* unexpected method */
138 } 138 }
139 pp = *unused; 139 pp = *req_cls;
140 if (pp == NULL) 140 if (pp == NULL)
141 { 141 {
142 eok = 0; 142 eok = 0;
143 pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok); 143 pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok);
144 *unused = pp; 144 *req_cls = pp;
145 } 145 }
146 MHD_post_process (pp, upload_data, *upload_data_size); 146 MHD_post_process (pp, upload_data, *upload_data_size);
147 if ((eok == 3) && (0 == *upload_data_size)) 147 if ((eok == 3) && (0 == *upload_data_size))
@@ -152,7 +152,7 @@ ahc_echo (void *cls,
152 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 152 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
153 MHD_destroy_response (response); 153 MHD_destroy_response (response);
154 MHD_destroy_post_processor (pp); 154 MHD_destroy_post_processor (pp);
155 *unused = NULL; 155 *req_cls = NULL;
156 return ret; 156 return ret;
157 } 157 }
158 *upload_data_size = 0; 158 *upload_data_size = 0;
diff --git a/src/testzzuf/test_post_form.c b/src/testzzuf/test_post_form.c
index d5a65b77..9538f3ca 100644
--- a/src/testzzuf/test_post_form.c
+++ b/src/testzzuf/test_post_form.c
@@ -52,15 +52,15 @@ struct CBC
52static void 52static void
53completed_cb (void *cls, 53completed_cb (void *cls,
54 struct MHD_Connection *connection, 54 struct MHD_Connection *connection,
55 void **con_cls, 55 void **req_cls,
56 enum MHD_RequestTerminationCode toe) 56 enum MHD_RequestTerminationCode toe)
57{ 57{
58 struct MHD_PostProcessor *pp = *con_cls; 58 struct MHD_PostProcessor *pp = *req_cls;
59 (void) cls; (void) connection; (void) toe; /* Unused. Silent compiler warning. */ 59 (void) cls; (void) connection; (void) toe; /* Unused. Silent compiler warning. */
60 60
61 if (NULL != pp) 61 if (NULL != pp)
62 MHD_destroy_post_processor (pp); 62 MHD_destroy_post_processor (pp);
63 *con_cls = NULL; 63 *req_cls = NULL;
64} 64}
65 65
66 66
@@ -117,7 +117,7 @@ ahc_echo (void *cls,
117 const char *method, 117 const char *method,
118 const char *version, 118 const char *version,
119 const char *upload_data, size_t *upload_data_size, 119 const char *upload_data, size_t *upload_data_size,
120 void **unused) 120 void **req_cls)
121{ 121{
122 static int eok; 122 static int eok;
123 struct MHD_Response *response; 123 struct MHD_Response *response;
@@ -139,14 +139,14 @@ ahc_echo (void *cls,
139 { 139 {
140 return MHD_NO; /* unexpected method */ 140 return MHD_NO; /* unexpected method */
141 } 141 }
142 pp = *unused; 142 pp = *req_cls;
143 if (pp == NULL) 143 if (pp == NULL)
144 { 144 {
145 eok = 0; 145 eok = 0;
146 pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok); 146 pp = MHD_create_post_processor (connection, 1024, &post_iterator, &eok);
147 if (pp == NULL) 147 if (pp == NULL)
148 return MHD_NO; 148 return MHD_NO;
149 *unused = pp; 149 *req_cls = pp;
150 } 150 }
151 MHD_post_process (pp, upload_data, *upload_data_size); 151 MHD_post_process (pp, upload_data, *upload_data_size);
152 if ((eok == 3) && (0 == *upload_data_size)) 152 if ((eok == 3) && (0 == *upload_data_size))
@@ -157,7 +157,7 @@ ahc_echo (void *cls,
157 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 157 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
158 MHD_destroy_response (response); 158 MHD_destroy_response (response);
159 MHD_destroy_post_processor (pp); 159 MHD_destroy_post_processor (pp);
160 *unused = NULL; 160 *req_cls = NULL;
161 return ret; 161 return ret;
162 } 162 }
163 *upload_data_size = 0; 163 *upload_data_size = 0;
diff --git a/src/testzzuf/test_put.c b/src/testzzuf/test_put.c
index 3b60962a..ee6eee2a 100644
--- a/src/testzzuf/test_put.c
+++ b/src/testzzuf/test_put.c
@@ -83,12 +83,12 @@ ahc_echo (void *cls,
83 const char *method, 83 const char *method,
84 const char *version, 84 const char *version,
85 const char *upload_data, size_t *upload_data_size, 85 const char *upload_data, size_t *upload_data_size,
86 void **unused) 86 void **req_cls)
87{ 87{
88 int *done = cls; 88 int *done = cls;
89 struct MHD_Response *response; 89 struct MHD_Response *response;
90 enum MHD_Result ret; 90 enum MHD_Result ret;
91 (void) version; (void) unused; /* Unused. Silent compiler warning. */ 91 (void) version; (void) req_cls; /* Unused. Silent compiler warning. */
92 92
93 if (NULL == url) 93 if (NULL == url)
94 fprintf (stderr, "The \"url\" parameter is NULL.\n"); 94 fprintf (stderr, "The \"url\" parameter is NULL.\n");
diff --git a/src/testzzuf/test_put_chunked.c b/src/testzzuf/test_put_chunked.c
index 83cfe844..34c03215 100644
--- a/src/testzzuf/test_put_chunked.c
+++ b/src/testzzuf/test_put_chunked.c
@@ -83,13 +83,13 @@ ahc_echo (void *cls,
83 const char *method, 83 const char *method,
84 const char *version, 84 const char *version,
85 const char *upload_data, size_t *upload_data_size, 85 const char *upload_data, size_t *upload_data_size,
86 void **unused) 86 void **req_cls)
87{ 87{
88 int *done = cls; 88 int *done = cls;
89 struct MHD_Response *response; 89 struct MHD_Response *response;
90 enum MHD_Result ret; 90 enum MHD_Result ret;
91 int have; 91 int have;
92 (void) version; (void) unused; /* Unused. Silent compiler warning. */ 92 (void) version; (void) req_cls; /* Unused. Silent compiler warning. */
93 93
94 if (NULL == url) 94 if (NULL == url)
95 fprintf (stderr, "The \"url\" parameter is NULL.\n"); 95 fprintf (stderr, "The \"url\" parameter is NULL.\n");
diff --git a/src/testzzuf/test_put_large.c b/src/testzzuf/test_put_large.c
index c3cffa3d..de70f12a 100644
--- a/src/testzzuf/test_put_large.c
+++ b/src/testzzuf/test_put_large.c
@@ -91,12 +91,12 @@ ahc_echo (void *cls,
91 const char *method, 91 const char *method,
92 const char *version, 92 const char *version,
93 const char *upload_data, size_t *upload_data_size, 93 const char *upload_data, size_t *upload_data_size,
94 void **unused) 94 void **req_cls)
95{ 95{
96 int *done = cls; 96 int *done = cls;
97 struct MHD_Response *response; 97 struct MHD_Response *response;
98 enum MHD_Result ret; 98 enum MHD_Result ret;
99 (void) version; (void) unused; /* Unused. Silent compiler warning. */ 99 (void) version; (void) req_cls; /* Unused. Silent compiler warning. */
100 100
101 if (NULL == url) 101 if (NULL == url)
102 fprintf (stderr, "The \"url\" parameter is NULL.\n"); 102 fprintf (stderr, "The \"url\" parameter is NULL.\n");