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-13 23:37:27 +0300
committermichael-grunder <michael.grunder@gmail.com>2019-02-14 00:07:35 +0300
commit22d81a94eee2ea613fc515e1d714b73142d46241 (patch)
tree92338153230ab3758996be6ad701077c596fbb6d /redis_commands.c
parent7bc845e8835fdbf14193efe9f076b738082852d5 (diff)
Implement GEORADIUS_RO and GEORADIUSBYMEMBER_RO
This addresses #1502, #1487
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 9dbb40f7..db854738 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;
strlen_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);