Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 23667 invoked from network); 17 Jan 2004 03:50:52 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 17 Jan 2004 03:50:52 -0000 Received: (qmail 79619 invoked by uid 500); 17 Jan 2004 03:50:20 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 79605 invoked by uid 500); 17 Jan 2004 03:50:20 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 79592 invoked from network); 17 Jan 2004 03:50:20 -0000 Message-ID: <4008B103.8090708@stason.org> Date: Fri, 16 Jan 2004 19:50:27 -0800 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031010 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: Joe Schaefer Cc: modperl@perl.apache.org Subject: Re: File uploads using Apache:;request in mod_perl2 References: <20040116090746.0BAE131CEEF@popcornwd.demon.co.uk> <873cafiuo0.fsf@gemini.sunstarsys.com> <4008383A.4060804@modperlcookbook.org> <87u12vhdgi.fsf@gemini.sunstarsys.com> <4008980B.1070908@stason.org> <87llo7gvgx.fsf@gemini.sunstarsys.com> <4008A4C2.6050106@stason.org> <87hdyvgt58.fsf@gemini.sunstarsys.com> <4008AD40.7070209@stason.org> <87d69jgs4t.fsf@gemini.sunstarsys.com> In-Reply-To: <87d69jgs4t.fsf@gemini.sunstarsys.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Joe Schaefer wrote: > Stas Bekman writes: > > [...] > > >>You need the filehandle only if you use the temp file. In which case >>bbs are irrelevant. If you use slurp then there is are no >>filehandles. I think these are orthogonal. > > > Agreed- my earlier +1 was for both adding a slurp() method and > marking the output as tainted. Understood. So since we are designing a new interface. Would it make sense to have slurp() accept an optional argument limiting the size of the data it's going to slurp? I mean the MAX_POST_DATA (or whatever it is) limit is all good, but since for big data we mainly use temp files MAX_POST_DATA, we may want to say upload->slurp(2**14) or die "the input is too big"; actually, I'm having another idea on slurp. Since it smells too read()-like. One could have an APREQ::PerlIO layer and having upload return that filehandle opened through that layer (like APR::PerlIO or Apache::PerlIO do). Now you could transparently do temp files or inmemory uploads, giving the user the good old read() API. You can even support seek/tell to make things fancier. Of course this will require perl 5.8 compiled with perlio. If you have that in place, you need no slurp. You do 'local $/ + read' and you get slurp. Or may be it's too much work when implementing slurp should be a few lines of C code ;) __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:stas@stason.org 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