summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2020-11-27 17:46:21 +0000
committerRoman Arutyunyan <arut@nginx.com>2020-11-27 17:46:21 +0000
commit4b440cbf97af3ffe0ab31cb083fb1ce5b0fb5f89 (patch)
tree01fa6fcb9fad6bb1e29e14597fa0aa22c04cb201 /src/http/modules
parent3b8dbfcab4643fbfd3f276d3e9302b406e07f7fc (diff)
downloadnginx-4b440cbf97af3ffe0ab31cb083fb1ce5b0fb5f89.tar.gz
nginx-4b440cbf97af3ffe0ab31cb083fb1ce5b0fb5f89.tar.bz2
HTTP/3: introduced ngx_http_v3_filter.
The filter is responsible for creating HTTP/3 response header and body. The change removes differences to the default branch for ngx_http_chunked_filter_module and ngx_http_header_filter_module.
Diffstat (limited to 'src/http/modules')
-rw-r--r--src/http/modules/ngx_http_chunked_filter_module.c50
1 files changed, 4 insertions, 46 deletions
diff --git a/src/http/modules/ngx_http_chunked_filter_module.c b/src/http/modules/ngx_http_chunked_filter_module.c
index 138369815..4d6fd3eed 100644
--- a/src/http/modules/ngx_http_chunked_filter_module.c
+++ b/src/http/modules/ngx_http_chunked_filter_module.c
@@ -106,7 +106,6 @@ ngx_http_chunked_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
{
u_char *chunk;
off_t size;
- size_t n;
ngx_int_t rc;
ngx_buf_t *b;
ngx_chain_t *out, *cl, *tl, **ll;
@@ -162,68 +161,27 @@ ngx_http_chunked_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
chunk = b->start;
if (chunk == NULL) {
+ /* the "0000000000000000" is 64-bit hexadecimal string */
-#if (NGX_HTTP_V3)
- if (r->http_version == NGX_HTTP_VERSION_30) {
- n = NGX_HTTP_V3_VARLEN_INT_LEN * 2;
-
- } else
-#endif
- {
- /* the "0000000000000000" is 64-bit hexadecimal string */
- n = sizeof("0000000000000000" CRLF) - 1;
- }
-
- chunk = ngx_palloc(r->pool, n);
+ chunk = ngx_palloc(r->pool, sizeof("0000000000000000" CRLF) - 1);
if (chunk == NULL) {
return NGX_ERROR;
}
b->start = chunk;
- b->end = chunk + n;
+ b->end = chunk + sizeof("0000000000000000" CRLF) - 1;
}
b->tag = (ngx_buf_tag_t) &ngx_http_chunked_filter_module;
b->memory = 0;
b->temporary = 1;
b->pos = chunk;
-
-#if (NGX_HTTP_V3)
- if (r->http_version == NGX_HTTP_VERSION_30) {
- b->last = (u_char *) ngx_http_v3_encode_varlen_int(chunk,
- NGX_HTTP_V3_FRAME_DATA);
- b->last = (u_char *) ngx_http_v3_encode_varlen_int(b->last, size);
-
- } else
-#endif
- {
- b->last = ngx_sprintf(chunk, "%xO" CRLF, size);
- }
+ b->last = ngx_sprintf(chunk, "%xO" CRLF, size);
tl->next = out;
out = tl;
}
-#if (NGX_HTTP_V3)
- if (r->http_version == NGX_HTTP_VERSION_30) {
-
- if (cl->buf->last_buf) {
- tl = ngx_http_v3_create_trailers(r);
- if (tl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf->last_buf = 0;
-
- *ll = tl;
-
- } else {
- *ll = NULL;
- }
-
- } else
-#endif
-
if (cl->buf->last_buf) {
tl = ngx_http_chunked_create_trailers(r, ctx);
if (tl == NULL) {