summaryrefslogtreecommitdiffstats
path: root/src/http/v3/ngx_http_v3_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/v3/ngx_http_v3_parse.c')
-rw-r--r--src/http/v3/ngx_http_v3_parse.c91
1 files changed, 4 insertions, 87 deletions
diff --git a/src/http/v3/ngx_http_v3_parse.c b/src/http/v3/ngx_http_v3_parse.c
index 7ea284f8a..c51a486c3 100644
--- a/src/http/v3/ngx_http_v3_parse.c
+++ b/src/http/v3/ngx_http_v3_parse.c
@@ -1159,10 +1159,7 @@ ngx_http_v3_parse_control(ngx_connection_t *c, ngx_http_v3_parse_control_t *st,
sw_first_type,
sw_type,
sw_length,
- sw_cancel_push,
sw_settings,
- sw_max_push_id,
- sw_goaway,
sw_skip
};
@@ -1212,6 +1209,10 @@ ngx_http_v3_parse_control(ngx_connection_t *c, ngx_http_v3_parse_control_t *st,
return NGX_HTTP_V3_ERR_FRAME_UNEXPECTED;
}
+ if (st->type == NGX_HTTP_V3_FRAME_CANCEL_PUSH) {
+ return NGX_HTTP_V3_ERR_ID_ERROR;
+ }
+
st->state = sw_length;
break;
@@ -1233,22 +1234,10 @@ ngx_http_v3_parse_control(ngx_connection_t *c, ngx_http_v3_parse_control_t *st,
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;
- case NGX_HTTP_V3_FRAME_MAX_PUSH_ID:
- 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");
@@ -1257,30 +1246,6 @@ ngx_http_v3_parse_control(ngx_connection_t *c, ngx_http_v3_parse_control_t *st,
break;
- case sw_cancel_push:
-
- ngx_http_v3_parse_start_local(b, &loc, st->length);
-
- rc = ngx_http_v3_parse_varlen_int(c, &st->vlint, &loc);
-
- ngx_http_v3_parse_end_local(b, &loc, &st->length);
-
- 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:
ngx_http_v3_parse_start_local(b, &loc, st->length);
@@ -1303,54 +1268,6 @@ ngx_http_v3_parse_control(ngx_connection_t *c, ngx_http_v3_parse_control_t *st,
break;
- case sw_max_push_id:
-
- ngx_http_v3_parse_start_local(b, &loc, st->length);
-
- rc = ngx_http_v3_parse_varlen_int(c, &st->vlint, &loc);
-
- ngx_http_v3_parse_end_local(b, &loc, &st->length);
-
- if (st->length == 0 && rc == NGX_AGAIN) {
- return NGX_HTTP_V3_ERR_FRAME_ERROR;
- }
-
- if (rc != NGX_DONE) {
- return rc;
- }
-
- rc = ngx_http_v3_set_max_push_id(c, st->vlint.value);
- if (rc != NGX_OK) {
- return rc;
- }
-
- st->state = sw_type;
- break;
-
- case sw_goaway:
-
- ngx_http_v3_parse_start_local(b, &loc, st->length);
-
- rc = ngx_http_v3_parse_varlen_int(c, &st->vlint, &loc);
-
- ngx_http_v3_parse_end_local(b, &loc, &st->length);
-
- 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:
rc = ngx_http_v3_parse_skip(b, &st->length);