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
8d6dc136
Unverified
Commit
8d6dc136
authored
Apr 02, 2020
by
Salvatore Sanfilippo
Committed by
GitHub
Apr 02, 2020
Browse files
Merge pull request #7041 from hwware/trackingfix
CLIENT TRACKING Command Fix: Add More Checking for OPTIN/OPTOUT mode
parents
b73d87f5
86c76cad
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/networking.c
View file @
8d6dc136
...
@@ -2326,6 +2326,25 @@ NULL
...
@@ -2326,6 +2326,25 @@ NULL
return
;
return
;
}
}
if
(
options
&
CLIENT_TRACKING_OPTIN
&&
options
&
CLIENT_TRACKING_OPTOUT
)
{
addReplyError
(
c
,
"You can't specify both OPTIN mode and OPTOUT mode"
);
zfree
(
prefix
);
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