summaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
authorIgor Malinovskiy <u.glide@gmail.com>2023-03-22 07:17:20 +0100
committerGitHub <noreply@github.com>2023-03-22 08:17:20 +0200
commitc3b9f2fbd9085f4c9ea3151cc88d3b31c0d30b91 (patch)
tree68c2a78c10cd59274aa7d0a24d9ea137805d0415 /src/server.h
parent6948dacaf63415c6cabce207cd7d23dcb37dd5e1 (diff)
downloadredis-c3b9f2fbd9085f4c9ea3151cc88d3b31c0d30b91.tar.gz
Allow clients to report name and version (#11758)
This PR allows clients to send information about the client library to redis to be displayed in CLIENT LIST and CLIENT INFO. Currently supports: `CLIENT [lib-name | lib-ver] <value>` Client libraries are expected to pipeline these right after AUTH, and ignore the failure in case they're talking to an older version of redis. These will be shown in CLIENT LIST and CLIENT INFO as: * `lib-name` - meant to hold the client library name. * `lib-ver` - meant to hold the client library version. The values cannot contain spaces, newlines and any wild ASCII characters, but all other normal chars are accepted, e.g `.`, `=` etc (same as CLIENT NAME). The RESET command does NOT clear these, but they can be cleared to the default by sending a command with a blank string. Co-authored-by: Oran Agra <oran@redislabs.com>
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/server.h b/src/server.h
index 0cc15f3e3..1a68071f1 100644
--- a/src/server.h
+++ b/src/server.h
@@ -1151,6 +1151,8 @@ typedef struct client {
int resp; /* RESP protocol version. Can be 2 or 3. */
redisDb *db; /* Pointer to currently SELECTed DB. */
robj *name; /* As set by CLIENT SETNAME. */
+ robj *lib_name; /* The client library name as set by CLIENT SETINFO. */
+ robj *lib_ver; /* The client library version as set by CLIENT SETINFO. */
sds querybuf; /* Buffer we use to accumulate client queries. */
size_t qb_pos; /* The position we have read in querybuf. */
size_t querybuf_peak; /* Recent (100ms or more) peak of querybuf size. */
@@ -3639,6 +3641,7 @@ void objectCommand(client *c);
void memoryCommand(client *c);
void clientCommand(client *c);
void helloCommand(client *c);
+void clientSetinfoCommand(client *c);
void evalCommand(client *c);
void evalRoCommand(client *c);
void evalShaCommand(client *c);