I am attempting to provide live parsing of the file upload in CGI and show the information on the watch's screen as it is being submitted.

However, Apache2 appears to wish to wait for a full Publish to accomplish before delivering the CGI application anything whatsoever.

How do i pressure Apache2 to prevent loading the Publish to my CGI application?


It seems it's really the creation of the CGI that's being buffered. I began streaming the information to some temp file to look at it's progress. That, and that i have one other issue.

1) The output has been buffered. I have attempted SetEnvIf (and just SetEnv) for "!nogzip", "nogzip", and "!gzip" with no success (inside the CGI Directory definition).

2) Apache2 seems not to be reading through the CGI's output before the CGI process exits? I observe that my CGI application (eliminating or otherwise) is hanging up permanently on the "fwrite(..., stdout)" line around 80K.


Okay, Opera is playing beside me. Basically send a 150K file, plus there is no CGI lockup around 80K. When the file is 2G, plus there is a lockup. So, Opera isn't reading through the output in the server while it's attempting to send the file... can there be any header or alternate content type to alter that behavior?


Okay, I guess the CGI output lockup on large files is not important really. I don't have to echo the file! I am debugging an issue triggered by debugging helps. :)

I suppose this is effective enough then. Thanks!


Just like an email... the main reason I figured Apache2 was loading input was which i always got a "Content-Length" atmosphere variable. I suppose Opera is wise enough to precalculate this content period of a multipart form upload and Apache2 was passing that on. I figured Apache2 was loading the input and confirming the space itself.

Are you certain it is the input being buffered this is the problem? Output loading troubles are a lot more common, and is probably not distinguishable from input loading, in case your approach to debugging is one thing like just print​ing towards the response.

(Output loading is generally triggered either by unflushed stdout within the script or by filters. The typical reason may be the DEFLATE filter, that is frequently accustomed to compress all text/ reactions, whether or not they originate from a static file or perhaps a script. Generally it's wise to compress the creation of scripts, but a side-effect it that it'll make the reaction to be fully buffered. If you want immediate response, you will need to power it down for your one script or all scripts, by restricting the use of AddOutputFilterByType to specific <Directory>​s, or using mod_setenvif to create the !nogzip note.)

Similarly, a port filter (including, again DEFLATE) could potentially cause CGI input to become buffered, if you are using any. But they are less broadly-used.

Edit: for the time being, just comment out any httpd conf you've enabling the deflate filter. Place the it back selectively once you are happy that the IO is unbuffered without them.

I observe that my CGI application (eliminating or otherwise) is hanging up permanently on the "fwrite(..., stdout)" line around 80K.

Yeah... should you haven't read all of your input, you are able to deadlock when attempting to create output, should you write an excessive amount of. You are able to block with an output call, awaiting the network buffers to unclog so that you can send the brand new data you have, however they won't since the browser is attempting to transmit its data before it will begin to browse the output.

What exactly are you focusing on here? Generally it does not seem sensible to create progress-info output in reaction to some direct form Publish, because browsers typically will not display it. If you wish to provide upload-progress feedback on the plain HTML form submission, normally, this is completed with hacks like getting an AJAX connection return to determine the way the upload is certainly going (meaning progress information needs to be shared, eg. inside a database), or utilizing a Expensive upload component.