Skip to content

Commit e6ca3a7

Browse files
author
Paul Sokolovsky
committed
asyncio_micro: awrite(): More logging and checks.
1 parent 889c546 commit e6ca3a7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

asyncio_micro/asyncio_micro.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ def awrite(self, buf):
224224
# to return immediately (which means it has to buffer all the
225225
# data), this method is a coroutine.
226226
sz = len(buf)
227+
log.debug("StreamWriter.awrite(): spooling %d bytes", sz)
227228
while True:
228229
res = self.s.write(buf)
229230
# If we spooled everything, return immediately
@@ -233,6 +234,7 @@ def awrite(self, buf):
233234
if res is None:
234235
res = 0
235236
log.debug("StreamWriter.awrite(): spooled partial %d bytes", res)
237+
assert res < sz
236238
buf = buf[res:]
237239
sz -= res
238240
s = yield IOWrite(self.s)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy