Skip to content

http2 server: a response body larger than the peer's window stalls when sent with endStream #1998

Description

@banglcb

On the server side, stream.sendData(body, endStream: true) with a body
larger than the client's stream window (65535 bytes by default) delivers
exactly the first 65535 bytes and then stops; the client's WINDOW_UPDATEs
for that stream have no effect.

Reproduction: a ServerTransportConnection over a plain TCP socket answers
a GET with sendHeaders([Header.ascii(':status', '200')]) then
sendData(Uint8List(200000), endStream: true); a
ClientTransportConnection reads the response. The client receives 65535
bytes and sends WINDOW_UPDATE frames for stream 1 (visible on the wire), and
nothing more arrives. When the body is written in chunks through
outgoingMessages.addStream(...) and the stream is closed afterwards, all
200000 bytes arrive.

It looks as if queuing the end of the stream closes it on this side while
data still waits for flow-control window, so later WINDOW_UPDATEs for it are
no longer applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions