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
86c76cad
"runtest-cluster" did not exist on "ac834d237a1b094eecd6ac2f36aa47b52b49466f"
Commit
86c76cad
authored
Mar 29, 2020
by
hwware
Browse files
add check for not switching between optin optout mode directly
parent
1ef44f82
Changes
1
Show whitespace changes
Inline
Side-by-side
src/networking.c
View file @
86c76cad
...
@@ -2314,7 +2314,7 @@ NULL
...
@@ -2314,7 +2314,7 @@ NULL
return
;
return
;
}
}
if
(
(
options
&
CLIENT_TRACKING_OPTIN
)
&&
(
options
&
CLIENT_TRACKING_OPTOUT
)
)
if
(
options
&
CLIENT_TRACKING_OPTIN
&&
options
&
CLIENT_TRACKING_OPTOUT
)
{
{
addReplyError
(
c
,
addReplyError
(
c
,
"You can't specify both OPTIN mode and OPTOUT mode"
);
"You can't specify both OPTIN mode and OPTOUT mode"
);
...
@@ -2322,6 +2322,17 @@ NULL
...
@@ -2322,6 +2322,17 @@ NULL
return
;
return
;
}
}
if
((
options
&
CLIENT_TRACKING_OPTIN
&&
c
->
flags
&
CLIENT_TRACKING_OPTOUT
)
||
(
options
&
CLIENT_TRACKING_OPTOUT
&&
c
->
flags
&
CLIENT_TRACKING_OPTIN
))
{
addReplyError
(
c
,
"You can't switch OPTIN/OPTOUT mode before disabling "
"tracking for this client, and then re-enabling it with "
"a different mode."
);
zfree
(
prefix
);
return
;
}
enableTracking
(
c
,
redir
,
options
,
prefix
,
numprefix
);
enableTracking
(
c
,
redir
,
options
,
prefix
,
numprefix
);
}
else
if
(
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"off"
))
{
}
else
if
(
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"off"
))
{
disableTracking
(
c
);
disableTracking
(
c
);
...
...
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