Skip to content

Commit

Permalink
adding assert
Browse files Browse the repository at this point in the history
Signed-off-by: Binbin <[email protected]>
  • Loading branch information
enjoy-binbin committed Oct 21, 2024
1 parent bd5fb97 commit 01e544f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -4440,6 +4440,7 @@ int checkClientOutputBufferLimits(client *c) {
* Returns 1 if client was (flagged) closed. */
int closeClientOnOutputBufferLimitReached(client *c, int async) {
if (c->flag.fake) return 0; /* It is unsafe to free fake clients. */
serverAssert(c->conn);
serverAssert(c->reply_bytes < SIZE_MAX - (1024 * 64));
/* Note that c->reply_bytes is irrelevant for replica clients
* (they use the global repl buffers). */
Expand Down
1 change: 1 addition & 0 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ int clientEvictionAllowed(client *c) {
if (server.maxmemory_clients == 0 || c->flag.no_evict || c->flag.fake) {
return 0;
}
serverAssert(c->conn);
int type = getClientType(c);
return (type == CLIENT_TYPE_NORMAL || type == CLIENT_TYPE_PUBSUB);
}
Expand Down

0 comments on commit 01e544f

Please sign in to comment.