Skip to content

Main for loop never terminates for parse!(r, p, Vector{UInt8}("Some-Header:")) #125

@samoconnor

Description

@samoconnor

The main for loop in parse!() never terminates when the last parser input is fragmented so that the last character in the input bytes is the : at the end of a header.

i.e. If the parser will lock up if the request data is fragmented so that the first call to readavailable(socket) returns "HTTP/1.1 200 OK\r\nDate:".

PR #124 adds a test that parses 1 byte at a time to demonstrate the problem and adds a loop invariant @assert to the for loop to stop in looping forever.

julia> HTTP.parse(HTTP.Response, "HTTP/1.1 200 OK\r\nDate:")
ERROR: AssertionError: p > old_p

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