diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/libweb/handler.h | 1 | ||||
| -rw-r--r-- | include/libweb/http.h | 14 |
2 files changed, 10 insertions, 5 deletions
diff --git a/include/libweb/handler.h b/include/libweb/handler.h index 9cde129..f7bc76a 100644 --- a/include/libweb/handler.h +++ b/include/libweb/handler.h @@ -13,6 +13,7 @@ struct handler_cfg int (*length)(unsigned long long len, const struct http_cookie *c, struct http_response *r, void *user); void *user; + size_t max_headers; }; struct handler *handler_alloc(const struct handler_cfg *cfg); diff --git a/include/libweb/http.h b/include/libweb/http.h index 80030fb..ddb6a89 100644 --- a/include/libweb/http.h +++ b/include/libweb/http.h @@ -5,6 +5,11 @@ #include <stddef.h> #include <stdio.h> +struct http_header +{ + char *header, *value; +}; + struct http_payload { enum http_op @@ -46,7 +51,8 @@ struct http_payload char *key, *value; } *args; - size_t n_args; + size_t n_args, n_headers; + const struct http_header *headers; }; #define HTTP_STATUSES \ @@ -69,10 +75,7 @@ struct http_response #undef X } status; - struct http_header - { - char *header, *value; - } *headers; + struct http_header *headers; union { @@ -96,6 +99,7 @@ struct http_cfg struct http_response *r, void *user); const char *tmpdir; void *user; + size_t max_headers; }; struct http_ctx *http_alloc(const struct http_cfg *cfg); |
