httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ivan <p...@pobox.sk>
Subject [users@httpd] disable OutputBuffer filtering
Date Sun, 01 Nov 2009 20:00:42 GMT
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message