diff options
Diffstat (limited to 'src/http/v3')
| -rw-r--r-- | src/http/v3/ngx_http_v3.h | 1 | ||||
| -rw-r--r-- | src/http/v3/ngx_http_v3_request.c | 35 |
2 files changed, 31 insertions, 5 deletions
diff --git a/src/http/v3/ngx_http_v3.h b/src/http/v3/ngx_http_v3.h index 80bdaebb5..d28074d37 100644 --- a/src/http/v3/ngx_http_v3.h +++ b/src/http/v3/ngx_http_v3.h @@ -69,6 +69,7 @@ typedef struct { ngx_int_t ngx_http_v3_parse_header(ngx_http_request_t *r, ngx_buf_t *b); ngx_chain_t *ngx_http_v3_create_header(ngx_http_request_t *r); +ngx_chain_t *ngx_http_v3_create_trailers(ngx_http_request_t *r); uintptr_t ngx_http_v3_encode_varlen_int(u_char *p, uint64_t value); uintptr_t ngx_http_v3_encode_prefix_int(u_char *p, uint64_t value, 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; +} |
