Commits

Sylvain Hellegouarch committed 1a6a501

added __iter__ and next methods to SizeCheckWrapper

Comments (0)

Files changed (1)

cherrypy/_cpwsgiserver.py

     def close(self):
         self.rfile.close()
 
+    def __iter__(self):
+        return self.rfile
+
+    def next(self):
+        data = self.rfile.next()
+        self.bytes_read += len(data)
+        try:
+            self._check_length()
+        except:
+            raise StopIteration()
+        return data
 
 class HTTPRequest(object):
     def __init__(self, socket, addr, server):