Re: WebResponse ContentLength > 2G

2010-06-15 Thread Jeremy Thomerson
I wonder - would there be any problem just changing that to *always* set the
header to Long.toString(foo)?

On Tue, Jun 15, 2010 at 12:57 PM, Igor Vaynberg wrote:

> yes, and attach your fix.
>
> -igor
>
> On Tue, Jun 15, 2010 at 10:47 AM, Louis Letourneau
>  wrote:
> > I'm trying to send a file >2G using ResourceStreamRequestTarget +
> > FileResourceStream, but the content-type is always set to a big negative
> > value typical of a long(>2G) to int conversion.
> > This is non-standard and the proxy we use refuses it (most browser just
> > ignore it, but the RFC states that the value must be >0).
> >
> > After looking deeper in the code I see that, in wicket, longs are used
> > for the content length across the board, but when this is transfered to
> > a HttpServletResponse there is an (int) cast.
> >
> > Shouldn't wicket use ints to remove the confusion, or if not (and I
> > think this is the best course), shouldn't a test be made
> > if > Integer.MAX_VALUE
> >  httpServletResponse.addHeader("Content-Length", Long.toString(length));
> >
> > instead
> > ?
> >
> > I tried the last approach overriding newWebResponse on WebApplication
> > with my custom WebResponse and it fixed my problem.
> >
> > Should I open a bug?
> >
> > Thanks
> > Louis
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Jeremy Thomerson
http://www.wickettraining.com


Re: WebResponse ContentLength > 2G

2010-06-15 Thread Jeremy Thomerson
On Tue, Jun 15, 2010 at 12:47 PM, Louis Letourneau <
louis.letourn...@mail.mcgill.ca> wrote:

> I'm trying to send a file >2G using ResourceStreamRequestTarget +
> FileResourceStream, but the content-type is always set to a big negative
> value typical of a long(>2G) to int conversion.
> This is non-standard and the proxy we use refuses it (most browser just
> ignore it, but the RFC states that the value must be >0).
>
> After looking deeper in the code I see that, in wicket, longs are used
> for the content length across the board, but when this is transfered to
> a HttpServletResponse there is an (int) cast.
>
> Shouldn't wicket use ints to remove the confusion, or if not (and I
> think this is the best course), shouldn't a test be made
> if > Integer.MAX_VALUE
>  httpServletResponse.addHeader("Content-Length", Long.toString(length));
>
> instead
> ?
>
> I tried the last approach overriding newWebResponse on WebApplication
> with my custom WebResponse and it fixed my problem.
>
> Should I open a bug?
>
> Thanks
> Louis
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
yes, please open a jira

-- 
Jeremy Thomerson
http://www.wickettraining.com


Re: WebResponse ContentLength > 2G

2010-06-15 Thread Igor Vaynberg
yes, and attach your fix.

-igor

On Tue, Jun 15, 2010 at 10:47 AM, Louis Letourneau
 wrote:
> I'm trying to send a file >2G using ResourceStreamRequestTarget +
> FileResourceStream, but the content-type is always set to a big negative
> value typical of a long(>2G) to int conversion.
> This is non-standard and the proxy we use refuses it (most browser just
> ignore it, but the RFC states that the value must be >0).
>
> After looking deeper in the code I see that, in wicket, longs are used
> for the content length across the board, but when this is transfered to
> a HttpServletResponse there is an (int) cast.
>
> Shouldn't wicket use ints to remove the confusion, or if not (and I
> think this is the best course), shouldn't a test be made
> if > Integer.MAX_VALUE
>  httpServletResponse.addHeader("Content-Length", Long.toString(length));
>
> instead
> ?
>
> I tried the last approach overriding newWebResponse on WebApplication
> with my custom WebResponse and it fixed my problem.
>
> Should I open a bug?
>
> Thanks
> Louis
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



WebResponse ContentLength > 2G

2010-06-15 Thread Louis Letourneau
I'm trying to send a file >2G using ResourceStreamRequestTarget +
FileResourceStream, but the content-type is always set to a big negative
value typical of a long(>2G) to int conversion.
This is non-standard and the proxy we use refuses it (most browser just
ignore it, but the RFC states that the value must be >0).

After looking deeper in the code I see that, in wicket, longs are used
for the content length across the board, but when this is transfered to
a HttpServletResponse there is an (int) cast.

Shouldn't wicket use ints to remove the confusion, or if not (and I
think this is the best course), shouldn't a test be made
if > Integer.MAX_VALUE
  httpServletResponse.addHeader("Content-Length", Long.toString(length));

instead
?

I tried the last approach overriding newWebResponse on WebApplication
with my custom WebResponse and it fixed my problem.

Should I open a bug?

Thanks
Louis

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org