in reply to Re: incomplete cgi output
in thread incomplete cgi output

Did your CGI-script end with an error? What does the Apache error log show? Is your script very slow (in other words does it run for a long time before finishing the file)?

Hey! Thanks for responding. The cgi script runs fine on its own (i.e. no errors or anything, I use strict and warnings, and the output is valid if I echo from stdout to a file and check it out). The error log doesn't show anything. The only thing I can think of is that the script is indeed kind of slow - depending on the user's settings it may take up to a few seconds to process. When I try it out so that it creates small output (a few hundred lines) it usually works fine (also no errors).

Replies are listed 'Best First'.
Re: Re: Re: incomplete cgi output
by CountZero (Bishop) on Feb 06, 2004 at 06:51 UTC
    A "few seconds" should be OK for Apache, unless the time-out value has been set extremely low. I have written scripts which perhaps take 10 seconds or more to conclude without problems (other than users repeatedly hitting the refresh button -- impatient lot they are).

    Did you check whether the script really stopped prematurely or whether it was something else that caused it to fail to send all its output to the client? Perhaps if you simultaneously print some debug info to a file (such as a number or timestamp every x lines printed), you can see whether the "break" is in the script (the script did not ran all the way to the end) or somewhere else (the script did ran all the way, but Apache choked on its output halfway through).

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      I made a silly booboo: a for loop that walks its way through a multidimensional array got annoyed with undefined rows. I fixed it. Thanks for your input though.