[Zope-Checkins] CVS: Zope/ZServer - FCGIServer.py:1.12.32.2 HTTPResponse.py:1.32.16.3 PCGIServer.py:1.20.32.2

Brian Lloyd brian@zope.com
Wed, 17 Apr 2002 10:27:56 -0400


Update of /cvs-repository/Zope/ZServer
In directory cvs.zope.org:/tmp/cvs-serv27321

Modified Files:
      Tag: Zope-2_4-branch
	FCGIServer.py HTTPResponse.py PCGIServer.py 
Log Message:
Backported hotfix 04-15-02


=== Zope/ZServer/FCGIServer.py 1.12.32.1 => 1.12.32.2 ===
         self.stderr.close()
 
-        # The following was adapted from PCGIPipe.finish and PCGIPipe.close
-        # I don't really understand it enough to know if I got it right...
-        shutdown = 0
-        if self.headers.get('bobo-exception-type','') == \
-                'exceptions.SystemExit':
-            r = self.headers.get('bobo-exception-value','0')
-            try: r=string.atoi(r)
-            except: r = r and 1 or 0
-            shutdown = r,
-
         if not self.channel.closed:
             self.channel.push_with_producer(LoggingProducer(self.channel,
                                                             self.stdout.length,
                                                             'log_request'), 0)
-        if shutdown:
-            sys.ZServerExitCode = shutdown[0]
+        if self._shutdownRequested():
             self.channel.push(ShutdownProducer(), 0)
             Wakeup(lambda: asyncore.close_all())
         else:


=== Zope/ZServer/HTTPResponse.py 1.32.16.2 => 1.32.16.3 ===
                 lambda t=('E', id(self._request)): apply(DebugLogger.log, t)), 0)
             if self._shutdown:
-                try: r=self._shutdown[0]
-                except: r=0
-                sys.ZServerExitCode=r
                 self._channel.push(ShutdownProducer(), 0)
                 Wakeup()
             else:
@@ -343,9 +340,6 @@
             DebugLogger.log('E', id(self._request))
 
             if self._shutdown:
-                try: r=self._shutdown[0]
-                except: r=0
-                sys.ZServerExitCode=r
                 Wakeup(lambda: asyncore.close_all())
             else:
                 Wakeup()
@@ -356,13 +350,8 @@
     def flush(self): pass # yeah, whatever
     
     def finish(self, response):
-        if response.headers.get('bobo-exception-type', '') == \
-                'exceptions.SystemExit':
-
-            r=response.headers.get('bobo-exception-value','0')
-            try: r=string.atoi(r)
-            except: r = r and 1 or 0
-            self._shutdown=r,
+        if response._shutdownRequested():
+            self._shutdown = 1
         if response.headers.get('connection','') == 'close' or \
                 response.headers.get('Connection','') == 'close':
             self._close=1


=== Zope/ZServer/PCGIServer.py 1.20.32.1 => 1.20.32.2 ===
 
             if self._shutdown:
-                try: r=self._shutdown[0]
-                except: r=0
-                sys.ZServerExitCode=r
                 self._channel.push(ShutdownProducer(), 0)
                 Wakeup(lambda: asyncore.close_all())
             else:
@@ -465,10 +462,6 @@
         self._channel=None
         
     def finish(self, response):
-        if response.headers.get('bobo-exception-type','') == \
-                'exceptions.SystemExit':
-            r=response.headers.get('bobo-exception-value','0')
-            try: r=string.atoi(r)
-            except: r = r and 1 or 0
-            self._shutdown=r,
+        if response._shutdownRequested():
+            self._shutdown = 1
         self._channel.reply_code=response.status