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
d1e23e04
Commit
d1e23e04
authored
Jun 06, 2020
by
antirez
Browse files
Revert "avoid using sendfile if tls-replication is enabled"
This reverts commit
b9abecfc
.
parent
bdd54117
Changes
1
Show whitespace changes
Inline
Side-by-side
src/replication.c
View file @
d1e23e04
...
@@ -1067,12 +1067,8 @@ void sendBulkToSlave(connection *conn) {
...
@@ -1067,12 +1067,8 @@ void sendBulkToSlave(connection *conn) {
}
}
}
}
/* If the preamble was already transferred, send the RDB bulk data.
/* If the preamble was already transferred, send the RDB bulk data. */
* try to use sendfile system call if supported, unless tls is enabled.
* fallback to normal read+write otherwise. */
nwritten
=
0
;
#if HAVE_SENDFILE
#if HAVE_SENDFILE
if
(
!
server
.
tls_replication
)
{
if
((
nwritten
=
redis_sendfile
(
conn
->
fd
,
slave
->
repldbfd
,
if
((
nwritten
=
redis_sendfile
(
conn
->
fd
,
slave
->
repldbfd
,
slave
->
repldboff
,
PROTO_IOBUF_LEN
))
==
-
1
)
slave
->
repldboff
,
PROTO_IOBUF_LEN
))
==
-
1
)
{
{
...
@@ -1083,9 +1079,7 @@ void sendBulkToSlave(connection *conn) {
...
@@ -1083,9 +1079,7 @@ void sendBulkToSlave(connection *conn) {
}
}
return
;
return
;
}
}
}
#else
#endif
if
(
!
nwritten
)
{
ssize_t
buflen
;
ssize_t
buflen
;
char
buf
[
PROTO_IOBUF_LEN
];
char
buf
[
PROTO_IOBUF_LEN
];
...
@@ -1105,8 +1099,7 @@ void sendBulkToSlave(connection *conn) {
...
@@ -1105,8 +1099,7 @@ void sendBulkToSlave(connection *conn) {
}
}
return
;
return
;
}
}
}
#endif
slave
->
repldboff
+=
nwritten
;
slave
->
repldboff
+=
nwritten
;
server
.
stat_net_output_bytes
+=
nwritten
;
server
.
stat_net_output_bytes
+=
nwritten
;
if
(
slave
->
repldboff
==
slave
->
repldbsize
)
{
if
(
slave
->
repldboff
==
slave
->
repldbsize
)
{
...
...
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