You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following Redis Module command simply wraps the Redis "GET" command and returns the value of the simple string key with the name "key". It contains a bug for some string values.
For multi-line strings (i.e. those containing \r\n), it will cause the Redis client to fail. On the redis-py client, for example, the client hangs because RESP protocol is not respected.
Root cause is that Context::call() always returns strings as RedisValue::SimpleString. But strings containing \r\n should be RedisValue::BulkString.
The text was updated successfully, but these errors were encountered:
There seems to be some hesitation by maintainers to implement the fix. Until then, here is a workaround that can be applied to the output of Context::call() that will work around this issue:
/// Remap `Context::call()` results to convert `SimpleString` into `BulkString`./// All other types are left alone.pubfnfix_call_reply(result:RedisValue) -> RedisValue{match result {RedisValue::SimpleString(v) => RedisValue::BulkString(v),RedisValue::Array(a) => {RedisValue::Array(a.into_iter().map(|v| fix_call_reply(v)).collect())}
v @ _ => v,}}
The following Redis Module command simply wraps the Redis "GET" command and returns the value of the simple string key with the name "key". It contains a bug for some string values.
Root cause is that
Context::call()
always returns strings asRedisValue::SimpleString
. But strings containing \r\n should beRedisValue::BulkString
.The text was updated successfully, but these errors were encountered: