Skip to content

Conversation

Mitko-Kerezov
Copy link
Contributor

Includes:

  • Remove code tested with 10 000 000 messages in while loop.

In the cases where we end up in the deleted else statement we do not call _transform recursively, which leads to the fact that the initial promise is never resolved.

One can end up in the deleted else block if stdout or stderr is set to _O_TEXT mode and a message is printed which is exactly 10 symbols on Windows. Any message on a _O_TEXT buffer has its line feeds replaced with a carriage-return line feed pair. Due to the fact that the number 10 represents the ASCII code for a line feed we are liable to error in that way.

Note that the stderr pipe is currently unused in the production code, so there's no need to rebuild the binaries prior to publishing a new version of the library.

Ping @rosen-vladimirov @TsvetanMilanov

@Mitko-Kerezov Mitko-Kerezov self-assigned this Aug 22, 2017
@Mitko-Kerezov Mitko-Kerezov merged commit 0e811ad into master Aug 23, 2017
@Mitko-Kerezov Mitko-Kerezov deleted the kerezov/unresolved-promise branch August 23, 2017 07:53
rosen-vladimirov added a commit that referenced this pull request Jan 15, 2019
The `message-unpack-stream` parses messages incorrectly in case a message with length less than Header length (4) is received - this leads to indefinite recursion. The problem has been introduced in #24 which was fixing another issue - when the length of the new message is less than the buffer header and there's something in the `_unfinishedMessage`.
To resolve the issue, get the previous logic and improve the check - in case we have partial message from the previous time, just add the current message to it and get in the recursion. In case we do not have previous message and current data is less than 4 bytes, just put it in the `_unfinishedMessage` and wait for new data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants