mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
chore: Add CLIENT ID
command (#3672)
We already adhere to all requirements, we just need to return the id when the command is issued :) Fixes #3651
This commit is contained in:
parent
0e7c12f5d6
commit
1306a91bda
1 changed files with 10 additions and 0 deletions
|
@ -541,6 +541,14 @@ void ClientCaching(CmdArgList args, ConnectionContext* cntx) {
|
|||
cntx->SendOk();
|
||||
}
|
||||
|
||||
void ClientId(CmdArgList args, ConnectionContext* cntx) {
|
||||
if (args.size() != 0) {
|
||||
return cntx->SendError(kSyntaxErr);
|
||||
}
|
||||
|
||||
return cntx->SendLong(cntx->conn()->GetClientId());
|
||||
}
|
||||
|
||||
void ClientKill(CmdArgList args, absl::Span<facade::Listener*> listeners, ConnectionContext* cntx) {
|
||||
std::function<bool(facade::Connection * conn)> evaluator;
|
||||
|
||||
|
@ -1762,6 +1770,8 @@ void ServerFamily::Client(CmdArgList args, ConnectionContext* cntx) {
|
|||
return ClientKill(sub_args, absl::MakeSpan(listeners_), cntx);
|
||||
} else if (sub_cmd == "CACHING") {
|
||||
return ClientCaching(sub_args, cntx);
|
||||
} else if (sub_cmd == "ID") {
|
||||
return ClientId(sub_args, cntx);
|
||||
}
|
||||
|
||||
if (sub_cmd == "SETINFO") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue