Skip to content

Commit e6ca3a7

Browse files
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)