diff options
Diffstat (limited to 'src/microhttpd/response.c')
-rw-r--r-- | src/microhttpd/response.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index 7e3deaf8..e1f2aebf 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c | |||
@@ -400,6 +400,42 @@ MHD_get_response_header (struct MHD_Response *response, | |||
400 | 400 | ||
401 | 401 | ||
402 | /** | 402 | /** |
403 | * Get a particular header (or footer) element from the response. | ||
404 | * | ||
405 | * Function returns the first found element. | ||
406 | * @param response response to query | ||
407 | * @param kind the kind of element: header or footer | ||
408 | * @param key the key which header to get | ||
409 | * @param key_len the length of the @a key | ||
410 | * @return NULL if header elemnt does not exist | ||
411 | * @ingroup response | ||
412 | */ | ||
413 | struct MHD_HTTP_Header * | ||
414 | MHD_get_response_element_n_ (struct MHD_Response *response, | ||
415 | enum MHD_ValueKind kind, | ||
416 | const char *key, | ||
417 | size_t key_len) | ||
418 | { | ||
419 | struct MHD_HTTP_Header *pos; | ||
420 | |||
421 | mhd_assert (NULL != key); | ||
422 | mhd_assert (0 != key[0]); | ||
423 | mhd_assert (0 != key_len); | ||
424 | |||
425 | for (pos = response->first_header; | ||
426 | NULL != pos; | ||
427 | pos = pos->next) | ||
428 | { | ||
429 | if ((pos->header_size == key_len) && | ||
430 | (kind == pos->kind) && | ||
431 | (MHD_str_equal_caseless_bin_n_ (pos->header, key, pos->header_size))) | ||
432 | return pos; | ||
433 | } | ||
434 | return NULL; | ||
435 | } | ||
436 | |||
437 | |||
438 | /** | ||
403 | * Check whether response header contains particular token. | 439 | * Check whether response header contains particular token. |
404 | * | 440 | * |
405 | * Token could be surrounded by spaces and tabs and delimited by comma. | 441 | * Token could be surrounded by spaces and tabs and delimited by comma. |