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
b6fe152b
Commit
b6fe152b
authored
Oct 18, 2011
by
antirez
Browse files
Fix to the previous fix for issue #145, make sure to return only after the event was unregistered.
parent
1270a136
Changes
1
Show whitespace changes
Inline
Side-by-side
src/replication.c
View file @
b6fe152b
...
@@ -376,6 +376,12 @@ void syncWithMaster(aeEventLoop *el, int fd, void *privdata, int mask) {
...
@@ -376,6 +376,12 @@ void syncWithMaster(aeEventLoop *el, int fd, void *privdata, int mask) {
REDIS_NOTUSED
(
privdata
);
REDIS_NOTUSED
(
privdata
);
REDIS_NOTUSED
(
mask
);
REDIS_NOTUSED
(
mask
);
redisLog
(
REDIS_NOTICE
,
"Non blocking connect for SYNC fired the event."
);
/* This event should only be triggered once since it is used to have a
* non-blocking connect(2) to the master. It has been triggered when this
* function is called, so we can delete it. */
aeDeleteFileEvent
(
server
.
el
,
fd
,
AE_READABLE
|
AE_WRITABLE
);
/* If this event fired after the user turned the instance into a master
/* If this event fired after the user turned the instance into a master
* with SLAVEOF NO ONE we must just return ASAP. */
* with SLAVEOF NO ONE we must just return ASAP. */
if
(
server
.
replstate
==
REDIS_REPL_NONE
)
{
if
(
server
.
replstate
==
REDIS_REPL_NONE
)
{
...
@@ -383,12 +389,6 @@ void syncWithMaster(aeEventLoop *el, int fd, void *privdata, int mask) {
...
@@ -383,12 +389,6 @@ void syncWithMaster(aeEventLoop *el, int fd, void *privdata, int mask) {
return
;
return
;
}
}
redisLog
(
REDIS_NOTICE
,
"Non blocking connect for SYNC fired the event."
);
/* This event should only be triggered once since it is used to have a
* non-blocking connect(2) to the master. It has been triggered when this
* function is called, so we can delete it. */
aeDeleteFileEvent
(
server
.
el
,
fd
,
AE_READABLE
|
AE_WRITABLE
);
/* AUTH with the master if required. */
/* AUTH with the master if required. */
if
(
server
.
masterauth
)
{
if
(
server
.
masterauth
)
{
char
authcmd
[
1024
];
char
authcmd
[
1024
];
...
...
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