Stas Bekman <[EMAIL PROTECTED]> 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 http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html