diff options
Diffstat (limited to 'src/microhttpd/internal.c')
-rw-r--r-- | src/microhttpd/internal.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/microhttpd/internal.c b/src/microhttpd/internal.c index b1e2ad36..e9e92414 100644 --- a/src/microhttpd/internal.c +++ b/src/microhttpd/internal.c | |||
@@ -186,7 +186,7 @@ MHD_http_unescape (char *val) | |||
186 | * @param[in,out] args argument URI string (after "?" in URI), | 186 | * @param[in,out] args argument URI string (after "?" in URI), |
187 | * clobbered in the process! | 187 | * clobbered in the process! |
188 | * @param cb function to call on each key-value pair found | 188 | * @param cb function to call on each key-value pair found |
189 | * @param[out] num_headers set to the number of headers found | 189 | * @param cls the iterator context |
190 | * @return #MHD_NO on failure (@a cb returned #MHD_NO), | 190 | * @return #MHD_NO on failure (@a cb returned #MHD_NO), |
191 | * #MHD_YES for success (parsing succeeded, @a cb always | 191 | * #MHD_YES for success (parsing succeeded, @a cb always |
192 | * returned #MHD_YES) | 192 | * returned #MHD_YES) |
@@ -196,13 +196,12 @@ MHD_parse_arguments_ (struct MHD_Connection *connection, | |||
196 | enum MHD_ValueKind kind, | 196 | enum MHD_ValueKind kind, |
197 | char *args, | 197 | char *args, |
198 | MHD_ArgumentIterator_ cb, | 198 | MHD_ArgumentIterator_ cb, |
199 | unsigned int *num_headers) | 199 | void *cls) |
200 | { | 200 | { |
201 | struct MHD_Daemon *daemon = connection->daemon; | 201 | struct MHD_Daemon *daemon = connection->daemon; |
202 | char *equals; | 202 | char *equals; |
203 | char *amper; | 203 | char *amper; |
204 | 204 | ||
205 | *num_headers = 0; | ||
206 | while ( (NULL != args) && | 205 | while ( (NULL != args) && |
207 | ('\0' != args[0]) ) | 206 | ('\0' != args[0]) ) |
208 | { | 207 | { |
@@ -220,14 +219,13 @@ MHD_parse_arguments_ (struct MHD_Connection *connection, | |||
220 | key_len = daemon->unescape_callback (daemon->unescape_callback_cls, | 219 | key_len = daemon->unescape_callback (daemon->unescape_callback_cls, |
221 | connection, | 220 | connection, |
222 | args); | 221 | args); |
223 | if (MHD_NO == cb (connection, | 222 | if (MHD_NO == cb (cls, |
224 | args, | 223 | args, |
225 | key_len, | 224 | key_len, |
226 | NULL, | 225 | NULL, |
227 | 0, | 226 | 0, |
228 | kind)) | 227 | kind)) |
229 | return MHD_NO; | 228 | return MHD_NO; |
230 | (*num_headers)++; | ||
231 | break; | 229 | break; |
232 | } | 230 | } |
233 | /* got 'foo=bar' */ | 231 | /* got 'foo=bar' */ |
@@ -241,14 +239,13 @@ MHD_parse_arguments_ (struct MHD_Connection *connection, | |||
241 | value_len = daemon->unescape_callback (daemon->unescape_callback_cls, | 239 | value_len = daemon->unescape_callback (daemon->unescape_callback_cls, |
242 | connection, | 240 | connection, |
243 | equals); | 241 | equals); |
244 | if (MHD_NO == cb (connection, | 242 | if (MHD_NO == cb (cls, |
245 | args, | 243 | args, |
246 | key_len, | 244 | key_len, |
247 | equals, | 245 | equals, |
248 | value_len, | 246 | value_len, |
249 | kind)) | 247 | kind)) |
250 | return MHD_NO; | 248 | return MHD_NO; |
251 | (*num_headers)++; | ||
252 | break; | 249 | break; |
253 | } | 250 | } |
254 | /* amper is non-NULL here */ | 251 | /* amper is non-NULL here */ |
@@ -262,7 +259,7 @@ MHD_parse_arguments_ (struct MHD_Connection *connection, | |||
262 | key_len = daemon->unescape_callback (daemon->unescape_callback_cls, | 259 | key_len = daemon->unescape_callback (daemon->unescape_callback_cls, |
263 | connection, | 260 | connection, |
264 | args); | 261 | args); |
265 | if (MHD_NO == cb (connection, | 262 | if (MHD_NO == cb (cls, |
266 | args, | 263 | args, |
267 | key_len, | 264 | key_len, |
268 | NULL, | 265 | NULL, |
@@ -270,7 +267,6 @@ MHD_parse_arguments_ (struct MHD_Connection *connection, | |||
270 | kind)) | 267 | kind)) |
271 | return MHD_NO; | 268 | return MHD_NO; |
272 | /* continue with 'bar' */ | 269 | /* continue with 'bar' */ |
273 | (*num_headers)++; | ||
274 | args = amper; | 270 | args = amper; |
275 | continue; | 271 | continue; |
276 | } | 272 | } |
@@ -286,14 +282,13 @@ MHD_parse_arguments_ (struct MHD_Connection *connection, | |||
286 | value_len = daemon->unescape_callback (daemon->unescape_callback_cls, | 282 | value_len = daemon->unescape_callback (daemon->unescape_callback_cls, |
287 | connection, | 283 | connection, |
288 | equals); | 284 | equals); |
289 | if (MHD_NO == cb (connection, | 285 | if (MHD_NO == cb (cls, |
290 | args, | 286 | args, |
291 | key_len, | 287 | key_len, |
292 | equals, | 288 | equals, |
293 | value_len, | 289 | value_len, |
294 | kind)) | 290 | kind)) |
295 | return MHD_NO; | 291 | return MHD_NO; |
296 | (*num_headers)++; | ||
297 | args = amper; | 292 | args = amper; |
298 | } | 293 | } |
299 | return MHD_YES; | 294 | return MHD_YES; |