mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Add REDIS_BIND_ADDR access macro
We need to access (bindaddr[0] || NULL) in a few places, so centralize access with a nice macro.
This commit is contained in:
parent
1506c64c8b
commit
d830dcb12d
@ -2794,8 +2794,7 @@ void clusterCron(void) {
|
|||||||
clusterLink *link;
|
clusterLink *link;
|
||||||
|
|
||||||
fd = anetTcpNonBlockBindConnect(server.neterr, node->ip,
|
fd = anetTcpNonBlockBindConnect(server.neterr, node->ip,
|
||||||
node->port+REDIS_CLUSTER_PORT_INCR,
|
node->port+REDIS_CLUSTER_PORT_INCR, REDIS_BIND_ADDR);
|
||||||
server.bindaddr_count ? server.bindaddr[0] : NULL);
|
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
redisLog(REDIS_DEBUG, "Unable to connect to "
|
redisLog(REDIS_DEBUG, "Unable to connect to "
|
||||||
"Cluster Node [%s]:%d -> %s", node->ip,
|
"Cluster Node [%s]:%d -> %s", node->ip,
|
||||||
|
@ -367,6 +367,9 @@
|
|||||||
#define REDIS_NOTIFY_EVICTED (1<<9) /* e */
|
#define REDIS_NOTIFY_EVICTED (1<<9) /* e */
|
||||||
#define REDIS_NOTIFY_ALL (REDIS_NOTIFY_GENERIC | REDIS_NOTIFY_STRING | REDIS_NOTIFY_LIST | REDIS_NOTIFY_SET | REDIS_NOTIFY_HASH | REDIS_NOTIFY_ZSET | REDIS_NOTIFY_EXPIRED | REDIS_NOTIFY_EVICTED) /* A */
|
#define REDIS_NOTIFY_ALL (REDIS_NOTIFY_GENERIC | REDIS_NOTIFY_STRING | REDIS_NOTIFY_LIST | REDIS_NOTIFY_SET | REDIS_NOTIFY_HASH | REDIS_NOTIFY_ZSET | REDIS_NOTIFY_EXPIRED | REDIS_NOTIFY_EVICTED) /* A */
|
||||||
|
|
||||||
|
/* Get the first bind addr or NULL */
|
||||||
|
#define REDIS_BIND_ADDR (server.bindaddr_count ? server.bindaddr[0] : NULL)
|
||||||
|
|
||||||
/* Using the following macro you can run code inside serverCron() with the
|
/* Using the following macro you can run code inside serverCron() with the
|
||||||
* specified period, specified in milliseconds.
|
* specified period, specified in milliseconds.
|
||||||
* The actual resolution depends on server.hz. */
|
* The actual resolution depends on server.hz. */
|
||||||
|
Loading…
Reference in New Issue
Block a user