-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
readline.c: Fix reading when delimiter is split across reads.
If the first part of the delimiter is read into the end of the buffer, and only later is there enough room in the buffer to read further, even though things will get shifted up to the front of the buffer properly, after reading the rest of the delimiter, the code was only scanning for the full delimiter starting at what was just read. This works if the delimiter is only a single character, but does not work for multi-byte delimiters (e.g. CR LF). This was observed to cause readline to block improperly, where it didn't think the delimiter had been received, even though it had, since it needed to start looking for the full delimiter starting from a character before. This is now fixed, and tests have also been added to ensure the correct behavior (these failed originally, but now pass).
- Loading branch information
1 parent
7771333
commit df7721f
Showing
4 changed files
with
133 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters