[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope-cvs
Subject:    [Zope-Checkins] CVS: Zope/lib/python/ZServer -
From:       Chris McDonough <chrism () plope ! com>
Date:       2004-08-29 23:38:44
Message-ID: 20040829233844.13B23203085 () mail ! zope ! org
[Download RAW message or body]

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 """

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic