netty5/codec-http/src/test/java/io/netty/handler/codec/http/websocketx/extensions/compression
Christian Lang a6f807dd68 Fix context and window sizes sides. (#8395)
Motivation:

As mentioned in RFC 7692 :

The "server_no_context_takeover" Extension Parameter should be used on server side for compression and on client side for decompression.

The "client_no_context_takeover" Extension Parameter should be used on client side for compression and on server side for decompression.

Right now, in PerMessageDeflateClientExtensionHandshaker, the decoder uses clientNoContext instead of serverNoContext and the encoder uses serverNoContext instead of clientNoContext.

The same inversion is present in PerMessageDeflateServerExtensionHandshaker: the decoder uses
serverNoContext instead of clientNoContext, while the encoder uses serverNoContext instead of clientNoContext. Besides the context inversion, the sliding window sizes seem to be inversed as well.

Modification:

Inverse clientNoContext with serverNoContext and clientWindowSize with serverWindowSize for both the Decoder and Encoder in PerMessageDeflateServerExtensionHandshaker and PerMessageDeflateClientExtensionHandshaker.

Result:

This fixes the decompression fail in the case that one of the contexts is set and the other one is not.
2018-10-18 13:55:30 +02:00
..
DeflateFrameClientExtensionHandshakerTest.java [#4212] Backport WebSocket Extension handlers for client and server. 2015-12-18 09:48:10 +01:00
DeflateFrameServerExtensionHandshakerTest.java [#4212] Backport WebSocket Extension handlers for client and server. 2015-12-18 09:48:10 +01:00
PerFrameDeflateDecoderTest.java Fix context and window sizes sides. (#8395) 2018-10-18 13:55:30 +02:00
PerFrameDeflateEncoderTest.java [#4212] Backport WebSocket Extension handlers for client and server. 2015-12-18 09:48:10 +01:00
PerMessageDeflateClientExtensionHandshakerTest.java Fix context and window sizes sides. (#8395) 2018-10-18 13:55:30 +02:00
PerMessageDeflateDecoderTest.java Fix buffer leak introduced by 693633eeff 2015-12-29 17:13:07 +01:00
PerMessageDeflateEncoderTest.java [#4212] Backport WebSocket Extension handlers for client and server. 2015-12-18 09:48:10 +01:00
PerMessageDeflateServerExtensionHandshakerTest.java Simplify JUnit assertions 2017-05-09 20:19:10 +02:00
WebSocketServerCompressionHandlerTest.java Simplify JUnit assertions 2017-05-09 20:19:10 +02:00