Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A critical fix of library crash and control sequence handling (\n) #5

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

romansavrulin
Copy link
Contributor

There was deletion of m_callbacks.end() when receiving "parse error" string, that lead to segfault of the app.

Also, a single \n, or a \n at the end of the json string was triggering json parsing one more time.

sometimes, under severe load (millions requests per hour) and unstable transmission line you can run into loss of synchronization of the stream. JSON stream parsing state machine adds '{' to stack, but end sequence of } can be lost. That leads to endless stream bufferization in parser. To avoid this, a delimiter was implemented, that resets stream parser to initial state after. If delimiter is not used, it can be set to \0

}
// Remove the weak pointer to the callback
m_callbacks.erase(i);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I have cherry picked this over to our release candidate branch for now, and will look over the rest of this pull request later. We switched over to git flow a while back, so the rest of this will have to go into develop until our next release, and there are a few changes both there and in a feature branch that we are about to merge to develop that will likely conflict with the whitespace parsing changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants