[Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/ZServer/HTTPServer.py - Hack around another direct usage of producer_fifo

Sidnei da Silva sidnei at enfoldsystems.com
Fri Oct 10 15:15:21 EDT 2008


Log message for revision 92023:
   - Hack around another direct usage of producer_fifo

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/ZServer/HTTPServer.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/ZServer/HTTPServer.py
===================================================================
--- Zope/branches/gsoc-python-2.5/lib/python/ZServer/HTTPServer.py	2008-10-10 19:13:31 UTC (rev 92022)
+++ Zope/branches/gsoc-python-2.5/lib/python/ZServer/HTTPServer.py	2008-10-10 19:15:21 UTC (rev 92023)
@@ -337,8 +337,16 @@
         http_channel.__init__(self, server, conn, addr)
         if isinstance(self.producer_fifo, fifo):
             self.producer_fifo_push = self.producer_fifo.push
+            self.producer_fifo_first = self.producer_fifo.first
+            self.producer_fifo_pop = self.producer_fifo.pop
         else:
             self.producer_fifo_push = self.producer_fifo.append
+            def first():
+                return self.producer_fifo[0]
+            self.producer_fifo_first = first
+            def pop():
+                del self.producer_fifo[0]
+            self.producer_fifo_pop = pop
         requestCloseOnExec(conn)
         self.queue=[]
         self.working=0
@@ -386,10 +394,10 @@
             self.current_request.channel = None # break circ refs
             self.current_request=None
         while self.producer_fifo:
-            p=self.producer_fifo.first()
+            p=self.producer_fifo_first()
             if p is not None and not isinstance(p, basestring):
                 p.more() # free up resources held by producer
-            self.producer_fifo.pop()
+            self.producer_fifo_pop()
         dispatcher.close(self)
 
     def done(self):



More information about the Checkins mailing list