don't reset the QPACK encoder / decoder streams

We don't need these streams, since our QPACK implementation doesn't use the
dynamic table yet. However, we MUST NOT close / reset these streams. Instead,
just ignore them.
This commit is contained in:
Marten Seemann
2021-03-04 09:47:57 +08:00
parent f513437854
commit 6f32d2df1d
4 changed files with 73 additions and 7 deletions

View File

@@ -30,11 +30,16 @@ var (
)
const (
nextProtoH3Draft29 = "h3-29"
nextProtoH3Draft32 = "h3-32"
nextProtoH3Draft34 = "h3-34"
streamTypeControlStream = 0
streamTypePushStream = 1
nextProtoH3Draft29 = "h3-29"
nextProtoH3Draft32 = "h3-32"
nextProtoH3Draft34 = "h3-34"
)
const (
streamTypeControlStream = 0
streamTypePushStream = 1
streamTypeQPACKEncoderStream = 2
streamTypeQPACKDecoderStream = 3
)
func versionToALPN(v protocol.VersionNumber) string {
@@ -291,6 +296,10 @@ func (s *Server) handleUnidirectionalStreams(sess quic.EarlySession) {
// We're only interested in the control stream here.
switch streamType {
case streamTypeControlStream:
case streamTypeQPACKEncoderStream, streamTypeQPACKDecoderStream:
// Our QPACK implementation doesn't use the dynamic table yet.
// TODO: check that only one stream of each type is opened.
return
case streamTypePushStream: // only the server can push
sess.CloseWithError(quic.ErrorCode(errorStreamCreationError), "")
return