[Zope-dev] danger: FCGIServer.py rev 1.5 breaks fastcgi for me.

Phillip J. Eby pje@telecommunity.com
Mon, 29 Nov 1999 10:49:36 -0500


At 11:49 AM 11/29/99 +1100, Anthony Baxter wrote:
>I'm running Zope on a Linux box (redhat 5.2) and have
>mod_fastcgi_SNAP_Oct06 compiled into Apache 1.3.9 on
>a Solaris x86 box. This patch, from FCGIServer.py r1.4 to r1.5
>utterly breaks FCGI support. Any attempt to connect via FCGI
>makes zope go into an infinite loop, gobbling up memory.

I think I know what the problem is, and it's my fault.  What's probably
happening is that it's trying to launch two publishers on the same request,
due to the STDIN record(s).  Would you try out the patch below and tell me
if that fixes it?  Please try some POST requests as well as GET requests.
Thanks, and my apologies for the inconvenience.  I sent in a patch that
fixed my problem, but I didn't code it properly for the "correct" case.


Index: FCGIServer.py
===================================================================
RCS file: /cvs-repository/Zope2/ZServer/FCGIServer.py,v
retrieving revision 1.5
diff -u -r1.5 FCGIServer.py
--- FCGIServer.py       1999/11/22 14:48:07     1.5
+++ FCGIServer.py       1999/11/29 15:42:58
@@ -439,6 +439,9 @@
 
         # read some stdin data
         elif rec.recType == FCGI_STDIN:
+            if self.remainingRecs <= 0: # prevent re-entry
+                self.setInitialState()
+                return
             if rec.contentLength == 0:  # end of the stream
                 self.remainingRecs = self.remainingRecs - 1
             else: