netty5/codec-http/src/main/java/io/netty/handler/codec/http/websocketx
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
..
extensions Ensure "full" ownership of msgs passed to EmbeddedChannel.writeInbound() (#9058) 2019-05-22 12:08:49 +02:00
BinaryWebSocketFrame.java Add user possibility to skip the evaluation of a certain websocket ex… (#8910) 2019-03-22 14:48:22 +01:00
CloseWebSocketFrame.java Add user possibility to skip the evaluation of a certain websocket ex… (#8910) 2019-03-22 14:48:22 +01:00
ContinuationWebSocketFrame.java Add user possibility to skip the evaluation of a certain websocket ex… (#8910) 2019-03-22 14:48:22 +01:00
package-info.java Use our own URL shortener wherever possible 2014-07-31 17:06:19 -07:00
PingWebSocketFrame.java Add user possibility to skip the evaluation of a certain websocket ex… (#8910) 2019-03-22 14:48:22 +01:00
PongWebSocketFrame.java Add user possibility to skip the evaluation of a certain websocket ex… (#8910) 2019-03-22 14:48:22 +01:00
TextWebSocketFrame.java Add user possibility to skip the evaluation of a certain websocket ex… (#8910) 2019-03-22 14:48:22 +01:00
Utf8FrameValidator.java Close connection for CorruptedFrameException (#8705) 2019-01-17 07:17:12 +01:00
Utf8Validator.java ByteString introduced as AsciiString super class 2015-04-14 16:35:17 -07:00
WebSocket07FrameDecoder.java Correct comment for allowMaskMismatch parameter 2017-02-16 17:03:55 +01:00
WebSocket07FrameEncoder.java #751 - Added support for legacy websocket v7 in order to pass SocksJS tests 2012-12-19 12:35:56 +01:00
WebSocket08FrameDecoder.java Format code to align unaligned code. (#9062) 2019-05-20 12:07:02 +02:00
WebSocket08FrameEncoder.java Fix spelling in javadocs and field name. 2016-02-01 12:03:14 +01:00
WebSocket13FrameDecoder.java Correct comment for allowMaskMismatch parameter 2017-02-16 17:03:55 +01:00
WebSocket13FrameEncoder.java Update license headers 2012-06-04 13:31:44 -07:00
WebSocket00FrameDecoder.java Fixed NPE in WebSocket00FrameDecoder if end couldn't be found in text frame 2014-07-16 20:03:57 +02:00
WebSocket00FrameEncoder.java [#2768] Correctly duplicate buffer for CloseWebSocketFrames 2014-08-14 09:54:35 +02:00
WebSocketChunkedInput.java Support WebSocket data chunked transfer 2016-06-13 08:55:07 +02:00
WebSocketClientHandshaker.java Only use static Exception instances when we can ensure addSuppressed … (#9152) 2019-05-17 22:23:02 +02:00
WebSocketClientHandshaker07.java WebSocket client handshaker to support "force close" after timeout (#8896) 2019-04-10 15:25:34 +02:00
WebSocketClientHandshaker08.java WebSocket client handshaker to support "force close" after timeout (#8896) 2019-04-10 15:25:34 +02:00
WebSocketClientHandshaker13.java WebSocket client handshaker to support "force close" after timeout (#8896) 2019-04-10 15:25:34 +02:00
WebSocketClientHandshaker00.java WebSocket client handshaker to support "force close" after timeout (#8896) 2019-04-10 15:25:34 +02:00
WebSocketClientHandshakerFactory.java WebSocket client handshaker to support "force close" after timeout (#8896) 2019-04-10 15:25:34 +02:00
WebSocketClientProtocolHandler.java Update to new checkstyle plugin (#8777) (#8780) 2019-01-25 11:58:42 +01:00
WebSocketClientProtocolHandshakeHandler.java Fix the leak in the WebSocketClientProtocolHandshakeHandler 2014-10-12 20:26:12 +02:00
WebSocketFrame.java Add user possibility to skip the evaluation of a certain websocket ex… (#8910) 2019-03-22 14:48:22 +01:00
WebSocketFrameAggregator.java HttpObjectAggregator doesn't check content-length header 2015-08-17 09:26:50 -07:00
WebSocketFrameDecoder.java [#1515] Add WebSocketFrameEncoder and WebSocketFrameDecoder interfaces and let our impls implement it 2013-07-04 06:41:22 +02:00
WebSocketFrameEncoder.java [#1515] Add WebSocketFrameEncoder and WebSocketFrameDecoder interfaces and let our impls implement it 2013-07-04 06:41:22 +02:00
WebSocketHandshakeException.java Update license headers 2012-06-04 13:31:44 -07:00
WebSocketProtocolHandler.java Propagate pong frames in WebSocketProtocolHandler (#7955) 2018-05-24 20:27:29 +02:00
WebSocketScheme.java Immediate caching the strings wrapped to AsciiString 2017-08-15 06:22:14 +02:00
WebSocketServerHandshaker.java Only use static Exception instances when we can ensure addSuppressed … (#9152) 2019-05-17 22:23:02 +02:00
WebSocketServerHandshaker07.java Correct comment for allowMaskMismatch parameter 2017-02-16 17:03:55 +01:00
WebSocketServerHandshaker08.java Correct comment for allowMaskMismatch parameter 2017-02-16 17:03:55 +01:00
WebSocketServerHandshaker13.java Correct comment for allowMaskMismatch parameter 2017-02-16 17:03:55 +01:00
WebSocketServerHandshaker00.java Do not depend on the implementation detail of Unpooled.buffer(int) when accessing backing array. (#8865) 2019-02-15 09:38:36 -08:00
WebSocketServerHandshakerFactory.java Correct comment for allowMaskMismatch parameter 2017-02-16 17:03:55 +01:00
WebSocketServerProtocolHandler.java Propagate pong frames in WebSocketProtocolHandler (#7955) 2018-05-24 20:27:29 +02:00
WebSocketServerProtocolHandshakeHandler.java Compare HttpMethod by reference (#8815) 2019-01-30 21:17:00 +01:00
WebSocketUtil.java Fix random number generators in WebSocketUtil 2018-06-25 14:42:59 +02:00
WebSocketVersion.java #751 - Added support for legacy websocket v7 in order to pass SocksJS tests 2012-12-19 12:35:56 +01:00