Added the ability to process streams that use CR or CRLF as newlines#25
Conversation
a5163e2 to
07d8c5c
Compare
|
@boenrobot thanks for looking into this, definitely an interesting solution 👍 I was thinking, what if there's the case a chunk ends with What do you think about this one? |
|
Interesting edge case... I guess it should be safe to just remove the leading space from the buffer? I'll prepare a test and see if that addresses it. |
|
I added a test case, and it seems like it passes. And on closer examination, that seems to make sense thanks to the fact that empty lines in a message are ignored. The first message is cut at the second |
5a75f95 to
683805f
Compare
|
I've reverted what I thought was a performance improvement in the building of the message, after doing some synthetic benchmarks, and added an "/S" flag to the regex, since the optimizations it's supposed to make are applicable exactly in scenarios like this one. And I've squashed all commits into one, to not pollute the commit log. |
683805f to
1caa147
Compare
1caa147 to
3578436
Compare
clue
left a comment
There was a problem hiding this comment.
@boenrobot Thanks for looking into this, changes LGTM!
Looks like an excellent improvement over the current situation, we can also build on top of this if we find that a broken up CRLF shows up again!
Keep it up! ![]()
Fixes #6