|
@@ -1575,6 +1575,12 @@ func (sc *serverConn) processData(f *DataFrame) error {
|
|
|
// type PROTOCOL_ERROR."
|
|
// type PROTOCOL_ERROR."
|
|
|
return ConnectionError(ErrCodeProtocol)
|
|
return ConnectionError(ErrCodeProtocol)
|
|
|
}
|
|
}
|
|
|
|
|
+ // RFC 7540, sec 6.1: If a DATA frame is received whose stream is not in
|
|
|
|
|
+ // "open" or "half-closed (local)" state, the recipient MUST respond with a
|
|
|
|
|
+ // stream error (Section 5.4.2) of type STREAM_CLOSED.
|
|
|
|
|
+ if state == stateClosed {
|
|
|
|
|
+ return streamError(id, ErrCodeStreamClosed)
|
|
|
|
|
+ }
|
|
|
if st == nil || state != stateOpen || st.gotTrailerHeader || st.resetQueued {
|
|
if st == nil || state != stateOpen || st.gotTrailerHeader || st.resetQueued {
|
|
|
// This includes sending a RST_STREAM if the stream is
|
|
// This includes sending a RST_STREAM if the stream is
|
|
|
// in stateHalfClosedLocal (which currently means that
|
|
// in stateHalfClosedLocal (which currently means that
|