users@grizzly.java.net

Re: 100MB uploads

From: Jon Brisbin <jon_at_jbrisbin.com>
Date: Fri, 22 Jul 2011 15:55:25 -0500 (CDT)

Ok, cool. I think I can avoid a buffer copy by doing this as well (I'm using in.read(byte[]) now)...

Thanks!

Jon Brisbin
http//jbrisbin.com

----- Original Message -----

> From: "Oleksiy Stashok" <oleksiy.stashok_at_oracle.com>
> To: users_at_grizzly.java.net
> Sent: Friday, July 22, 2011 3:30:37 PM
> Subject: Re: 100MB uploads

> On 07/22/2011 10:03 PM, Jon Brisbin wrote:
> > I did happen to notice this in your upload sample:
>

> > } finally {
>
> > // restore ByteBuffer old position, cause we don't know how it
>
> > // correlates with parent Buffer position (depends on Buffer
> > implementation)
>
> > byteBuffer.position(oldPos);
>
> > // Skip number of written bytes
>
> > in.skip(written);
>
> > }
>

> > Why is this needed? Should I be doing this as well?
>

> Depends how you work with NIOInputStream. In my sample I work
> directly with NIOInputStream's Buffer, so to make sure I don't break
> it or leave NIOInputStream in inconsistent state, I restore the
> original Buffer position and call skip() with number of bytes I've
> already processed.

> WBR,
> Alexey.

> > Thanks!
>

> > Jon Brisbin
>
> > http//jbrisbin.com
>

> > ----- Original Message -----
>

> > > From: "Oleksiy Stashok" <oleksiy.stashok_at_oracle.com>
> >
>
> > > To: users_at_grizzly.java.net
> >
>
> > > Sent: Friday, July 22, 2011 4:05:13 AM
> >
>
> > > Subject: Re: 100MB uploads
> >
>

> > > Hi Jon,
> >
>

> > > using this sample [1] I was able to upload much bigger files. Can
> > > you
> > > pls. check if it works for you?
> >
>
> > > If you can modify the given sample to reproduce NPE - it would
> > > also
> > > help.
> >
>

> > > Thanks.
> >
>

> > > Alexey.
> >
>

> > > [1]
> > > http://java.net/projects/grizzly/sources/git/content/samples/http-server-samples/src/main/java/org/glassfish/grizzly/samples/httpserver/nonblockinghandler/UploadHttpHandlerSample.java
> >
>

> > > On 07/22/2011 01:46 AM, Jon Brisbin wrote:
> >
>
> > > > Looks like Grizzly isn't letting me do 100MB uploads to my REST
> > > > service. How do I increase the limits to allow this size of an
> > > > upload? I tried setting the maxPostSize to 100MB and it
> > > > something
> > > > is
> > > > still causing me to get an NPE in my handler code because the
> > > > inputBuffer in the request is NULL (as are most of the
> > > > properties
> > > > on
> > > > the Request...kinda weird).
> > >
> >
>

> > > > Thanks!
> > >
> >
>

> > > > Jon Brisbin
> > >
> >
>
> > > > http//jbrisbin.com
> > >
> >
>