summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/base_events.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2019-06-15 11:05:08 (GMT)
committerGitHub <noreply@github.com>2019-06-15 11:05:08 (GMT)
commitef2152354f03a165c5e3adb53e2276934fabd50a (patch)
tree0f47ee0a5c95a179894595feca7f04dbf67d8827 /Lib/asyncio/base_events.py
parent7efc526e5cfb929a79c192ac2dcf7eb78d3a4401 (diff)
downloadcpython-ef2152354f03a165c5e3adb53e2276934fabd50a.zip
cpython-ef2152354f03a165c5e3adb53e2276934fabd50a.tar.gz
cpython-ef2152354f03a165c5e3adb53e2276934fabd50a.tar.bz2
bpo-37279: Fix asyncio sendfile support when extra data are sent in fallback mode. (GH-14075)
Diffstat (limited to 'Lib/asyncio/base_events.py')
-rw-r--r--Lib/asyncio/base_events.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index e002539..90de858 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -861,7 +861,7 @@ class BaseEventLoop(events.AbstractEventLoop):
read = await self.run_in_executor(None, file.readinto, view)
if not read:
break # EOF
- await self.sock_sendall(sock, view)
+ await self.sock_sendall(sock, view[:read])
total_sent += read
return total_sent
finally:
@@ -1145,7 +1145,7 @@ class BaseEventLoop(events.AbstractEventLoop):
if not read:
return total_sent # EOF
await proto.drain()
- transp.write(view)
+ transp.write(view[:read])
total_sent += read
finally:
if total_sent > 0 and hasattr(file, 'seek'):