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
436
436
437
437
438
438
local function _reader_keepalive_ready_mark (http_client )
439
- return co_wrap ( function ()
439
+ return function ()
440
440
http_client .keepalive_ready = true
441
- end )
441
+ end
442
442
end
443
443
444
444
local function _reader_keepalive_ready_no_op ()
445
- return co_wrap ( function () end )
445
+ return function () end
446
446
end
447
447
448
448
@@ -830,13 +830,15 @@ function _M.read_response(self, params)
830
830
local trailer_reader
831
831
local has_body = false
832
832
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
835
834
836
835
if res_headers [" Trailer" ] then
837
836
has_trailer = true
838
837
-- If there are trailers - fully reading response body doesn't mean socket is ready to be pooled
839
838
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 )
840
842
end
841
843
842
844
-- Receive the body_reader
You can’t perform that action at this time.
0 commit comments