[Checkins] SVN: zc.ngi/trunk/ Fixed

jim cvs-admin at zope.org
Fri Apr 6 17:09:01 UTC 2012


Log message for revision 125008:
  Fixed
    Sending data faster than a socket could transmit it wasn't handled
    correctly.
  

Changed:
  U   zc.ngi/trunk/README.txt
  U   zc.ngi/trunk/src/zc/ngi/async.py
  U   zc.ngi/trunk/src/zc/ngi/async.test

-=-
Modified: zc.ngi/trunk/README.txt
===================================================================
--- zc.ngi/trunk/README.txt	2012-04-06 15:29:14 UTC (rev 125007)
+++ zc.ngi/trunk/README.txt	2012-04-06 17:08:57 UTC (rev 125008)
@@ -20,6 +20,15 @@
 *******
 
 ====================
+2.0.1 (2012-04-06)
+====================
+
+Bugs Fixed
+
+- Sending data faster than a socket could transmit it wasn't handled
+  correctly.
+
+====================
 2.0.0 (2011-12-10)
 ====================
 

Modified: zc.ngi/trunk/src/zc/ngi/async.py
===================================================================
--- zc.ngi/trunk/src/zc/ngi/async.py	2012-04-06 15:29:14 UTC (rev 125007)
+++ zc.ngi/trunk/src/zc/ngi/async.py	2012-04-06 17:08:57 UTC (rev 125008)
@@ -397,7 +397,7 @@
                     return # can't send any more
         finally:
             if nsend:
-                self.output[0:0] = tosend
+                output[0:0] = tosend
 
 
     def handle_close(self, reason='end of input'):

Modified: zc.ngi/trunk/src/zc/ngi/async.test
===================================================================
--- zc.ngi/trunk/src/zc/ngi/async.test	2012-04-06 15:29:14 UTC (rev 125007)
+++ zc.ngi/trunk/src/zc/ngi/async.test	2012-04-06 17:08:57 UTC (rev 125008)
@@ -47,15 +47,23 @@
     >>> _ = [thread.start() for thread in threads]
     >>> _ = [thread.join() for thread in threads]
 
+Large input
+===========
+
+    >>> import zc.ngi.blocking
+    >>> output, input = zc.ngi.blocking.open(addr, zc.ngi.async.connect,
+    ...                                      timeout=1.0)
+
+    >>> output.write('hello world\n' * 20000 + '\0')
+    >>> input.readline(timeout=1.0)
+    '20000 40000 240000\n'
+
 Iterable input
 ==============
 
 We can pass data to the server using an iterator.  To illustrate this,
 we'll use the blocking interface:
 
-    >>> import zc.ngi.blocking
-    >>> output, input = zc.ngi.blocking.open(addr, zc.ngi.async.connect,
-    ...                                      timeout=1.0)
     >>> def hello(name):
     ...     yield "hello\n"
     ...     yield name



More information about the checkins mailing list