From 80a38580bd04f499d72ab3b6f7776e275e47a2b3 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Fri, 27 Mar 2020 19:46:54 +0300 Subject: Chunked response body in HTTP/3. --- src/http/v3/ngx_http_v3_request.c | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'src/http/v3/ngx_http_v3_request.c') diff --git a/src/http/v3/ngx_http_v3_request.c b/src/http/v3/ngx_http_v3_request.c index b00b93ce2..756a6f90d 100644 --- a/src/http/v3/ngx_http_v3_request.c +++ b/src/http/v3/ngx_http_v3_request.c @@ -258,11 +258,6 @@ ngx_http_v3_create_header(ngx_http_request_t *r) ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 create header"); - /* XXX support chunked body in the chunked filter */ - if (!r->header_only && r->headers_out.content_length_n == -1) { - return NULL; - } - len = 2; if (r->headers_out.status == NGX_HTTP_OK) { @@ -578,3 +573,33 @@ ngx_http_v3_create_header(ngx_http_request_t *r) return hl; } + + +ngx_chain_t * +ngx_http_v3_create_trailers(ngx_http_request_t *r) +{ + ngx_buf_t *b; + ngx_chain_t *cl; + + ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "http3 create trailers"); + + /* XXX */ + + b = ngx_calloc_buf(r->pool); + if (b == NULL) { + return NULL; + } + + b->last_buf = 1; + + cl = ngx_alloc_chain_link(r->pool); + if (cl == NULL) { + return NULL; + } + + cl->buf = b; + cl->next = NULL; + + return cl; +} -- cgit v1.2.3