mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
[3.12] gh-114077: Fix OverflowError in socket.sendfile() when pass count >2GiB (GH-114079) (GH-114110)
(cherry picked from commit d4dfad2aa9
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
2b025793e1
commit
045adb1ad8
2 changed files with 3 additions and 1 deletions
|
@ -382,7 +382,7 @@ class socket(_socket.socket):
|
||||||
if timeout and not selector_select(timeout):
|
if timeout and not selector_select(timeout):
|
||||||
raise TimeoutError('timed out')
|
raise TimeoutError('timed out')
|
||||||
if count:
|
if count:
|
||||||
blocksize = count - total_sent
|
blocksize = min(count - total_sent, blocksize)
|
||||||
if blocksize <= 0:
|
if blocksize <= 0:
|
||||||
break
|
break
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Fix possible :exc:`OverflowError` in :meth:`socket.socket.sendfile` when pass
|
||||||
|
*count* larger than 2 GiB on 32-bit platform.
|
Loading…
Add table
Add a link
Reference in a new issue