logo       

sending large files via mason: msg#00263

web.mason.user

Subject: sending large files via mason


In order to protect certain files that require a valid login cookie to get
them, I have a Mason component that checks for the cookie and sends large files
to the browser.

I use a basic read loop to send the file a bunch of chunks at a time:

open (FILE, "/some/path");
my $buf;
while (read(FILE, $buf, 16384)) {
$m->out($buf);
}
close(FILE);

I've got a front/back reverse proxy in place, but still the Apache/mod_perl
child running the component is tied up for a bit while the file is read in and
spit back out. Is there a better way to do this? I'm also running into "exit
signal Alarm clock" messages in the errorlog and incomplete file transfers when
several requests are being made; I wonder if what I'm doing is contributing to
the problem.

If you have any suggestions for better ways to "cookie-protect" a file with
Mason (or without Mason on the reverse-proxy front server), I'd love to hear
about them.

--
Jase P Wells .:. jase@xxxxxxxxx


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise