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
dda93651
Commit
dda93651
authored
Aug 24, 2010
by
antirez
Browse files
slave now detect lost connection during SYNC, fixing Issue 173
parent
3a1ab86a
Changes
1
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
dda93651
...
@@ -8074,9 +8074,9 @@ static int syncWithMaster(void) {
...
@@ -8074,9 +8074,9 @@ static int syncWithMaster(void) {
int
nread
,
nwritten
;
int
nread
,
nwritten
;
nread
=
read
(
fd
,
buf
,(
dumpsize
<
1024
)
?
dumpsize
:
1024
);
nread
=
read
(
fd
,
buf
,(
dumpsize
<
1024
)
?
dumpsize
:
1024
);
if
(
nread
=
=
-
1
)
{
if
(
nread
<
=
0
)
{
redisLog
(
REDIS_WARNING
,
"I/O error trying to sync with MASTER: %s"
,
redisLog
(
REDIS_WARNING
,
"I/O error trying to sync with MASTER: %s"
,
strerror
(
errno
)
);
(
nread
==
-
1
)
?
strerror
(
errno
)
:
"connection lost"
);
close
(
fd
);
close
(
fd
);
close
(
dfd
);
close
(
dfd
);
return
REDIS_ERR
;
return
REDIS_ERR
;
...
...
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