You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I create a Server with a FIFOBuffer Response body.
I have an async task that writes data to the FIFOBuffer once per second forever.
Rather than the client receiving an infinite stream of data, it only gets the first line, after which the server closes the connection.
It looks like maybe Base.write(io::IO, r::Union{Request, Response} ...) should be doing while !eof(response.body) write(io, readavailable(response.body) end ?
Also, a content-length header is being returned even though the content is unknown (because the response FIFOBuffer has not been closed yet).
julia> server = HTTP.Server((req, rep) ->begin
io = HTTP.FIFOBuffer()
@asyncwhiletrueprintln(io, "data: $(now())\n")
sleep(1)
end
r =Response(200, Dict(
"Content-Type"=>"text/event-stream",
"Cache-Control"=>"no-cache",
"Connection"=>"keep-alive"
), io)
end, STDOUT)
julia> HTTP.serve(server)
I create a Server with a FIFOBuffer Response body.
I have an async task that writes data to the FIFOBuffer once per second forever.
Rather than the client receiving an infinite stream of data, it only gets the first line, after which the server closes the connection.
It looks like maybe
Base.write(io::IO, r::Union{Request, Response} ...)
should be doingwhile !eof(response.body) write(io, readavailable(response.body) end
?Also, a content-length header is being returned even though the content is unknown (because the response FIFOBuffer has not been closed yet).
The text was updated successfully, but these errors were encountered: