Skip to content

Commit

Permalink
Add availability_zone to the HELLO response
Browse files Browse the repository at this point in the history
Signed-off-by: Rueian <[email protected]>
  • Loading branch information
rueian committed Dec 26, 2024
1 parent bb325bd commit 52d314c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -4195,7 +4195,7 @@ void helloCommand(client *c) {

/* Let's switch to the specified RESP mode. */
if (ver) c->resp = ver;
addReplyMapLen(c, 6 + !server.sentinel_mode);
addReplyMapLen(c, 6 + !server.sentinel_mode + (sdslen(server.availability_zone) != 0));

addReplyBulkCString(c, "server");
addReplyBulkCString(c, server.extended_redis_compat ? "redis" : SERVER_NAME);
Expand Down Expand Up @@ -4224,6 +4224,11 @@ void helloCommand(client *c) {

addReplyBulkCString(c, "modules");
addReplyLoadedModules(c);

if (sdslen(server.availability_zone) != 0) {
addReplyBulkCString(c, "availability_zone");
addReplyBulkCBuffer(c, server.availability_zone, sdslen(server.availability_zone));
}
}

/* This callback is bound to POST and "Host:" command names. Those are not
Expand Down

0 comments on commit 52d314c

Please sign in to comment.