[Zope-Checkins] CVS: Zope/lib/python/ZServer - HTTPResponse.py:1.43.8.4

Chris McDonough chrism at plope.com
Sun Aug 29 19:38:44 EDT 2004


Update of /cvs-repository/Zope/lib/python/ZServer
In directory cvs.zope.org:/tmp/cvs-serv2358/lib/python/ZServer

Modified Files:
      Tag: Zope-2_7-branch
	HTTPResponse.py 
Log Message:
Don't leak a streamiterator if the RESPONSE leaks.


=== Zope/lib/python/ZServer/HTTPResponse.py 1.43.8.3 => 1.43.8.4 ===
--- Zope/lib/python/ZServer/HTTPResponse.py:1.43.8.3	Fri Jul 30 17:49:05 2004
+++ Zope/lib/python/ZServer/HTTPResponse.py	Sun Aug 29 19:38:43 2004
@@ -237,6 +237,12 @@
         self.stdout.write(str(self))
         if self._bodyproducer:
             self.stdout.write(self._bodyproducer, 0)
+        # we assign None to self._bodyproducer below to ensure that even
+        # if self is part of a cycle which causes a leak that we
+        # don't leak the bodyproducer (which often holds a reference to
+        # an open file descriptor, and leaking file descriptors can have
+        # particularly bad ramifications for a long-running process)
+        self._bodyproducer = None
 
     def setBody(self, body, title='', is_error=0, **kw):
         """ Accept either a stream iterator or a string as the body """



More information about the Zope-Checkins mailing list