forked from quic-go/quic-go
check that QUIC layer negotiated datagram support when handing SETTINGS
This commit is contained in:
@@ -301,8 +301,19 @@ func (s *Server) handleUnidirectionalStreams(sess quic.EarlySession) {
|
||||
sess.CloseWithError(quic.ErrorCode(errorFrameError), "")
|
||||
return
|
||||
}
|
||||
if _, ok := f.(*settingsFrame); !ok {
|
||||
sf, ok := f.(*settingsFrame)
|
||||
if !ok {
|
||||
sess.CloseWithError(quic.ErrorCode(errorMissingSettings), "")
|
||||
return
|
||||
}
|
||||
if !sf.Datagram {
|
||||
return
|
||||
}
|
||||
// If datagram support was enabled on our side as well as on the client side,
|
||||
// we can expect it to have been negotiated both on the transport and on the HTTP/3 layer.
|
||||
// Note: ConnectionState() will block until the handshake is complete (relevant when using 0-RTT).
|
||||
if s.EnableDatagrams && !sess.ConnectionState().SupportsDatagrams {
|
||||
sess.CloseWithError(quic.ErrorCode(errorSettingsError), "missing QUIC Datagram support")
|
||||
}
|
||||
}(str)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user