Skip to content

Send RST stream with PROTOCOL_ERROR when receive DATA frame after cancel stream #6171

@tmpdat

Description

@tmpdat

Following log on http / 2 server, I noticed that okhttp3.12.8 sent RST stream with PROTOCOL_ERROR when receiving DATA frame after canceling the stream.

This doesn't seem to be true for the HTTP / 2 specification, but only for SPDY in the Stream state: closed section (https://http2.github.io/http2-spec/#StreamStates):

HTTP / 2 specification:
"If this state is reached as a result of sending a RST_STREAM frame, the peer that receives the RST_STREAM might have already sent - or enqueued for sending - frames on the stream that cannot be withdrawn. An endpoint MUST ignore frames that it receives on closed streams after it has sent a RST_STREAM frame. An endpoint MAY choose to limit the period over which it ignores frames and treat frames that arrive after this time as being in error. "
SPDY specification (SPDY Protocol - Draft 3 https://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3-1#TOC-2.3.7-Stream-close):
"If an endpoint receives a data frame after the stream is closed, it must send a RST_STREAM to the sender with the status PROTOCOL_ERROR."

This is causing the server to acknowledge an error, wasting sending / receiving RST frames on client / server.

I have tried to find this error in Okhttp's Change log but have not seen it. So, I hope Okhttp can reconsider this if it has never been mentioned. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions