mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
add check for not switching between optin optout mode directly
This commit is contained in:
parent
1ef44f8243
commit
86c76cad74
@ -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
|
|||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user