You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Michael Weiser <mw...@fachschaft.imn.htwk-leipzig.de> on 2002/08/12 14:05:31 UTC

server push CGI problem

Hi,

I've got an update problem regarding apache 1.3.24/2.0.39 and a home-grown
server-push webcam CGI. The CGI continuously reads images from the cam,
compresses them into JPEGs and puts them together into a
multipart/x-mixed-replace stream to produce a poor-man's video with
netscape-browsers.

With apache-1.3.x the CGI detected that the connection to the browser was
closed by getting an error back when writing to standard output because
apache automatically closed down the pipe to the CGI as well.

Now after upgrading to apache-2.0.39 the cgi never gets the error and
therefore never stops delivering pictures to nowhere. My guess is that
apache tries to discard all remaining script output by reading until EOF
before closing the pipe which in my case results in the script carrying on
forever.

I've tried to install the script as nph- but that resulted in the browser
showing the data literally because it somehow got the MIME type wrong/not
at all.

Now my questions are:
Is my guess regarding the discard of remaining output right?
Can it be switched off?
How can I get the nph- approach get to work properly?

Thanks in advance for your help.
-- 
bye, Micha



Re: server push CGI problem

Posted by Michael Weiser <mw...@fachschaft.imn.htwk-leipzig.de>.
On Mon, 12 Aug 2002, Justin Erenkrantz wrote:

> > I've got an update problem regarding apache 1.3.24/2.0.39 and a home-grown
> > server-push webcam CGI. The CGI continuously reads images from the cam,
> Can you try 2.0.40 as I believe some of the CGI handling was been
> rewritten since .39?
>
> So, this already may have been resolved.  -- justin
I just did - without any effect. The normal CGI still continues to run
after the connection to the browser has been closed with apache reading
and discarding its output. The nph- variant doesn't seem to give a
mime-type at all so that mozilla tries to download it as
application/octet-stream and navigator 4.79 is showing the
output literally.

If someone could point me at the piece of source to look for that
output-discarding I could start hacking about myself. I found something in
mod_cgi.c already but that seems to apply to redirects only. The output
discard after connection break seems to happen at the end of the filter
stack.

If it's of any relevance to the problem: The whole thing is running on an
SGI Indigo2 with IRIX 6.5.16f and was compiled using MIPSpro cc 7.2.3.1
and linked against various precompiled open source libs from
freeware.sgi.com. (without any problems BTW)
-- 
bye, Micha


Re: server push CGI problem

Posted by Justin Erenkrantz <je...@apache.org>.
On Mon, Aug 12, 2002 at 02:05:31PM +0200, Michael Weiser wrote:
> Hi,
> 
> I've got an update problem regarding apache 1.3.24/2.0.39 and a home-grown
> server-push webcam CGI. The CGI continuously reads images from the cam,

Can you try 2.0.40 as I believe some of the CGI handling was been
rewritten since .39?

So, this already may have been resolved.  -- justin