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
First of all, thanks for the great HTTP.jl package, I really appreciate this project!
I've noticed an issue with the WebSocket implementation: when multiple async tasks send WebSocket messages, a race condition may occur, causing the frames to become corrupted.
Below a minimal working example that exposes the issue (HTTP.jl v1.10.10).
using HTTP.WebSockets
functionwrite_message(ws, msg)
send(ws, msg)
endfunctionclient_twin(ws)
for count in1:10@asyncwrite_message(ws, count)
endendfunctionserve()
server = WebSockets.listen!("127.0.0.1", 8081) do ws
client_twin(ws)
# just for waitingreceive(ws)
endwait(server)
end
srvtask =@asyncserve()
WebSockets.open("ws://127.0.0.1:8081") do ws
trywhiletrue
s =receive(ws)
println(s)
endcatch e
@error"Ws client: $e"endend;
wait(srvtask)
First of all, thanks for the great HTTP.jl package, I really appreciate this project!
I've noticed an issue with the WebSocket implementation: when multiple async tasks send WebSocket messages, a race condition may occur, causing the frames to become corrupted.
Below a minimal working example that exposes the issue (HTTP.jl v1.10.10).
I've a forked HTTP.jl with a fix: cardo-org@d60bb5e
Would you be open to reviewing the fix and eventually accept a pull request?
greetings,
Attilio
The text was updated successfully, but these errors were encountered: