]> git.kaiwu.me - nginx.git/commitdiff
HTTP/3: adjusted control stream parsing.
authorVladimir Homutov <vl@nginx.com>
Thu, 22 Apr 2021 10:49:18 +0000 (13:49 +0300)
committerVladimir Homutov <vl@nginx.com>
Thu, 22 Apr 2021 10:49:18 +0000 (13:49 +0300)
7.2.1:
   If a DATA frame is received on a control stream, the recipient MUST
   respond with a connection error of type H3_FRAME_UNEXPECTED;

7.2.2:
   If a HEADERS frame is received on a control stream, the recipient MUST
   respond with a connection error (Section 8) of type H3_FRAME_UNEXPECTED.

src/http/v3/ngx_http_v3_parse.c

index b7cf242ba8d4e0233f9339cf5077e67ab7b37f54..18255a677403c02277836420781b24fa5e12f5fe 100644 (file)
@@ -1069,6 +1069,10 @@ ngx_http_v3_parse_control(ngx_connection_t *c, void *data, u_char ch)
             st->state = sw_max_push_id;
             break;
 
+        case NGX_HTTP_V3_FRAME_DATA:
+        case NGX_HTTP_V3_FRAME_HEADERS:
+            return NGX_HTTP_V3_ERR_FRAME_UNEXPECTED;
+
         default:
             ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
                            "http3 parse skip unknown frame");