Permalink
Browse files

Merge remote-tracking branch 'ei-grad/master'

  • Loading branch information...
2 parents f41306d + b8e4466 commit 227becd6d12cb5646f7fc8036e1e3faec6d9f408 @bdarnell bdarnell committed May 26, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 tornado/iostream.py
View
@@ -192,7 +192,11 @@ def write(self, data, callback=None):
if data:
# We use bool(_write_buffer) as a proxy for write_buffer_size>0,
# so never put empty strings in the buffer.
- self._write_buffer.append(data)
+ if len(data) > 128*1024:
+ for i in range(0, len(data), 128*1024):
+ self._write_buffer.append(data[i:i+128*1024])
+ else:
+ self._write_buffer.append(data)
self._write_callback = stack_context.wrap(callback)
self._handle_write()
if self._write_buffer:

0 comments on commit 227becd

Please sign in to comment.