Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
a0767430
Commit
a0767430
authored
Oct 31, 2014
by
Salvatore Sanfilippo
Browse files
Merge pull request #2110 from mattsta/more-outbound-bind-fixes
Networking: add more outbound IP binding fixes
parents
2c42b645
0014966c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
a0767430
...
@@ -4307,8 +4307,8 @@ int migrateGetSocket(redisClient *c, robj *host, robj *port, long timeout) {
...
@@ -4307,8 +4307,8 @@ int migrateGetSocket(redisClient *c, robj *host, robj *port, long timeout) {
}
}
/* Create the socket */
/* Create the socket */
fd = anetTcpNonBlockConnect(server.neterr,c->argv[1]->ptr,
fd = anetTcpNonBlock
Bind
Connect(server.neterr,c->argv[1]->ptr,
atoi(c->argv[2]->ptr));
atoi(c->argv[2]->ptr)
,REDIS_BIND_ADDR
);
if (fd == -1) {
if (fd == -1) {
sdsfree(name);
sdsfree(name);
addReplyErrorFormat(c,"Can't connect to target node: %s",
addReplyErrorFormat(c,"Can't connect to target node: %s",
...
...
src/replication.c
View file @
a0767430
...
@@ -1357,7 +1357,8 @@ error:
...
@@ -1357,7 +1357,8 @@ error:
int connectWithMaster(void) {
int connectWithMaster(void) {
int fd;
int fd;
fd
=
anetTcpNonBlockConnect
(
NULL
,
server
.
masterhost
,
server
.
masterport
);
fd = anetTcpNonBlockBindConnect(NULL,
server.masterhost,server.masterport,REDIS_BIND_ADDR);
if (fd == -1) {
if (fd == -1) {
redisLog(REDIS_WARNING,"Unable to connect to MASTER: %s",
redisLog(REDIS_WARNING,"Unable to connect to MASTER: %s",
strerror(errno));
strerror(errno));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment