Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

disable OutputBuffer filtering

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


pivo at pobox

Nov 1, 2009, 12:00 PM

Post #1 of 1 (260 views)
Permalink
disable OutputBuffer filtering

Hi,

I want to have a directory with file serving throttled to emulate a slow
connection for site debugging purposes. Is there an obvious solution i haven't
thought about? This is what i managed to come up with so far:

ExtFilterDefine slowdown mode=output cmd=/var/www/slow/slowCat
preservescontentlength
<Location /slow/>
SetOutputFilter slowdown
</Location>

The slowCat is a short program (written in haskell) which disables buffering and
pipes data from stdin to stdout, chracter by character, with a tiny sleep after
each character. When i try it in the shell, it works just right.

I would expect the server to send the data piecemeal to the client (and the
client to parse the data node by node, web browsers do that), but what happens
instead is a long delay and then the data arriving in a single burst. My
conclusion is that apache is buffering the data somewhere. What am i doing
wrond, is there any solution to this problem?

Any help much appreciated
Ivan Vadovic

The slowCat appears to work right and looks like this:

import System.Posix
import System.IO
import System.IO.Error

main :: IO ()
main = do hSetBuffering stdout NoBuffering
hSetBuffering stdin NoBuffering
try copy
return ()

copy :: IO ()
copy = getChar >>= putChar >> usleep (10 ^ 4) >> copy

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd
" from the digest: users-digest-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.