[Zope-Checkins] CVS: Zope3/lib/python/Zope/Server - chunking.py:1.1.2.3

Shane Hathaway shane@digicool.com
Wed, 28 Nov 2001 11:02:33 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/Server
In directory cvs.zope.org:/tmp/cvs-serv22466

Modified Files:
      Tag: Zope-3x-branch
	chunking.py 
Log Message:
Added tests of chunking requests and fixed implementation errors.


=== Zope3/lib/python/Zope/Server/chunking.py 1.1.2.2 => 1.1.2.3 ===
     all_chunks_received = 0
     trailer = ''
-    finished = 0
+    completed = 0
 
     # max_control_line = 1024
     # max_trailer = 65536
@@ -25,7 +25,7 @@
 
     def received(self, s):
         # Returns the number of bytes consumed.
-        if self.finished:
+        if self.completed:
             return 0
         orig_size = len(s)
         while s:
@@ -33,7 +33,7 @@
             if rm > 0:
                 # Receive the remainder of a chunk.
                 to_write = s[:rm]
-                self.buf_append(to_write)
+                self.buf.append(to_write)
                 written = len(to_write)
                 s = s[written:]
                 self.chunk_remainder -= written
@@ -69,12 +69,12 @@
                 s = self.trailer + s
                 if s[:2] == '\r\n':
                     # No trailer.
-                    self.finished = 1
+                    self.completed = 1
                     return orig_size - (len(s) - 2)
                 pos = s.find('\r\n\r\n')
                 if pos >= 0:
                     # Finished the trailer.
-                    self.finished = 1
+                    self.completed = 1
                     self.trailer = s[:pos + 2]
                     return orig_size - (len(s) - (pos + 4))
         return orig_size