Handle more Redis RESP3 protocol pieces

This passes the "minimum protocol version" along in the reply and adds
support for attributes, which were added relatively recently.
This commit is contained in:
Evan Typanski 2025-06-26 11:52:05 -04:00
parent b34d3ff2f0
commit 64443e5e5a
13 changed files with 115 additions and 30 deletions

View file

@ -296,6 +296,12 @@ event Redis::reply(c: connection, data: ReplyData)
if ( ! c?$redis_state )
make_new_state(c);
if ( data$min_protocol_version == 3 )
{
c$redis_state$resp_version = RESP3;
c$redis_state$subscribed_mode = F;
}
if ( c$redis_state$subscribed_mode )
{
event server_push(c, data);

View file

@ -60,7 +60,12 @@ export {
## A generic Redis reply from the client.
type ReplyData: record {
value: string &log &optional;
## The RESP3 attributes applied to this, if any
attributes: string &optional;
## The string version of the reply data
value: string &log;
## The minimum RESP version that supports this reply type
min_protocol_version: count;
};
}