summaryrefslogtreecommitdiff
path: root/src/cluster.h
diff options
context:
space:
mode:
authorWang Yuan <wangyuan21@baidu.com>2022-01-18 21:55:20 +0800
committerGitHub <noreply@github.com>2022-01-18 15:55:20 +0200
commitd697daa7a5600ca82a0098bc7c857bc7167bb35e (patch)
tree303549e26aa773c5fd5544c6d3a9948711b77d9d /src/cluster.h
parent99ab4236afb210dc118fad892210b9fbb369aa8e (diff)
downloadredis-d697daa7a5600ca82a0098bc7c857bc7167bb35e.tar.gz
Use const char pointer in redismodule.h as far as possible (#10064)
When I used C++ to develop a redis module. i used `string.data()` as the second parameter `ele` of `RedisModule_DigestAddStringBuffer`, but there is a warning, since we never change the `ele`, i think we should use `const char` for it. This PR adds const to just a handful of module APIs that required it, all not very widely used. The implication is a breaking change in terms of compilation error that's easy to resolve, and no ABI impact. The affected APIs are around Digest, Info injection, and Cluster bus messages.
Diffstat (limited to 'src/cluster.h')
-rw-r--r--src/cluster.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cluster.h b/src/cluster.h
index 8b76ed19e..ae63a9d84 100644
--- a/src/cluster.h
+++ b/src/cluster.h
@@ -350,7 +350,7 @@ void clusterRedirectClient(client *c, clusterNode *n, int hashslot, int error_co
void migrateCloseTimedoutSockets(void);
int verifyClusterConfigWithData(void);
unsigned long getClusterConnectionsCount(void);
-int clusterSendModuleMessageToTarget(const char *target, uint64_t module_id, uint8_t type, unsigned char *payload, uint32_t len);
+int clusterSendModuleMessageToTarget(const char *target, uint64_t module_id, uint8_t type, const char *payload, uint32_t len);
void clusterPropagatePublish(robj *channel, robj *message);
void clusterPropagatePublishShard(robj *channel, robj *message);
unsigned int keyHashSlot(char *key, int keylen);