Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael-grunder <michael.grunder@gmail.com>2019-05-13 04:49:33 +0300
committerMichael Grunder <michael.grunder@gmail.com>2019-05-13 19:38:18 +0300
commit5cb30fb2a65abc9d31ff58af6da0fbb6be4ec153 (patch)
treef44faea9b2f4b044f41750ea31f46bc284770d81 /redis_commands.c
parentbe3089c6cb8344697556a00fdcebdc0619df58e0 (diff)
Adds OPT_REPLY_LITERAL for rawCommand and EVAL
Adds an option to process the actual strings in simple string replies as opposed to translating them to `true`. This only applies to `rawCommand` and `eval` because as far as I know know vanilla Redis command attaches any information besides `OK` to simple string replies. Addresses #1550
Diffstat (limited to 'redis_commands.c')
-rw-r--r--redis_commands.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/redis_commands.c b/redis_commands.c
index 829bfb04..77c7366e 100644
--- a/redis_commands.c
+++ b/redis_commands.c
@@ -3856,6 +3856,8 @@ void redis_getoption_handler(INTERNAL_FUNCTION_PARAMETERS,
RETURN_LONG(redis_sock->tcp_keepalive);
case REDIS_OPT_SCAN:
RETURN_LONG(redis_sock->scan);
+ case REDIS_OPT_REPLY_LITERAL:
+ RETURN_LONG(redis_sock->reply_literal);
case REDIS_OPT_FAILOVER:
RETURN_LONG(c->failover);
default:
@@ -3896,6 +3898,10 @@ void redis_setoption_handler(INTERNAL_FUNCTION_PARAMETERS,
RETURN_TRUE;
}
break;
+ case REDIS_OPT_REPLY_LITERAL:
+ val_long = zval_get_long(val);
+ redis_sock->reply_literal = val_long != 0;
+ RETURN_TRUE;
case REDIS_OPT_COMPRESSION:
val_long = zval_get_long(val);
if (val_long == REDIS_COMPRESSION_NONE