-
Notifications
You must be signed in to change notification settings - Fork 872
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
fix response for the command that is too long #562
Conversation
Codecov Report
|
@ysmolsky Should we update docs as well? |
Docs mention that already, but expanding it a little would not hurt I guess. |
cc008c0
to
25725da
Compare
Before the patch, if a client sent too long command, server would respond by BAD_FORMAT, followed by UNKNOWN_COMMAND. This resulted in desync between client and server. This patch adds another state STATE_WANT_ENDLINE, whose purpose is to drop command line until the EOL is found. Client can send as big command as he want and server will be able to skip it and return only one error message: BAD_FORMAT. Some STATE_* constants were renamed to improve readability. Fixes #337
25725da
to
8b95c05
Compare
I have fixed the protocol regarding why BAD_FORMAT may be returned. |
@ysmolsky Is it on purpose you added a printf for each command that is executed? https://github.com/beanstalkd/beanstalkd/pull/562/files#diff-5b9219f6cd269a2c85dc83291ca314a4R1288 |
Oh wow! Thanks for spotting this. I am not sure how it got there, but it was not an intention. |
@ysmolsky maybe we should do another release with all of the fixes you've added since the last one? |
Yes, that would be awesome. Last release was almost 1 year ago... |
Before the patch, if a client sent too long command, server would
respond by BAD_FORMAT, followed by UNKNOWN_COMMAND. This resulted
in desync between client and server.
This patch adds another state STATE_WANT_ENDLINE,
whose purpose is to drop command line until the EOL is found.
Client can send as big command as he want and server will be able
to skip it and return only one error message: BAD_FORMAT.
Some STATE_* constants were renamed to improve readability.
Fixes #337