perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: File uploads using Apache:;request in mod_perl2
Date Sat, 17 Jan 2004 02:58:10 GMT
Joe Schaefer wrote:
> Stas Bekman <> writes:
> [...]
>>It doesn't sound like a good idea. Users ain't need to mess with
>>bucket brigades, unless they really want to. If the upload is always
>>going through the temp file, why making things complex for the users?
> Exactly because it is NOT always going through a temp file.  
> Just look further upthread- this particular user doesn't
> even *want* a temp file, just the data.  Why should he need
> to make all those "open/read/write/close file" system calls 
> if he doesn't need them?

No reason to.

>>In any case it's the best to hide the internals behind an API,
>>so you can do:  
>>my $upload_data = $req->upload('file')->slurp;
>>and inside slurp you have the C API to do anything you need. How
>>does that sound? 
> That's a possibility, but I fail to see its advantage over
> APR::Brigade exposing flatten().  It is part of the C API
> after all, eh?  Why shouldn't perl programmers have access
> to it?

I'm not against adding the perl glue for APR::Brigade::flatten, quite on the 
opposite I'm all for it. All I was saying is that users don't need to know 
about the existance of APR::Brigade at all. Not only because it's an 
unnecessary information to 99.9% of users out there, but also because if 
tomorrow you decide to change the internal implementation you will be now 
stuck with dependancy on that flatten call. Hiding the details behind the 
scenes sounds like the right thing to me, but you know that already ;)

BTW, please remember that if and when you add slurp it should make the slurped 
data tainted under -T/-t. Thanks Joe.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

Reporting bugs:
Mail list info:

View raw message