diff options
author | Stefan Eissing <icing@apache.org> | 2021-02-22 14:11:09 +0000 |
---|---|---|
committer | Stefan Eissing <icing@apache.org> | 2021-02-22 14:11:09 +0000 |
commit | 309e0838934e8a1f94fca24a7a3881f5bc5a3af0 (patch) | |
tree | 3a36b5551b91e75d37730e764f9ff229d5c5f8a3 /modules/http2/h2_headers.c | |
parent | 42f33b4171aaebc0ab3e62187d12c14a1aebad68 (diff) | |
download | httpd-309e0838934e8a1f94fca24a7a3881f5bc5a3af0.tar.gz |
mod_htt2, synch with changes from github module version:
- logio: improvements to reporting of sent bytes for http2 responses
- directive H2OutputBuffering, controls if any output should be sent immediately.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1886792 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/http2/h2_headers.c')
-rw-r--r-- | modules/http2/h2_headers.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/http2/h2_headers.c b/modules/http2/h2_headers.c index 1ef89d9f73..271b1f1c61 100644 --- a/modules/http2/h2_headers.c +++ b/modules/http2/h2_headers.c @@ -64,6 +64,7 @@ apr_bucket * h2_bucket_headers_make(apr_bucket *b, h2_headers *r) b = apr_bucket_shared_make(b, br, 0, 0); b->type = &h2_bucket_type_headers; + b->length = h2_headers_length(r); return b; } @@ -125,6 +126,20 @@ h2_headers *h2_headers_create(int status, apr_table_t *headers_in, return headers; } +static int add_header_lengths(void *ctx, const char *name, const char *value) +{ + apr_size_t *plen = ctx; + *plen += strlen(name) + strlen(value); + return 1; +} + +apr_size_t h2_headers_length(h2_headers *headers) +{ + apr_size_t len = 0; + apr_table_do(add_header_lengths, &len, headers->headers, NULL); + return len; +} + h2_headers *h2_headers_rcreate(request_rec *r, int status, apr_table_t *header, apr_pool_t *pool) { |