From fa6b20617ef2c0ee68e2415d348c04839a792e4e Mon Sep 17 00:00:00 2001 From: Sam O'Connor Date: Mon, 16 Apr 2018 15:57:04 +1000 Subject: [PATCH] Reinstate `yield()` after `@async writebody(...)`. Was removed in b602c4ea0cf346b35ae9bea13db2c960eee759de : > Remove yeild() after @async writebody. This should increase the chance > that the startread() realises that the connection is dead before the > body is written. This change appears to have caused problems in other situations: https://github.com/samoconnor/AWSS3.jl/issues/26#issuecomment-378206352 The removal was driven by nanosoldier/GitHub.jl issues with POST requests on long-held connections. https://github.com/JuliaWeb/HTTP.jl/issues/220#issuecomment-376710381 GitHub.jl now handles this with the `idle_timeout=` option. https://github.com/JuliaWeb/GitHub.jl/pull/109 --- src/StreamRequest.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/StreamRequest.jl b/src/StreamRequest.jl index 2013ee502..d0fc31c80 100644 --- a/src/StreamRequest.jl +++ b/src/StreamRequest.jl @@ -54,6 +54,7 @@ function request(::Type{StreamLayer}, io::IO, request::Request, body; if iofunction == nothing @async writebody(http, request, body) + yield() startread(http) readbody(http, response, response_stream) else