Re: [Simpleweb-Support] FileAllocator and FixedConsummer
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2012-12-14 08:51:51
|
Ah well spotted, I must have missed this during a refactor. I have fixed this and will release the change.
Thanks,
Niall
--- On Thu, 13/12/12, Christophe Roudet <cr...@ac...> wrote:
> From: Christophe Roudet <cr...@ac...>
> Subject: [Simpleweb-Support] FileAllocator and FixedConsummer
> To: sim...@li...
> Received: Thursday, 13 December, 2012, 8:56 AM
> Hi,
>
> It looks like a temporary file (FileBuffer) is always
> created even if
> the request has a content length.
>
> I have modified the append() method in FixedConsummer where
> I pass the
> limit to the allocator:
>
> private void append(byte[] array, int off, int len) throws
> IOException {
> if(buffer == null) {
> buffer =
> allocator.allocate(limit); // limit added
> }
> buffer.append(array, off,
> len);
> }
>
> Then a file will be created only if the content-length
> exceeds the limit.
>
> I just wonder if this is safe?
>
> Thanks,
>
> Christophe
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT.
> Free Trial
> Remotely access PCs and mobile devices and provide instant
> support
> Improve your efficiency, and focus on delivering more
> value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> Simpleweb-Support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simpleweb-support
>
|