From 96e1db1c34a0c206463b86fb3400545f0147f476 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Fri, 11 Jun 2021 13:24:24 +0300 Subject: HTTP/3: client GOAWAY support. --- src/http/v3/ngx_http_v3_parse.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/http/v3/ngx_http_v3_parse.c') diff --git a/src/http/v3/ngx_http_v3_parse.c b/src/http/v3/ngx_http_v3_parse.c index 7bd9e6327..5951dff10 100644 --- a/src/http/v3/ngx_http_v3_parse.c +++ b/src/http/v3/ngx_http_v3_parse.c @@ -1012,6 +1012,7 @@ ngx_http_v3_parse_control(ngx_connection_t *c, ngx_http_v3_parse_control_t *st, sw_cancel_push, sw_settings, sw_max_push_id, + sw_goaway, sw_skip }; @@ -1091,6 +1092,10 @@ ngx_http_v3_parse_control(ngx_connection_t *c, ngx_http_v3_parse_control_t *st, st->state = sw_max_push_id; break; + case NGX_HTTP_V3_FRAME_GOAWAY: + st->state = sw_goaway; + break; + default: ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 parse skip unknown frame"); @@ -1157,6 +1162,26 @@ ngx_http_v3_parse_control(ngx_connection_t *c, ngx_http_v3_parse_control_t *st, st->state = sw_type; break; + case sw_goaway: + + 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_goaway(c, st->vlint.value); + if (rc != NGX_OK) { + return rc; + } + + st->state = sw_type; + break; + case sw_skip: if (--st->length == 0) { -- cgit v1.2.3