netty5/codec-haproxy/src
秦世成 f489404fa1 HAProxyMessageDecoder not correctly handle delimiter in all cases (#9282)
Motivation:

In line base decoders, lines are split by delimiter, but the delimiter may be \r\n or \r, so in decoding, if findEndOfLine finds delimiter of a line, the length of the delimiter may be 1 or 2, instead of DELIMITER_LENGTH, where the value is fixed to 2.
The second problem is that if the data to be decoded is too long, the decoder will discard too long data, and needs to record the length of the discarded bytes. In the original implementation, the discarded bytes are not accumulated, but are assigned to the currently discarded bytes.
Modification:

Modifications:
Dynamic calculation of the length of delimiter.
In discarding mode, add up the number of characters discarded each time.

Result:

Correctly handle all delimiters and also correctly handle too long frames.
2019-06-27 21:58:46 +02:00
..
main/java/io/netty/handler/codec/haproxy HAProxyMessageDecoder not correctly handle delimiter in all cases (#9282) 2019-06-27 21:58:46 +02:00
test/java/io/netty/handler/codec/haproxy HAProxyMessageDecoder not correctly handle delimiter in all cases (#9282) 2019-06-27 21:58:46 +02:00