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
d036abe2
"src/vscode:/vscode.git/clone" did not exist on "2e1bc942aa00a76ed3b0e5e2678da4ac90071d19"
Commit
d036abe2
authored
Aug 21, 2015
by
antirez
Browse files
Log client details on SLAVEOF command having an effect.
parent
f18e5b63
Changes
1
Show whitespace changes
Inline
Side-by-side
src/replication.c
View file @
d036abe2
...
@@ -1723,7 +1723,10 @@ void slaveofCommand(client *c) {
...
@@ -1723,7 +1723,10 @@ void slaveofCommand(client *c) {
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"one"
))
{
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"one"
))
{
if
(
server
.
masterhost
)
{
if
(
server
.
masterhost
)
{
replicationUnsetMaster
();
replicationUnsetMaster
();
serverLog
(
LL_NOTICE
,
"MASTER MODE enabled (user request)"
);
sds
client
=
catClientInfoString
(
sdsempty
(),
c
);
serverLog
(
LL_NOTICE
,
"MASTER MODE enabled (user request from '%s')"
,
client
);
sdsfree
(
client
);
}
}
}
else
{
}
else
{
long
port
;
long
port
;
...
@@ -1741,8 +1744,10 @@ void slaveofCommand(client *c) {
...
@@ -1741,8 +1744,10 @@ void slaveofCommand(client *c) {
/* There was no previous master or the user specified a different one,
/* There was no previous master or the user specified a different one,
* we can continue. */
* we can continue. */
replicationSetMaster
(
c
->
argv
[
1
]
->
ptr
,
port
);
replicationSetMaster
(
c
->
argv
[
1
]
->
ptr
,
port
);
serverLog
(
LL_NOTICE
,
"SLAVE OF %s:%d enabled (user request)"
,
sds
client
=
catClientInfoString
(
sdsempty
(),
c
);
server
.
masterhost
,
server
.
masterport
);
serverLog
(
LL_NOTICE
,
"SLAVE OF %s:%d enabled (user request from '%s')"
,
server
.
masterhost
,
server
.
masterport
,
client
);
sdsfree
(
client
);
}
}
addReply
(
c
,
shared
.
ok
);
addReply
(
c
,
shared
.
ok
);
}
}
...
...
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