[undertow-dev] Nit: MAX_ENTITY_SIZE, Default -1 vs. 0

Stuart Douglas sdouglas at redhat.com
Wed Jun 4 11:24:32 EDT 2014


I have changed them to all use the constant.

Stuart

Bernd Eckenfels wrote:
> Hello,
>
> (while researching some details for the pending documentation pull
> request I noticed):
>
> SpdyReceiveListener is using:
>
> this.maxEntitySize =
>          undertowOptions.get(UndertowOptions.MAX_ENTITY_SIZE,
>          UndertowOptions.DEFAULT_MAX_ENTITY_SIZE);
>
> While HTTPReadListener and AjpReadListener is using:
>
> this.maxEntitySize =
>          connection.getUndertowOptions().get(UndertowOptions.MAX_ENTITY_SIZE,
>          0);
>
> The DEFAULT_MAX_ENTITY_SIZE is defined as -1. I think it would be good
> to use the constant in HTTP+AjpReadListener (and
> HttpServerExchange(ServerConnection)) as well.
>
> I think using -1 as the constant and in all places looks better, but
> more backward compatible would be 0. In
> HttpServerExchange#maxEntitySize for example it is documented as 0
> means unlimited.
>
> The limit is checked here, and all accept 0 and -1 as unlimited:
> FixedLengthStreamSourceConduit#checkMaxSize()
> AjpServerRequestConduit#soRead()
> ChunkedStreamSourceConduit#updateRemainingAllowed()
>
> Gruss
> Bernd
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev


More information about the undertow-dev mailing list