Skip to content

Emscripten bug with partial reads #3555

@joemarshall

Description

@joemarshall

On emscripten, if the request is read in chunks, sometimes it fails to read the whole amount. This is because the code in response.py assumes that if a read() call to the underlying request stream doesn't fill the buffer it is given, this must be the last buffer in the stream, which isn't the case sometimes, because the chunks we read are those given by javascript, which may be of arbitrary size.

if (self.length_is_certain and self.length_remaining == 0) or len(
data
) < amt:

I have a fix, which I'll make a PR for in a mo.

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