Skip to content

Commit

Permalink
Actually use the lock in readbody (#1049)
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj authored May 14, 2023
1 parent 53c9711 commit 7685178
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/clientlayers/StreamRequest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,13 @@ function readbody!(stream::Stream, res::Response, buf_or_stream, lock)
# read the response body into the request context so that it can be
# read by the user if they want to or set later if
# we end up not retrying/redirecting/etc.
res.request.context[:response_body] = read(buf_or_stream)
Base.@lock lock begin
res.request.context[:response_body] = read(buf_or_stream)
end
end
Base.@lock lock begin
res.request.context[:nbytes] = n
end
res.request.context[:nbytes] = n
end

end # module StreamRequest

0 comments on commit 7685178

Please sign in to comment.