File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -436,13 +436,13 @@ _M.transfer_encoding_is_chunked = transfer_encoding_is_chunked
436436
437437
438438local function _reader_keepalive_ready_mark (http_client )
439- return co_wrap ( function ()
439+ return function ()
440440 http_client .keepalive_ready = true
441- end )
441+ end
442442end
443443
444444local function _reader_keepalive_ready_no_op ()
445- return co_wrap ( function () end )
445+ return function () end
446446end
447447
448448
@@ -830,13 +830,15 @@ function _M.read_response(self, params)
830830 local trailer_reader
831831 local has_body = false
832832 local has_trailer = false
833- -- If there are no trailers - fully reading response body means socket is ready to be pooled
834- local body_reader_keepalive_ready_callback = _reader_keepalive_ready_mark (self )
833+ local body_reader_keepalive_ready_callback
835834
836835 if res_headers [" Trailer" ] then
837836 has_trailer = true
838837 -- If there are trailers - fully reading response body doesn't mean socket is ready to be pooled
839838 body_reader_keepalive_ready_callback = _reader_keepalive_ready_no_op ()
839+ else
840+ -- If there are no trailers - fully reading response body means socket is ready to be pooled
841+ body_reader_keepalive_ready_callback = _reader_keepalive_ready_mark (self )
840842 end
841843
842844 -- Receive the body_reader
You can’t perform that action at this time.
0 commit comments