netty5/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/extensions
Nick Hill 2ca526fac6 Ensure "full" ownership of msgs passed to EmbeddedChannel.writeInbound() (#9058)
Motivation

Pipeline handlers are free to "take control" of input buffers if they have singular refcount - in particular to mutate their raw data if non-readonly via discarding of read bytes, etc.

However there are various places (primarily unit tests) where a wrapped byte-array buffer is passed in and the wrapped array is assumed not to change (used after the wrapped buffer is passed to EmbeddedChannel.writeInbound()). This invalid assumption could result in unexpected errors, such as those exposed by #8931.

Modifications

Anywhere that the data passed to writeInbound() might be used again, ensure that either:
- A copy is used rather than wrapping a shared byte array, or
- The buffer is otherwise protected from modification by making it read-only

For the tests, copying is preferred since it still allows the "mutating" optimizations to be exercised.

Results

Avoid possible errors when pipeline assumes it has full control of input buffer.
2019-05-22 12:08:49 +02:00
..
compression Ensure "full" ownership of msgs passed to EmbeddedChannel.writeInbound() (#9058) 2019-05-22 12:08:49 +02:00
package-info.java [#4212] Backport WebSocket Extension handlers for client and server. 2015-12-18 09:48:10 +01:00
WebSocketClientExtension.java [#4212] Backport WebSocket Extension handlers for client and server. 2015-12-18 09:48:10 +01:00
WebSocketClientExtensionHandler.java fix the typos 2017-04-20 04:56:09 +02:00
WebSocketClientExtensionHandshaker.java [#4212] Backport WebSocket Extension handlers for client and server. 2015-12-18 09:48:10 +01:00
WebSocketExtension.java [#4212] Backport WebSocket Extension handlers for client and server. 2015-12-18 09:48:10 +01:00
WebSocketExtensionData.java [#4212] Backport WebSocket Extension handlers for client and server. 2015-12-18 09:48:10 +01:00
WebSocketExtensionDecoder.java [#4212] Backport WebSocket Extension handlers for client and server. 2015-12-18 09:48:10 +01:00
WebSocketExtensionEncoder.java [#4212] Backport WebSocket Extension handlers for client and server. 2015-12-18 09:48:10 +01:00
WebSocketExtensionFilter.java Add user possibility to skip the evaluation of a certain websocket ex… (#8910) 2019-03-22 14:48:22 +01:00
WebSocketExtensionFilterProvider.java Add user possibility to skip the evaluation of a certain websocket ex… (#8910) 2019-03-22 14:48:22 +01:00
WebSocketExtensionUtil.java Removed custom split method as it is not effective anymore. 2016-08-01 21:49:33 +02:00
WebSocketServerExtension.java TODO for the method with typo in name 2017-03-08 09:28:33 -08:00
WebSocketServerExtensionHandler.java [#4754] Correctly detect websocket upgrade 2016-02-04 14:03:08 +01:00
WebSocketServerExtensionHandshaker.java [#4212] Backport WebSocket Extension handlers for client and server. 2015-12-18 09:48:10 +01:00