Mercurial > hg > nginx-quic
comparison src/http/v3/ngx_http_v3_parse.c @ 8495:ba5977b38b2e quic
HTTP/3: reordered H3_MISSING_SETTINGS and H3_FRAME_UNEXPECTED.
The quic-http-34 is ambiguous as to what error should be generated for the
first frame in control stream:
Each side MUST initiate a single control stream at the beginning of
the connection and send its SETTINGS frame as the first frame on this
stream. If the first frame of the control stream is any other frame
type, this MUST be treated as a connection error of type
H3_MISSING_SETTINGS.
If a DATA frame is received on a control stream, the recipient MUST
respond with a connection error of type H3_FRAME_UNEXPECTED.
If a HEADERS frame is received on a control stream, the recipient MUST
respond with a connection error of type H3_FRAME_UNEXPECTED.
Previously, H3_FRAME_UNEXPECTED had priority, but now H3_MISSING_SETTINGS has.
The arguments in the spec sound more compelling for H3_MISSING_SETTINGS.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Fri, 11 Jun 2021 10:56:51 +0300 |
parents | ac0398da8f23 |
children | 278ab0ed24f2 |
comparison
equal
deleted
inserted
replaced
8494:80d396fd8ee8 | 8495:ba5977b38b2e |
---|---|
1029 st->type = st->vlint.value; | 1029 st->type = st->vlint.value; |
1030 | 1030 |
1031 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, | 1031 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, |
1032 "http3 parse frame type:%ui", st->type); | 1032 "http3 parse frame type:%ui", st->type); |
1033 | 1033 |
1034 if (st->state == sw_first_type | |
1035 && st->type != NGX_HTTP_V3_FRAME_SETTINGS) | |
1036 { | |
1037 return NGX_HTTP_V3_ERR_MISSING_SETTINGS; | |
1038 } | |
1039 | |
1034 if (ngx_http_v3_is_v2_frame(st->type) | 1040 if (ngx_http_v3_is_v2_frame(st->type) |
1035 || st->type == NGX_HTTP_V3_FRAME_DATA | 1041 || st->type == NGX_HTTP_V3_FRAME_DATA |
1036 || st->type == NGX_HTTP_V3_FRAME_HEADERS) | 1042 || st->type == NGX_HTTP_V3_FRAME_HEADERS) |
1037 { | 1043 { |
1038 return NGX_HTTP_V3_ERR_FRAME_UNEXPECTED; | 1044 return NGX_HTTP_V3_ERR_FRAME_UNEXPECTED; |
1039 } | 1045 } |
1040 | 1046 |
1041 if (st->state == sw_first_type | |
1042 && st->type != NGX_HTTP_V3_FRAME_SETTINGS) | |
1043 { | |
1044 return NGX_HTTP_V3_ERR_MISSING_SETTINGS; | |
1045 } | |
1046 | |
1047 st->state = sw_length; | 1047 st->state = sw_length; |
1048 break; | 1048 break; |
1049 | 1049 |
1050 case sw_length: | 1050 case sw_length: |
1051 | 1051 |