-
Notifications
You must be signed in to change notification settings - Fork 65
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
Changed parse_call_reply to return a BulkString. #93
base: master
Are you sure you want to change the base?
Conversation
This PR changes the parse_call_reply function to return a BulkString instead of af SimpleString. The current implementation treats all string values, returned by calling a redis function within a module, as a SimpleString. This issue arises if you pass the the return value of call from your module. The change i propose will treat string values returned from call as a BulkString as BulkStrings can contain line breaks, as the underlying string can contain line brakes
Another option would be to remove the distinction between Bulk/Simple strings from the We can further extent this to have the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this change, see comment above.
@yoav-steinberg I was about to re-submit this exact change before noticing that it had previously been submitted. I spent way too long troubleshooting code that was affected by this issue. For example, this code looks harmless but contains a bug: /// Redis module command that returns the value of at key `key`
pub fn cmd_example(ctx: &Context, _args: Vec<RedisString>) -> RedisResult {
ctx.call("GET", &["key"])
} This code works fine if the key's value does not contain It seems that this pull request is delayed because there is desire to make |
This PR changes the parse_call_reply function to return a BulkString instead of af SimpleString.
The current implementation treats all string values, returned by calling a redis function within a module, as a SimpleString. This issue arises if you pass the the return value of call from your module.
The change i propose will treat string values returned from call as a BulkString, as the underlying string can contain line brakes