@@ -622,9 +622,23 @@ async def _request(
622
622
get_env_proxy_for_url , url
623
623
)
624
624
625
+ response_params = {
626
+ "timer" : timer ,
627
+ "skip_payload" : method in EMPTY_BODY_METHODS ,
628
+ "read_until_eof" : read_until_eof ,
629
+ "auto_decompress" : auto_decompress ,
630
+ "read_timeout" : real_timeout .sock_read ,
631
+ "read_bufsize" : read_bufsize ,
632
+ "timeout_ceil_threshold" : self ._connector ._timeout_ceil_threshold ,
633
+ "max_line_size" : max_line_size ,
634
+ "max_field_size" : max_field_size ,
635
+ }
636
+
625
637
req = self ._request_class (
626
638
method ,
627
639
url ,
640
+ response_params = response_params ,
641
+ timeout = real_timeout ,
628
642
params = params ,
629
643
headers = headers ,
630
644
skip_auto_headers = skip_headers ,
@@ -656,25 +670,15 @@ async def _connect_and_send_request(
656
670
assert self ._connector is not None
657
671
try :
658
672
conn = await self ._connector .connect (
659
- req , traces = traces , timeout = real_timeout
673
+ req , traces = traces , timeout = req . _timeout
660
674
)
661
675
except asyncio .TimeoutError as exc :
662
676
raise ConnectionTimeoutError (
663
677
f"Connection timeout to host { req .url } "
664
678
) from exc
665
679
666
680
assert conn .protocol is not None
667
- conn .protocol .set_response_params (
668
- timer = timer ,
669
- skip_payload = req .method in EMPTY_BODY_METHODS ,
670
- read_until_eof = read_until_eof ,
671
- auto_decompress = auto_decompress ,
672
- read_timeout = real_timeout .sock_read ,
673
- read_bufsize = read_bufsize ,
674
- timeout_ceil_threshold = self ._connector ._timeout_ceil_threshold ,
675
- max_line_size = max_line_size ,
676
- max_field_size = max_field_size ,
677
- )
681
+ conn .protocol .set_response_params (** req ._response_params )
678
682
try :
679
683
resp = await req .send (conn )
680
684
try :
0 commit comments