[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] setStatus() vs. sendError(), custom error feedback

Thanks Thomas,

so it may be that this bug, or problem, is indeed related to Jetty 6.
I haven't done any testing with Jetty 7 for myself; if I'll do, I'll
let you know.

Christian
___________________________

On Wed, Apr 25, 2012 at 1:38 PM, Thomas Becker <tbecker@xxxxxxxxxxx> wrote:
> Hi Greg, Christian,
>
> I've written a test to reproduce the errornous behaviour. But it seems like
> that with the current GzipFilter code compressedOutputStream is not assigned
> before the decision is made to compress and therefore the doCompress()
> method is called. So the current code won't throw that IllegalStateException
> and instead will just work and do not compress status codes > 300.
>
> I've found no evident reason why we don't compress status codes > 300. But
> it also doesn't do any harm, so I don't think we urgently need to change
> that. Let me know if you think we should.
>
> See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=377613 for details.
>
> Cheers,
> Thomas
>
>
> On Wed Apr 25 00:38:57 2012, Christian Grün wrote:
>>
>> On Wed, Apr 25, 2012 at 12:23 AM, Greg Wilkins<gregw@xxxxxxxxxxx>  wrote:
>>>
>>> I believe we can fix this, but it will not be fixed in jetty-6.
>>>
>>> However, the other thing you can try is to call resetBuffer just
>>> before setting the status and then get the outputStream again (which I
>>> think you do anyway).
>>
>>
>> ..great, thanks for the hint! Resetting the buffer seems to resolve
>> the issue. I'll keep you updated if I should stumble upon any other
>> issue.
>>
>> Christian
>> ___________________________________
>>
>>> On 24 April 2012 23:39, Christian Grün<christian.gruen@xxxxxxxxx>  wrote:
>>>>>
>>>>> But it should be able to be made work by making sure you set the
>>>>> status before you call getOutputStream or getWriter.  The ISE
>>>>> indicates that one of these methods has been called before the
>>>>> setStatus, so the filter has decided that it will compress, but then
>>>>> the setStatus contradicts that.
>>>>
>>>>
>>>> Thanks for the details. True, we are requesting the output stream
>>>> reference first in order to attach it to our query processor (which
>>>> then throws an error, as the query cannot be evaluated). As this can
>>>> hardly be changed in our architecture, as we'd have to extend our
>>>> APIs, we'll probably keep gzip compression deactivated for now.
>>>>
>>>> If you think this could be fixed, though.. Even better!
>>>> Christian
>>>>
>>>>> _______________________________________________
>>>>> jetty-dev mailing list
>>>>> jetty-dev@xxxxxxxxxxx
>>>>> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>>>>
>>>> _______________________________________________
>>>> jetty-dev mailing list
>>>> jetty-dev@xxxxxxxxxxx
>>>> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>>>
>>> _______________________________________________
>>> jetty-dev mailing list
>>> jetty-dev@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>>
>> _______________________________________________
>> jetty-dev mailing list
>> jetty-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>
>
> --
> thomas becker
> tbecker@xxxxxxxxxxx
>
> http://webtide.com / http://intalio.com
> (the folks behind jetty and cometd)