Remove trailing spaces from cluster.c file.

This commit is contained in:
antirez 2014-05-15 10:18:16 +02:00
parent 0b7aa26164
commit 8b9d5ecbd1

View File

@ -102,7 +102,7 @@ int clusterLoadConfig(char *filename) {
struct stat sb; struct stat sb;
char *line; char *line;
int maxline, j; int maxline, j;
if (fp == NULL) { if (fp == NULL) {
if (errno == ENOENT) { if (errno == ENOENT) {
return REDIS_ERR; return REDIS_ERR;
@ -311,7 +311,7 @@ int clusterSaveConfig(int do_fsync) {
(unsigned long long) server.cluster->currentEpoch, (unsigned long long) server.cluster->currentEpoch,
(unsigned long long) server.cluster->lastVoteEpoch); (unsigned long long) server.cluster->lastVoteEpoch);
content_size = sdslen(ci); content_size = sdslen(ci);
if ((fd = open(server.cluster_configfile,O_WRONLY|O_CREAT,0644)) if ((fd = open(server.cluster_configfile,O_WRONLY|O_CREAT,0644))
== -1) goto err; == -1) goto err;
@ -751,7 +751,7 @@ void freeClusterNode(clusterNode *n) {
/* Add a node to the nodes hash table */ /* Add a node to the nodes hash table */
int clusterAddNode(clusterNode *node) { int clusterAddNode(clusterNode *node) {
int retval; int retval;
retval = dictAdd(server.cluster->nodes, retval = dictAdd(server.cluster->nodes,
sdsnewlen(node->name,REDIS_CLUSTER_NAMELEN), node); sdsnewlen(node->name,REDIS_CLUSTER_NAMELEN), node);
return (retval == DICT_OK) ? REDIS_OK : REDIS_ERR; return (retval == DICT_OK) ? REDIS_OK : REDIS_ERR;
@ -814,7 +814,7 @@ clusterNode *clusterLookupNode(char *name) {
void clusterRenameNode(clusterNode *node, char *newname) { void clusterRenameNode(clusterNode *node, char *newname) {
int retval; int retval;
sds s = sdsnewlen(node->name, REDIS_CLUSTER_NAMELEN); sds s = sdsnewlen(node->name, REDIS_CLUSTER_NAMELEN);
redisLog(REDIS_DEBUG,"Renaming node %.40s into %.40s", redisLog(REDIS_DEBUG,"Renaming node %.40s into %.40s",
node->name, newname); node->name, newname);
retval = dictDelete(server.cluster->nodes, s); retval = dictDelete(server.cluster->nodes, s);
@ -1783,7 +1783,7 @@ int clusterProcessPacket(clusterLink *link) {
/* This function is called when we detect the link with this node is lost. /* This function is called when we detect the link with this node is lost.
We set the node as no longer connected. The Cluster Cron will detect We set the node as no longer connected. The Cluster Cron will detect
this connection and will try to get it connected again. this connection and will try to get it connected again.
Instead if the node is a temporary node used to accept a query, we Instead if the node is a temporary node used to accept a query, we
completely free the node on error. */ completely free the node on error. */
void handleLinkIOError(clusterLink *link) { void handleLinkIOError(clusterLink *link) {
@ -1893,7 +1893,7 @@ void clusterSendMessage(clusterLink *link, unsigned char *msg, size_t msglen) {
/* Send a message to all the nodes that are part of the cluster having /* Send a message to all the nodes that are part of the cluster having
* a connected link. * a connected link.
* *
* It is guaranteed that this function will never have as a side effect * It is guaranteed that this function will never have as a side effect
* some node->link to be invalidated, so it is safe to call this function * some node->link to be invalidated, so it is safe to call this function
* from event handlers that will do stuff with node links later. */ * from event handlers that will do stuff with node links later. */
@ -1987,7 +1987,7 @@ void clusterSendPing(clusterLink *link, int type) {
if (link->node && type == CLUSTERMSG_TYPE_PING) if (link->node && type == CLUSTERMSG_TYPE_PING)
link->node->ping_sent = mstime(); link->node->ping_sent = mstime();
clusterBuildMessageHdr(hdr,type); clusterBuildMessageHdr(hdr,type);
/* Populate the gossip fields */ /* Populate the gossip fields */
while(freshnodes > 0 && gossipcount < 3) { while(freshnodes > 0 && gossipcount < 3) {
dictEntry *de = dictGetRandomKey(server.cluster->nodes); dictEntry *de = dictGetRandomKey(server.cluster->nodes);
@ -3052,7 +3052,7 @@ void clusterUpdateState(void) {
* of the netsplit because of lack of majority. */ * of the netsplit because of lack of majority. */
{ {
int needed_quorum = (server.cluster->size / 2) + 1; int needed_quorum = (server.cluster->size / 2) + 1;
if (unreachable_masters >= needed_quorum) { if (unreachable_masters >= needed_quorum) {
new_state = REDIS_CLUSTER_FAIL; new_state = REDIS_CLUSTER_FAIL;
among_minority_time = mstime(); among_minority_time = mstime();
@ -4028,7 +4028,7 @@ try_again:
addReplySds(c,sdsnew("+NOKEY\r\n")); addReplySds(c,sdsnew("+NOKEY\r\n"));
return; return;
} }
/* Connect */ /* Connect */
fd = migrateGetSocket(c,c->argv[1],c->argv[2],timeout); fd = migrateGetSocket(c,c->argv[1],c->argv[2],timeout);
if (fd == -1) return; /* error sent to the client by migrateGetSocket() */ if (fd == -1) return; /* error sent to the client by migrateGetSocket() */