5 Commits

Author SHA1 Message Date
Johannes Weiss
bddf6c5d74 LineBasedFrameDecoder: tolerate drip fed \r\n (#51)
Motivation:

LineBasedFrameDecoder previously would only correctly decode \r\n as a
line-ending iff \r\n were not split apart.

Modifications:

Handle \r\n arriving apart.

Result:

more correct line splitting
2019-05-10 19:04:33 +01:00
Johannes Weiss
1c39f44412
LineBasedFrameDecoder: Don't discard everything after EOF (#39)
Motivation:

LineBasedFrameDecoder discarded everything after EOF and delivered it in
the left-over bytes error. For the real world however that doesn't make
much sense, you'd want all previously received lines and only receive
the partial lines as left-overs.

Modifications:

deliver lines until there are only partial lines left, even in case of
EOF.

Result:

LineBasedFrameDecoder more useful
2019-03-21 14:55:21 +00:00
Johannes Weiss
45ddf6a211
LineBasedFrameDecoder: don't crash when leftovers available (#13)
Motivation:

Currently, we crash if there's any left over bytes available because
LineBasedFrameDecoder modifies cumulationBuffer in a way that is
illegal.

Modifications:

stop modifying cumulationBuffer in an illegal way

Result:

fewer crashes
2019-03-08 15:41:46 +00:00
Johannes Weiss
7b7fcf09be port to NIO 2 (#24)
Motivation:

NIO 2 is the new hot stuff.

Modifications:

port to NIO 2

Result:

newer, shinier
2019-02-26 13:01:48 +00:00
Ludovic Dewailly
ad4edc8cb5 Adds a line-based frame decoder that can split received buffers on line endings. (#11)
* Adds a line-based frame decoder that can split received buffers on line endings.

Motivation:

As per https://github.com/apple/swift-nio/issues/473

Modifications:

Added a new decoder (LineBasedFrameDecoder) that splits incoming buffers on line end characters.

Result:

Received buffers will be split on line end character(s) ('\n' or '\r\n'), with these characters
stripped in the resulting buffers.
2018-08-06 16:43:39 +01:00