diff --git a/src/Curl/Easy.jl b/src/Curl/Easy.jl index 4855010..866657a 100644 --- a/src/Curl/Easy.jl +++ b/src/Curl/Easy.jl @@ -369,15 +369,13 @@ end # feed data to read_callback function upload_data(easy::Easy, input::IO) while true - if easy.input === nothing || isempty(easy.input) - data = eof(input) ? nothing : readavailable(input) - easy.input === nothing && break - easy.input = data - end + data = eof(input) ? nothing : readavailable(input) + easy.input === nothing && break + reset(easy.input) + easy.input = data curl_easy_pause(easy.handle, Curl.CURLPAUSE_CONT) wait(easy.ready) easy.input === nothing && break - easy.ready = Threads.Event() end end