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-02-14 21:21:00 +0300
committermichael-grunder <michael.grunder@gmail.com>2019-02-14 21:21:00 +0300
commit85419ce7d370dca4d81e9426363ca0ae65c93439 (patch)
treeee93c41d26f12d0ee66ac72dae5fe521bd2629f5 /redis_commands.c
parentf90ba7c8e0add275b2308ff05d483d2ae1ba5efb (diff)
parent22d81a94eee2ea613fc515e1d714b73142d46241 (diff)
Merge branch 'issue.1502.geo-readonly-cmds' into issue.1448-require_php7
Diffstat (limited to 'redis_commands.c')
-rw-r--r--redis_commands.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/redis_commands.c b/redis_commands.c
index 263e3516..2ad7e212 100644
--- a/redis_commands.c
+++ b/redis_commands.c
@@ -2788,9 +2788,10 @@ void append_georadius_opts(RedisSock *redis_sock, smart_string *str, short *slot
}
}
-/* GEORADIUS */
+/* GEORADIUS / GEORADIUS_RO */
int redis_georadius_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
- char **cmd, int *cmd_len, short *slot, void **ctx)
+ char *kw, char **cmd, int *cmd_len, short *slot,
+ void **ctx)
{
char *key, *unit;
short store_slot = 0;
@@ -2823,7 +2824,7 @@ int redis_georadius_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
(gopts.store != STORE_NONE ? 2 : 0);
/* Begin construction of our command */
- REDIS_CMD_INIT_SSTR_STATIC(&cmdstr, argc, "GEORADIUS");
+ redis_cmd_init_sstr(&cmdstr, argc, kw, strlen(kw));
/* Prefix and set slot */
keyfree = redis_key_prefix(redis_sock, &key, &keylen);
@@ -2858,9 +2859,11 @@ int redis_georadius_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
return SUCCESS;
}
-/* GEORADIUSBYMEMBER key member radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count] */
+/* GEORADIUSBYMEMBER/GEORADIUSBYMEMBER_RO
+ * key member radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count] */
int redis_georadiusbymember_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
- char **cmd, int *cmd_len, short *slot, void **ctx)
+ char *kw, char **cmd, int *cmd_len, short *slot,
+ void **ctx)
{
char *key, *mem, *unit;
size_t keylen, memlen, unitlen;
@@ -2890,7 +2893,7 @@ int redis_georadiusbymember_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_s
(gopts.store != STORE_NONE ? 2 : 0);
/* Begin command construction*/
- REDIS_CMD_INIT_SSTR_STATIC(&cmdstr, argc, "GEORADIUSBYMEMBER");
+ redis_cmd_init_sstr(&cmdstr, argc, kw, strlen(kw));
/* Prefix our key if we're prefixing and set the slot */
keyfree = redis_key_prefix(redis_sock, &key, &keylen);