Re: How to configure tomcat to ignore large websocket messages

2017-01-25 Thread Mark Thomas
On 25/01/2017 21:12, Preston Price wrote:
> So what is the purpose of a Decoder.TextStream then if not to handle
> incomplete/partial messages?

To interface with other components that wanted to process the data in
that form.

Partial messages feeding an InputStream is doable, but you need to built
it yourself / find a framework (Atmosphere?) that has already done it
for you.

Mark

> 
> Cheers!
> 
> On Wed, Jan 25, 2017 at 2:07 PM, Mark Thomas  wrote:
> 
>> On 25/01/2017 20:53, Preston Price wrote:
>>> Is it possible to use a Decoder to handle partial websocket messages?
>>
>> No. Decoders only apply to whole messages.
>>
>> The closest you will get it is:
>> - remove the message size limit
>> - use a partial message handler that buffers up to a limit
>> - discard data once the buffer limit is exceeded
>> - ignore messages that exceed the buffer
>>
>> This makes the application vulnerable to a DoS via very large messages
>> unless there is some high limit than the buffer limit enforced.
>>
>> Mark
>>
>>>
>>> On Wed, Jan 25, 2017 at 1:29 PM, Mark Thomas  wrote:
>>>
 On 25/01/2017 20:25, Preston Price wrote:
> My environment:
> java: 1.8.0_102,
> tomcat: 8.0.39,
> os:Ubuntu 4.4.0-45-generic,
> websocket api: 1.1
>
> Currently in my application clients will (rarely) send a message that
> exceeds the default (8192 byte) limit for messages. This results in the
> socket being closed by the server with a 1009 code (too big). Can
>> tomcat
 be
> configured to ignore such large messages without closing the socket?

 No.

 Mark


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


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


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



Re: How to configure tomcat to ignore large websocket messages

2017-01-25 Thread Preston Price
So what is the purpose of a Decoder.TextStream then if not to handle
incomplete/partial messages?

Cheers!

On Wed, Jan 25, 2017 at 2:07 PM, Mark Thomas  wrote:

> On 25/01/2017 20:53, Preston Price wrote:
> > Is it possible to use a Decoder to handle partial websocket messages?
>
> No. Decoders only apply to whole messages.
>
> The closest you will get it is:
> - remove the message size limit
> - use a partial message handler that buffers up to a limit
> - discard data once the buffer limit is exceeded
> - ignore messages that exceed the buffer
>
> This makes the application vulnerable to a DoS via very large messages
> unless there is some high limit than the buffer limit enforced.
>
> Mark
>
> >
> > On Wed, Jan 25, 2017 at 1:29 PM, Mark Thomas  wrote:
> >
> >> On 25/01/2017 20:25, Preston Price wrote:
> >>> My environment:
> >>> java: 1.8.0_102,
> >>> tomcat: 8.0.39,
> >>> os:Ubuntu 4.4.0-45-generic,
> >>> websocket api: 1.1
> >>>
> >>> Currently in my application clients will (rarely) send a message that
> >>> exceeds the default (8192 byte) limit for messages. This results in the
> >>> socket being closed by the server with a 1009 code (too big). Can
> tomcat
> >> be
> >>> configured to ignore such large messages without closing the socket?
> >>
> >> No.
> >>
> >> Mark
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
> >>
> >
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Preston M. Price
KidCheck
www.kidcheck.com
Facebook

 / Twitter 

-- 

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. 
If you have received this email in error please notify KidCheck at 
supp...@kidcheck.com. Please note that any views or opinions presented in 
this email are solely those of the author and do not necessarily represent 
those of KidCheck. E-mail transmission cannot be guaranteed to be secure or 
error-free as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete. Finally, the recipient should check this email 
and any attachments for the presence of viruses. KidCheck accepts no 
liability for any damage caused by any virus transmitted by this email.




Re: How to configure tomcat to ignore large websocket messages

2017-01-25 Thread Mark Thomas
On 25/01/2017 20:53, Preston Price wrote:
> Is it possible to use a Decoder to handle partial websocket messages?

No. Decoders only apply to whole messages.

The closest you will get it is:
- remove the message size limit
- use a partial message handler that buffers up to a limit
- discard data once the buffer limit is exceeded
- ignore messages that exceed the buffer

This makes the application vulnerable to a DoS via very large messages
unless there is some high limit than the buffer limit enforced.

Mark

> 
> On Wed, Jan 25, 2017 at 1:29 PM, Mark Thomas  wrote:
> 
>> On 25/01/2017 20:25, Preston Price wrote:
>>> My environment:
>>> java: 1.8.0_102,
>>> tomcat: 8.0.39,
>>> os:Ubuntu 4.4.0-45-generic,
>>> websocket api: 1.1
>>>
>>> Currently in my application clients will (rarely) send a message that
>>> exceeds the default (8192 byte) limit for messages. This results in the
>>> socket being closed by the server with a 1009 code (too big). Can tomcat
>> be
>>> configured to ignore such large messages without closing the socket?
>>
>> No.
>>
>> Mark
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
> 
> 


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



Re: How to configure tomcat to ignore large websocket messages

2017-01-25 Thread Preston Price
Is it possible to use a Decoder to handle partial websocket messages?

On Wed, Jan 25, 2017 at 1:29 PM, Mark Thomas  wrote:

> On 25/01/2017 20:25, Preston Price wrote:
> > My environment:
> > java: 1.8.0_102,
> > tomcat: 8.0.39,
> > os:Ubuntu 4.4.0-45-generic,
> > websocket api: 1.1
> >
> > Currently in my application clients will (rarely) send a message that
> > exceeds the default (8192 byte) limit for messages. This results in the
> > socket being closed by the server with a 1009 code (too big). Can tomcat
> be
> > configured to ignore such large messages without closing the socket?
>
> No.
>
> Mark
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Preston M. Price
KidCheck
www.kidcheck.com
Facebook

 / Twitter 

-- 

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. 
If you have received this email in error please notify KidCheck at 
supp...@kidcheck.com. Please note that any views or opinions presented in 
this email are solely those of the author and do not necessarily represent 
those of KidCheck. E-mail transmission cannot be guaranteed to be secure or 
error-free as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete. Finally, the recipient should check this email 
and any attachments for the presence of viruses. KidCheck accepts no 
liability for any damage caused by any virus transmitted by this email.




Re: How to configure tomcat to ignore large websocket messages

2017-01-25 Thread Mark Thomas
On 25/01/2017 20:25, Preston Price wrote:
> My environment:
> java: 1.8.0_102,
> tomcat: 8.0.39,
> os:Ubuntu 4.4.0-45-generic,
> websocket api: 1.1
> 
> Currently in my application clients will (rarely) send a message that
> exceeds the default (8192 byte) limit for messages. This results in the
> socket being closed by the server with a 1009 code (too big). Can tomcat be
> configured to ignore such large messages without closing the socket?

No.

Mark


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