aboutsummaryrefslogtreecommitdiff
path: root/src/http/v3/ngx_http_v3_parse.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2021-06-11 13:24:24 +0300
committerRoman Arutyunyan <arut@nginx.com>2021-06-11 13:24:24 +0300
commit96e1db1c34a0c206463b86fb3400545f0147f476 (patch)
tree43caefb62aaf0468eeb18c912aebfe8bc8b44576 /src/http/v3/ngx_http_v3_parse.c
parent80a5227617924f666a39f8debf556ab525f420c9 (diff)
downloadnginx-96e1db1c34a0c206463b86fb3400545f0147f476.tar.gz
nginx-96e1db1c34a0c206463b86fb3400545f0147f476.zip
HTTP/3: client GOAWAY support.
Diffstat (limited to 'src/http/v3/ngx_http_v3_parse.c')
-rw-r--r--src/http/v3/ngx_http_v3_parse.c25
1 files changed, 25 insertions, 0 deletions
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) {