Re: fastcgi echo hangs if called via form

Sonya Rikhtverchik (
Thu, 25 Sep 1997 10:50:49 -0400

Message-Id: <>
Subject: Re: fastcgi echo hangs if called via form
Date: Thu, 25 Sep 1997 10:50:49 -0400
From: Sonya Rikhtverchik <>

From: (Kelly Carney)
Message-Id: <9709250405.AA08862@gomer>
Subject: Re: fastcgi echo hangs if called via form
To: (Stanley Gambarin)
Date: Wed, 24 Sep 1997 22:05:47 -0600 (MDT)
In-Reply-To: <Pine.GSO.3.96.970924131207.20000C-100000@csa>
 from "Stanley 
Gambarin" at Sep 24, 97 01:17:17 pm
X-Mailer: ELM [version 2.4 PL23]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

> > 
> > A problem I've just found with our fastcgi script involves when the 
> > REQUEST_METHOD is POST. For some reason there is no CONTENT_LENGTH 
> > passed to the script(I'm still looking into it). When it does the read 
> > the length is 0 so nothing is read to get variables to pass to the 
> > script. We're able to work around that with a default page, but this 
> > could be a possibility to look at.
> > 
> 	This could be a potential problem.. if there is no
> Content-length header passed, then the application has no idea
> how much input to expect.  Ideally it would just soak up all
> the input until there is no more left, but I am not sure if 
> that is what we do right now...
> 	A sample test would be to connect to the web server 
> using telnet and issue the following command:
> POST /name/to/fcgi/app HTTP 1.0
> Content-length: xxx
> qyhetglkjfjlkjds
> where xxx is the length of the data and the rest is the data...
> unfortunately, I can not test this until tomorrow, so if someone
> want to take a whack at it and report the results..If it doesn't
> work, then there is a problem with the developer kit, but if
> it does, then its the potential problem with the browser, which
> does not setup the Content-length correctly.
> 						Stanley.

Good debug technique.  I can hang the echo program if I use this sh
script when starting it.  

- -----
#!/bin/sh -f
# Tries to connect, if fails, starts running on port 2867, and then connects
/appl/enterprise/cgi-bin/cgi-fcgi -bind -connect localhost:2867 2> /dev/null
if [ $? -ne 0 ]
   /appl/enterprise/cgi-bin/cgi-fcgi -start -connect :2867 
/appl/enterprise/cgi- bin/ctms3/echo_c
   /appl/enterprise/cgi-bin/cgi-fcgi -bind -connect localhost:2867
- -----

If I use cgi-fcgi from the 1.5.2 kit with this script, it does NOT
hang.  If I don't use a sh script with 2.0b2.1 kit, no hang.

I know, it seems the answer is - DON'T USE THE SH SCRIPT, but my
big perl application hangs with kit 2x even without the sh script.
I keep thinking if the 1.5.2 can handle the sh script, then the 2x
should too.  

Leaving for a short trip to Maine (anniversary) early tomorrow.  I'll
be hitting this again come Tuesday.  I'd like to see what I can learn
while attached to the echo program with gdb.  I stepped through some of
the code and it looked like things hung at "echo.c" line 59

                if((ch = getchar()) < 0) {  

Haven't used gdb much lately and so I'm struggling a bit with it.  It
tells me things like 'No symbol "len" in current context.' when I just
did a "next" past a line that set that value.  

I think I need this vacation.  Maybe it'll be easier when I get back!


------- End of Forwarded Message