File tree 3 files changed +15
-12
lines changed
3 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -203,21 +203,22 @@ async def complete_pending(self) -> None:
203
203
if not self .pending_response :
204
204
return
205
205
206
- timeout = self .conn .gettimeout
207
206
if _csot .get_timeout ():
208
207
deadline = min (_csot .get_deadline (), self .pending_deadline )
209
- elif timeout is not None :
210
- deadline = min (time .monotonic () + timeout , self .pending_deadline )
211
208
else :
212
- deadline = self .pending_deadline
209
+ timeout = self .conn .gettimeout
210
+ if timeout is not None :
211
+ deadline = min (time .monotonic () + timeout , self .pending_deadline )
212
+ else :
213
+ deadline = self .pending_deadline
213
214
214
215
if not _IS_SYNC :
215
216
# In async the reader task reads the whole message at once.
216
217
# TODO: respect deadline
217
218
await self .receive_message (None , True )
218
219
else :
219
220
try :
220
- network_layer .receive_data (self , self .pending_bytes , deadline ) # type:ignore[call- arg]
221
+ network_layer .receive_data (self , self .pending_bytes , deadline ) # type:ignore[arg-type ]
221
222
except BaseException as error :
222
223
await self ._raise_connection_failure (error )
223
224
self .pending_response = False
Original file line number Diff line number Diff line change @@ -338,7 +338,7 @@ def receive_data(
338
338
# When the timeout has expired we perform one final non-blocking recv.
339
339
# This helps avoid spurious timeouts when the response is actually already
340
340
# buffered on the client.
341
- orig_timeout = conn .conn .gettimeout ()
341
+ orig_timeout = conn .conn .gettimeout
342
342
try :
343
343
while bytes_read < length :
344
344
try :
@@ -444,6 +444,7 @@ class NetworkingInterface(NetworkingInterfaceBase):
444
444
def __init__ (self , conn : Union [socket .socket , _sslConn ]):
445
445
super ().__init__ (conn )
446
446
447
+ @property
447
448
def gettimeout (self ) -> float | None :
448
449
return self .conn .gettimeout ()
449
450
@@ -758,7 +759,7 @@ def receive_message(
758
759
if _csot .get_timeout ():
759
760
deadline = _csot .get_deadline ()
760
761
else :
761
- timeout = conn .conn .gettimeout ()
762
+ timeout = conn .conn .gettimeout
762
763
if timeout :
763
764
deadline = time .monotonic () + timeout
764
765
else :
Original file line number Diff line number Diff line change @@ -203,21 +203,22 @@ def complete_pending(self) -> None:
203
203
if not self .pending_response :
204
204
return
205
205
206
- timeout = self .conn .gettimeout
207
206
if _csot .get_timeout ():
208
207
deadline = min (_csot .get_deadline (), self .pending_deadline )
209
- elif timeout is not None :
210
- deadline = min (time .monotonic () + timeout , self .pending_deadline )
211
208
else :
212
- deadline = self .pending_deadline
209
+ timeout = self .conn .gettimeout
210
+ if timeout is not None :
211
+ deadline = min (time .monotonic () + timeout , self .pending_deadline )
212
+ else :
213
+ deadline = self .pending_deadline
213
214
214
215
if not _IS_SYNC :
215
216
# In async the reader task reads the whole message at once.
216
217
# TODO: respect deadline
217
218
self .receive_message (None , True )
218
219
else :
219
220
try :
220
- network_layer .receive_data (self , self .pending_bytes , deadline ) # type:ignore[call- arg]
221
+ network_layer .receive_data (self , self .pending_bytes , deadline ) # type:ignore[arg-type ]
221
222
except BaseException as error :
222
223
self ._raise_connection_failure (error )
223
224
self .pending_response = False
You can’t perform that action at this time.
0 commit comments