mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 08:08:53 -05:00
Clean up text throughout project
- Remove trailing newlines from redis.conf - Fix comment misspelling - Clarifies zipEncodeLength usage and a C API mention (#1243, #1242) - Fix cluster typos (inspired by @papanikge #1507) - Fix rewite -> rewrite in a few places (inspired by #682) Closes #1243, #1242, #1507
This commit is contained in:
parent
fc8f7ec765
commit
12d0195b30
24
redis.conf
24
redis.conf
@ -180,9 +180,9 @@ dbfilename dump.rdb
|
|||||||
#
|
#
|
||||||
# The DB will be written inside this directory, with the filename specified
|
# The DB will be written inside this directory, with the filename specified
|
||||||
# above using the 'dbfilename' configuration directive.
|
# above using the 'dbfilename' configuration directive.
|
||||||
#
|
#
|
||||||
# The Append Only File will also be created inside this directory.
|
# The Append Only File will also be created inside this directory.
|
||||||
#
|
#
|
||||||
# Note that you must specify a directory here, not a file name.
|
# Note that you must specify a directory here, not a file name.
|
||||||
dir ./
|
dir ./
|
||||||
|
|
||||||
@ -340,7 +340,7 @@ slave-priority 100
|
|||||||
#
|
#
|
||||||
# This should stay commented out for backward compatibility and because most
|
# This should stay commented out for backward compatibility and because most
|
||||||
# people do not need auth (e.g. they run their own servers).
|
# people do not need auth (e.g. they run their own servers).
|
||||||
#
|
#
|
||||||
# Warning: since Redis is pretty fast an outside user can try up to
|
# Warning: since Redis is pretty fast an outside user can try up to
|
||||||
# 150k passwords per second against a good box. This means that you should
|
# 150k passwords per second against a good box. This means that you should
|
||||||
# use a very strong password otherwise it will be very easy to break.
|
# use a very strong password otherwise it will be very easy to break.
|
||||||
@ -406,14 +406,14 @@ slave-priority 100
|
|||||||
|
|
||||||
# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
|
# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
|
||||||
# is reached. You can select among five behaviors:
|
# is reached. You can select among five behaviors:
|
||||||
#
|
#
|
||||||
# volatile-lru -> remove the key with an expire set using an LRU algorithm
|
# volatile-lru -> remove the key with an expire set using an LRU algorithm
|
||||||
# allkeys-lru -> remove any key according to the LRU algorithm
|
# allkeys-lru -> remove any key according to the LRU algorithm
|
||||||
# volatile-random -> remove a random key with an expire set
|
# volatile-random -> remove a random key with an expire set
|
||||||
# allkeys-random -> remove a random key, any key
|
# allkeys-random -> remove a random key, any key
|
||||||
# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
|
# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
|
||||||
# noeviction -> don't expire at all, just return an error on write operations
|
# noeviction -> don't expire at all, just return an error on write operations
|
||||||
#
|
#
|
||||||
# Note: with any of the above policies, Redis will return an error on write
|
# Note: with any of the above policies, Redis will return an error on write
|
||||||
# operations, when there are no suitable keys for eviction.
|
# operations, when there are no suitable keys for eviction.
|
||||||
#
|
#
|
||||||
@ -506,7 +506,7 @@ appendfsync everysec
|
|||||||
# the same as "appendfsync none". In practical terms, this means that it is
|
# the same as "appendfsync none". In practical terms, this means that it is
|
||||||
# possible to lose up to 30 seconds of log in the worst scenario (with the
|
# possible to lose up to 30 seconds of log in the worst scenario (with the
|
||||||
# default Linux settings).
|
# default Linux settings).
|
||||||
#
|
#
|
||||||
# If you have latency problems turn this to "yes". Otherwise leave it as
|
# If you have latency problems turn this to "yes". Otherwise leave it as
|
||||||
# "no" that is the safest pick from the point of view of durability.
|
# "no" that is the safest pick from the point of view of durability.
|
||||||
|
|
||||||
@ -515,7 +515,7 @@ no-appendfsync-on-rewrite no
|
|||||||
# Automatic rewrite of the append only file.
|
# Automatic rewrite of the append only file.
|
||||||
# Redis is able to automatically rewrite the log file implicitly calling
|
# Redis is able to automatically rewrite the log file implicitly calling
|
||||||
# BGREWRITEAOF when the AOF log size grows by the specified percentage.
|
# BGREWRITEAOF when the AOF log size grows by the specified percentage.
|
||||||
#
|
#
|
||||||
# This is how it works: Redis remembers the size of the AOF file after the
|
# This is how it works: Redis remembers the size of the AOF file after the
|
||||||
# latest rewrite (if no rewrite has happened since the restart, the size of
|
# latest rewrite (if no rewrite has happened since the restart, the size of
|
||||||
# the AOF at startup is used).
|
# the AOF at startup is used).
|
||||||
@ -590,7 +590,7 @@ lua-time-limit 5000
|
|||||||
#
|
#
|
||||||
# cluster-config-file nodes-6379.conf
|
# cluster-config-file nodes-6379.conf
|
||||||
|
|
||||||
# Cluster node timeout is the amount of milliseconds a node must be unreachable
|
# Cluster node timeout is the amount of milliseconds a node must be unreachable
|
||||||
# for it to be considered in failure state.
|
# for it to be considered in failure state.
|
||||||
# Most other internal time limits are multiple of the node timeout.
|
# Most other internal time limits are multiple of the node timeout.
|
||||||
#
|
#
|
||||||
@ -684,7 +684,7 @@ lua-time-limit 5000
|
|||||||
# but just the time needed to actually execute the command (this is the only
|
# but just the time needed to actually execute the command (this is the only
|
||||||
# stage of command execution where the thread is blocked and can not serve
|
# stage of command execution where the thread is blocked and can not serve
|
||||||
# other requests in the meantime).
|
# other requests in the meantime).
|
||||||
#
|
#
|
||||||
# You can configure the slow log with two parameters: one tells Redis
|
# You can configure the slow log with two parameters: one tells Redis
|
||||||
# what is the execution time, in microseconds, to exceed in order for the
|
# what is the execution time, in microseconds, to exceed in order for the
|
||||||
# command to get logged, and the other parameter is the length of the
|
# command to get logged, and the other parameter is the length of the
|
||||||
@ -725,7 +725,7 @@ latency-monitor-threshold 0
|
|||||||
|
|
||||||
# Redis can notify Pub/Sub clients about events happening in the key space.
|
# Redis can notify Pub/Sub clients about events happening in the key space.
|
||||||
# This feature is documented at http://redis.io/topics/notifications
|
# This feature is documented at http://redis.io/topics/notifications
|
||||||
#
|
#
|
||||||
# For instance if keyspace events notification is enabled, and a client
|
# For instance if keyspace events notification is enabled, and a client
|
||||||
# performs a DEL operation on key "foo" stored in the Database 0, two
|
# performs a DEL operation on key "foo" stored in the Database 0, two
|
||||||
# messages will be published via Pub/Sub:
|
# messages will be published via Pub/Sub:
|
||||||
@ -800,7 +800,7 @@ zset-max-ziplist-value 64
|
|||||||
#
|
#
|
||||||
# A value greater than 16000 is totally useless, since at that point the
|
# A value greater than 16000 is totally useless, since at that point the
|
||||||
# dense representation is more memory efficient.
|
# dense representation is more memory efficient.
|
||||||
#
|
#
|
||||||
# The suggested value is ~ 3000 in order to have the benefits of
|
# The suggested value is ~ 3000 in order to have the benefits of
|
||||||
# the space efficient encoding without slowing down too much PFADD,
|
# the space efficient encoding without slowing down too much PFADD,
|
||||||
# which is O(N) with the sparse encoding. The value can be raised to
|
# which is O(N) with the sparse encoding. The value can be raised to
|
||||||
@ -815,7 +815,7 @@ hll-sparse-max-bytes 3000
|
|||||||
# that is rehashing, the more rehashing "steps" are performed, so if the
|
# that is rehashing, the more rehashing "steps" are performed, so if the
|
||||||
# server is idle the rehashing is never complete and some more memory is used
|
# server is idle the rehashing is never complete and some more memory is used
|
||||||
# by the hash table.
|
# by the hash table.
|
||||||
#
|
#
|
||||||
# The default is to use this millisecond 10 times every second in order to
|
# The default is to use this millisecond 10 times every second in order to
|
||||||
# actively rehash the main dictionaries, freeing memory when possible.
|
# actively rehash the main dictionaries, freeing memory when possible.
|
||||||
#
|
#
|
||||||
|
@ -74,7 +74,7 @@ void aofRewriteBufferReset(void) {
|
|||||||
listSetFreeMethod(server.aof_rewrite_buf_blocks,zfree);
|
listSetFreeMethod(server.aof_rewrite_buf_blocks,zfree);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the current size of the AOF rewite buffer. */
|
/* Return the current size of the AOF rewrite buffer. */
|
||||||
unsigned long aofRewriteBufferSize(void) {
|
unsigned long aofRewriteBufferSize(void) {
|
||||||
listNode *ln;
|
listNode *ln;
|
||||||
listIter li;
|
listIter li;
|
||||||
@ -245,7 +245,7 @@ int startAppendOnly(void) {
|
|||||||
redisLog(REDIS_WARNING,"Redis needs to enable the AOF but can't trigger a background AOF rewrite operation. Check the above logs for more info about the error.");
|
redisLog(REDIS_WARNING,"Redis needs to enable the AOF but can't trigger a background AOF rewrite operation. Check the above logs for more info about the error.");
|
||||||
return REDIS_ERR;
|
return REDIS_ERR;
|
||||||
}
|
}
|
||||||
/* We correctly switched on AOF, now wait for the rewite to be complete
|
/* We correctly switched on AOF, now wait for the rewrite to be complete
|
||||||
* in order to append data on disk. */
|
* in order to append data on disk. */
|
||||||
server.aof_state = REDIS_AOF_WAIT_REWRITE;
|
server.aof_state = REDIS_AOF_WAIT_REWRITE;
|
||||||
return REDIS_OK;
|
return REDIS_OK;
|
||||||
|
@ -124,7 +124,7 @@ int clusterLoadConfig(char *filename) {
|
|||||||
return REDIS_ERR;
|
return REDIS_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse the file. Note that single liens of the cluster config file can
|
/* Parse the file. Note that single lines of the cluster config file can
|
||||||
* be really long as they include all the hash slots of the node.
|
* be really long as they include all the hash slots of the node.
|
||||||
* This means in the worst possible case, half of the Redis slots will be
|
* This means in the worst possible case, half of the Redis slots will be
|
||||||
* present in a single line, possibly in importing or migrating state, so
|
* present in a single line, possibly in importing or migrating state, so
|
||||||
@ -1133,7 +1133,7 @@ int clusterStartHandshake(char *ip, int port) {
|
|||||||
|
|
||||||
/* Add the node with a random address (NULL as first argument to
|
/* Add the node with a random address (NULL as first argument to
|
||||||
* createClusterNode()). Everything will be fixed during the
|
* createClusterNode()). Everything will be fixed during the
|
||||||
* handskake. */
|
* handshake. */
|
||||||
n = createClusterNode(NULL,REDIS_NODE_HANDSHAKE|REDIS_NODE_MEET);
|
n = createClusterNode(NULL,REDIS_NODE_HANDSHAKE|REDIS_NODE_MEET);
|
||||||
memcpy(n->ip,norm_ip,sizeof(n->ip));
|
memcpy(n->ip,norm_ip,sizeof(n->ip));
|
||||||
n->port = port;
|
n->port = port;
|
||||||
@ -1284,7 +1284,7 @@ void clusterSetNodeAsMaster(clusterNode *n) {
|
|||||||
* node (see the function comments for more info).
|
* node (see the function comments for more info).
|
||||||
*
|
*
|
||||||
* The 'sender' is the node for which we received a configuration update.
|
* The 'sender' is the node for which we received a configuration update.
|
||||||
* Sometimes it is not actaully the "Sender" of the information, like in the case
|
* Sometimes it is not actually the "Sender" of the information, like in the case
|
||||||
* we receive the info via an UPDATE packet. */
|
* we receive the info via an UPDATE packet. */
|
||||||
void clusterUpdateSlotsConfigWith(clusterNode *sender, uint64_t senderConfigEpoch, unsigned char *slots) {
|
void clusterUpdateSlotsConfigWith(clusterNode *sender, uint64_t senderConfigEpoch, unsigned char *slots) {
|
||||||
int j;
|
int j;
|
||||||
@ -1597,7 +1597,7 @@ int clusterProcessPacket(clusterLink *link) {
|
|||||||
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
||||||
CLUSTER_TODO_UPDATE_STATE);
|
CLUSTER_TODO_UPDATE_STATE);
|
||||||
}
|
}
|
||||||
/* Free this node as we alrady have it. This will
|
/* Free this node as we already have it. This will
|
||||||
* cause the link to be freed as well. */
|
* cause the link to be freed as well. */
|
||||||
freeClusterNode(link->node);
|
freeClusterNode(link->node);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1794,7 +1794,7 @@ int clusterProcessPacket(clusterLink *link) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
redisLog(REDIS_NOTICE,
|
redisLog(REDIS_NOTICE,
|
||||||
"Ignoring FAIL message from unknonw node %.40s about %.40s",
|
"Ignoring FAIL message from unknown node %.40s about %.40s",
|
||||||
hdr->sender, hdr->data.fail.about.nodename);
|
hdr->sender, hdr->data.fail.about.nodename);
|
||||||
}
|
}
|
||||||
} else if (type == CLUSTERMSG_TYPE_PUBLISH) {
|
} else if (type == CLUSTERMSG_TYPE_PUBLISH) {
|
||||||
@ -1863,7 +1863,7 @@ int clusterProcessPacket(clusterLink *link) {
|
|||||||
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
||||||
CLUSTER_TODO_FSYNC_CONFIG);
|
CLUSTER_TODO_FSYNC_CONFIG);
|
||||||
|
|
||||||
/* Check the bitmap of served slots and udpate our
|
/* Check the bitmap of served slots and update our
|
||||||
* config accordingly. */
|
* config accordingly. */
|
||||||
clusterUpdateSlotsConfigWith(n,reportedConfigEpoch,
|
clusterUpdateSlotsConfigWith(n,reportedConfigEpoch,
|
||||||
hdr->data.update.nodecfg.slots);
|
hdr->data.update.nodecfg.slots);
|
||||||
@ -2761,7 +2761,7 @@ void clusterHandleManualFailover(void) {
|
|||||||
/* Return ASAP if no manual failover is in progress. */
|
/* Return ASAP if no manual failover is in progress. */
|
||||||
if (server.cluster->mf_end == 0) return;
|
if (server.cluster->mf_end == 0) return;
|
||||||
|
|
||||||
/* If mf_can_start is non-zero, the failover was alrady triggered so the
|
/* If mf_can_start is non-zero, the failover was already triggered so the
|
||||||
* next steps are performed by clusterHandleSlaveFailover(). */
|
* next steps are performed by clusterHandleSlaveFailover(). */
|
||||||
if (server.cluster->mf_can_start) return;
|
if (server.cluster->mf_can_start) return;
|
||||||
|
|
||||||
@ -3300,7 +3300,7 @@ int verifyClusterConfigWithData(void) {
|
|||||||
* assigned to this slot. Fix this condition. */
|
* assigned to this slot. Fix this condition. */
|
||||||
|
|
||||||
update_config++;
|
update_config++;
|
||||||
/* Case A: slot is unassigned. Take responsability for it. */
|
/* Case A: slot is unassigned. Take responsibility for it. */
|
||||||
if (server.cluster->slots[j] == NULL) {
|
if (server.cluster->slots[j] == NULL) {
|
||||||
redisLog(REDIS_WARNING, "I have keys for unassigned slot %d. "
|
redisLog(REDIS_WARNING, "I have keys for unassigned slot %d. "
|
||||||
"Taking responsibility for it.",j);
|
"Taking responsibility for it.",j);
|
||||||
@ -3613,7 +3613,7 @@ void clusterCommand(redisClient *c) {
|
|||||||
int del = !strcasecmp(c->argv[1]->ptr,"delslots");
|
int del = !strcasecmp(c->argv[1]->ptr,"delslots");
|
||||||
|
|
||||||
memset(slots,0,REDIS_CLUSTER_SLOTS);
|
memset(slots,0,REDIS_CLUSTER_SLOTS);
|
||||||
/* Check that all the arguments are parsable and that all the
|
/* Check that all the arguments are parseable and that all the
|
||||||
* slots are not already busy. */
|
* slots are not already busy. */
|
||||||
for (j = 2; j < c->argc; j++) {
|
for (j = 2; j < c->argc; j++) {
|
||||||
if ((slot = getSlotOrReply(c,c->argv[j])) == -1) {
|
if ((slot = getSlotOrReply(c,c->argv[j])) == -1) {
|
||||||
@ -4180,14 +4180,14 @@ void restoreCommand(redisClient *c) {
|
|||||||
* This sockets are closed when the max number we cache is reached, and also
|
* This sockets are closed when the max number we cache is reached, and also
|
||||||
* in serverCron() when they are around for more than a few seconds. */
|
* in serverCron() when they are around for more than a few seconds. */
|
||||||
#define MIGRATE_SOCKET_CACHE_ITEMS 64 /* max num of items in the cache. */
|
#define MIGRATE_SOCKET_CACHE_ITEMS 64 /* max num of items in the cache. */
|
||||||
#define MIGRATE_SOCKET_CACHE_TTL 10 /* close cached socekts after 10 sec. */
|
#define MIGRATE_SOCKET_CACHE_TTL 10 /* close cached sockets after 10 sec. */
|
||||||
|
|
||||||
typedef struct migrateCachedSocket {
|
typedef struct migrateCachedSocket {
|
||||||
int fd;
|
int fd;
|
||||||
time_t last_use_time;
|
time_t last_use_time;
|
||||||
} migrateCachedSocket;
|
} migrateCachedSocket;
|
||||||
|
|
||||||
/* Return a TCP scoket connected with the target instance, possibly returning
|
/* Return a TCP socket connected with the target instance, possibly returning
|
||||||
* a cached one.
|
* a cached one.
|
||||||
*
|
*
|
||||||
* This function is responsible of sending errors to the client if a
|
* This function is responsible of sending errors to the client if a
|
||||||
@ -4196,7 +4196,7 @@ typedef struct migrateCachedSocket {
|
|||||||
* attempt to free it after usage.
|
* attempt to free it after usage.
|
||||||
*
|
*
|
||||||
* If the caller detects an error while using the socket, migrateCloseSocket()
|
* If the caller detects an error while using the socket, migrateCloseSocket()
|
||||||
* should be called so that the connection will be craeted from scratch
|
* should be called so that the connection will be created from scratch
|
||||||
* the next time. */
|
* the next time. */
|
||||||
int migrateGetSocket(redisClient *c, robj *host, robj *port, long timeout) {
|
int migrateGetSocket(redisClient *c, robj *host, robj *port, long timeout) {
|
||||||
int fd;
|
int fd;
|
||||||
@ -4452,7 +4452,7 @@ void askingCommand(redisClient *c) {
|
|||||||
addReply(c,shared.ok);
|
addReply(c,shared.ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The READONLY command is uesd by clients to enter the read-only mode.
|
/* The READONLY command is used by clients to enter the read-only mode.
|
||||||
* In this mode slaves will not redirect clients as long as clients access
|
* In this mode slaves will not redirect clients as long as clients access
|
||||||
* with read-only commands to keys that are served by the slave's master. */
|
* with read-only commands to keys that are served by the slave's master. */
|
||||||
void readonlyCommand(redisClient *c) {
|
void readonlyCommand(redisClient *c) {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#define REDIS_CLUSTER_NAMELEN 40 /* sha1 hex length */
|
#define REDIS_CLUSTER_NAMELEN 40 /* sha1 hex length */
|
||||||
#define REDIS_CLUSTER_PORT_INCR 10000 /* Cluster port = baseport + PORT_INCR */
|
#define REDIS_CLUSTER_PORT_INCR 10000 /* Cluster port = baseport + PORT_INCR */
|
||||||
|
|
||||||
/* The following defines are amunt of time, sometimes expressed as
|
/* The following defines are amount of time, sometimes expressed as
|
||||||
* multiplicators of the node timeout value (when ending with MULT). */
|
* multiplicators of the node timeout value (when ending with MULT). */
|
||||||
#define REDIS_CLUSTER_DEFAULT_NODE_TIMEOUT 15000
|
#define REDIS_CLUSTER_DEFAULT_NODE_TIMEOUT 15000
|
||||||
#define REDIS_CLUSTER_DEFAULT_SLAVE_VALIDITY 10 /* Slave max data age factor. */
|
#define REDIS_CLUSTER_DEFAULT_SLAVE_VALIDITY 10 /* Slave max data age factor. */
|
||||||
@ -51,7 +51,7 @@ typedef struct clusterLink {
|
|||||||
#define REDIS_NODE_HANDSHAKE 32 /* We have still to exchange the first ping */
|
#define REDIS_NODE_HANDSHAKE 32 /* We have still to exchange the first ping */
|
||||||
#define REDIS_NODE_NOADDR 64 /* We don't know the address of this node */
|
#define REDIS_NODE_NOADDR 64 /* We don't know the address of this node */
|
||||||
#define REDIS_NODE_MEET 128 /* Send a MEET message to this node */
|
#define REDIS_NODE_MEET 128 /* Send a MEET message to this node */
|
||||||
#define REDIS_NODE_PROMOTED 256 /* Master was a slave propoted by failover */
|
#define REDIS_NODE_PROMOTED 256 /* Master was a slave promoted by failover */
|
||||||
#define REDIS_NODE_NULL_NAME "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
#define REDIS_NODE_NULL_NAME "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
|
||||||
|
|
||||||
#define nodeIsMaster(n) ((n)->flags & REDIS_NODE_MASTER)
|
#define nodeIsMaster(n) ((n)->flags & REDIS_NODE_MASTER)
|
||||||
@ -117,7 +117,7 @@ typedef struct clusterState {
|
|||||||
or zero if stil not received. */
|
or zero if stil not received. */
|
||||||
int mf_can_start; /* If non-zero signal that the manual failover
|
int mf_can_start; /* If non-zero signal that the manual failover
|
||||||
can start requesting masters vote. */
|
can start requesting masters vote. */
|
||||||
/* The followign fields are uesd by masters to take state on elections. */
|
/* The followign fields are used by masters to take state on elections. */
|
||||||
uint64_t lastVoteEpoch; /* Epoch of the last vote granted. */
|
uint64_t lastVoteEpoch; /* Epoch of the last vote granted. */
|
||||||
int todo_before_sleep; /* Things to do in clusterBeforeSleep(). */
|
int todo_before_sleep; /* Things to do in clusterBeforeSleep(). */
|
||||||
long long stats_bus_messages_sent; /* Num of msg sent via cluster bus. */
|
long long stats_bus_messages_sent; /* Num of msg sent via cluster bus. */
|
||||||
|
@ -2106,7 +2106,7 @@ void sentinelPublishReplyCallback(redisAsyncContext *c, void *reply, void *privd
|
|||||||
* or sent directly to this sentinel via the (fake) PUBLISH command of Sentinel.
|
* or sent directly to this sentinel via the (fake) PUBLISH command of Sentinel.
|
||||||
*
|
*
|
||||||
* If the master name specified in the message is not known, the message is
|
* If the master name specified in the message is not known, the message is
|
||||||
* discareded. */
|
* discarded. */
|
||||||
void sentinelProcessHelloMessage(char *hello, int hello_len) {
|
void sentinelProcessHelloMessage(char *hello, int hello_len) {
|
||||||
/* Format is composed of 8 tokens:
|
/* Format is composed of 8 tokens:
|
||||||
* 0=ip,1=port,2=runid,3=current_epoch,4=master_name,
|
* 0=ip,1=port,2=runid,3=current_epoch,4=master_name,
|
||||||
|
@ -385,7 +385,7 @@ int string2l(const char *s, size_t slen, long *lval) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Convert a double to a string representation. Returns the number of bytes
|
/* Convert a double to a string representation. Returns the number of bytes
|
||||||
* required. The representation should always be parsable by stdtod(3). */
|
* required. The representation should always be parsable by strtod(3). */
|
||||||
int d2string(char *buf, size_t len, double value) {
|
int d2string(char *buf, size_t len, double value) {
|
||||||
if (isnan(value)) {
|
if (isnan(value)) {
|
||||||
len = snprintf(buf,len,"nan");
|
len = snprintf(buf,len,"nan");
|
||||||
|
@ -183,7 +183,7 @@ static unsigned int zipIntSize(unsigned char encoding) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Encode the length 'l' writing it in 'p'. If p is NULL it just returns
|
/* Encode the length 'rawlen' writing it in 'p'. If p is NULL it just returns
|
||||||
* the amount of bytes required to encode such a length. */
|
* the amount of bytes required to encode such a length. */
|
||||||
static unsigned int zipEncodeLength(unsigned char *p, unsigned char encoding, unsigned int rawlen) {
|
static unsigned int zipEncodeLength(unsigned char *p, unsigned char encoding, unsigned int rawlen) {
|
||||||
unsigned char len = 1, buf[5];
|
unsigned char len = 1, buf[5];
|
||||||
|
Loading…
Reference in New Issue
Block a user