diff options
author | Roman Arutyunyan <arut@nginx.com> | 2020-07-23 13:41:24 +0300 |
---|---|---|
committer | Roman Arutyunyan <arut@nginx.com> | 2020-07-23 13:41:24 +0300 |
commit | 6d064c94e0600f7ff15e2815784f9f89cc4858b4 (patch) | |
tree | 4ed79e2d168f9c145167a5fe924bc1e050f3ad00 /src/http/v3/ngx_http_v3_parse.c | |
parent | 77384356cea5750aee576b7d4a68aa0b0a1c13a1 (diff) | |
download | nginx-6d064c94e0600f7ff15e2815784f9f89cc4858b4.tar.gz nginx-6d064c94e0600f7ff15e2815784f9f89cc4858b4.zip |
HTTP/3: server pushes.
New directives are added:
- http3_max_concurrent_pushes
- http3_push
- http3_push_preload
Diffstat (limited to 'src/http/v3/ngx_http_v3_parse.c')
-rw-r--r-- | src/http/v3/ngx_http_v3_parse.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/src/http/v3/ngx_http_v3_parse.c b/src/http/v3/ngx_http_v3_parse.c index 8a68fddd8..1a7aa17f8 100644 --- a/src/http/v3/ngx_http_v3_parse.c +++ b/src/http/v3/ngx_http_v3_parse.c @@ -933,6 +933,7 @@ ngx_http_v3_parse_control(ngx_connection_t *c, void *data, u_char ch) sw_first_type, sw_type, sw_length, + sw_cancel_push, sw_settings, sw_max_push_id, sw_skip @@ -988,6 +989,10 @@ ngx_http_v3_parse_control(ngx_connection_t *c, void *data, u_char ch) switch (st->type) { + case NGX_HTTP_V3_FRAME_CANCEL_PUSH: + st->state = sw_cancel_push; + break; + case NGX_HTTP_V3_FRAME_SETTINGS: st->state = sw_settings; break; @@ -1004,6 +1009,26 @@ ngx_http_v3_parse_control(ngx_connection_t *c, void *data, u_char ch) break; + case sw_cancel_push: + + rc = ngx_http_v3_parse_varlen_int(c, &st->vlint, ch); + + if (--st->length == 0 && rc == NGX_AGAIN) { + return NGX_HTTP_V3_ERR_FRAME_ERROR; + } + + if (rc != NGX_DONE) { + return rc; + } + + rc = ngx_http_v3_cancel_push(c, st->vlint.value); + if (rc != NGX_OK) { + return rc; + } + + st->state = sw_type; + break; + case sw_settings: rc = ngx_http_v3_parse_settings(c, &st->settings, ch); @@ -1025,12 +1050,19 @@ ngx_http_v3_parse_control(ngx_connection_t *c, void *data, u_char ch) case sw_max_push_id: rc = ngx_http_v3_parse_varlen_int(c, &st->vlint, ch); + + if (--st->length == 0 && rc == NGX_AGAIN) { + return NGX_HTTP_V3_ERR_FRAME_ERROR; + } + if (rc != NGX_DONE) { return rc; } - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, - "http3 parse MAX_PUSH_ID:%uL", st->vlint.value); + rc = ngx_http_v3_set_max_push_id(c, st->vlint.value); + if (rc != NGX_OK) { + return rc; + } st->state = sw_type; break; |