MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rejectCommand

Function rejectCommand

app/redis-6.2.6/src/server.c:3915–3924  ·  view source on GitHub ↗

Used when a command that is ready for execution needs to be rejected, due to * varios pre-execution checks. it returns the appropriate error to the client. * If there's a transaction is flags it as dirty, and if the command is EXEC, * it aborts the transaction. * Note: 'reply' is expected to end with \r\n */

Source from the content-addressed store, hash-verified

3913 * it aborts the transaction.
3914 * Note: 'reply' is expected to end with \r\n */
3915void rejectCommand(client *c, robj *reply) {
3916 flagTransaction(c);
3917 if (c->cmd) c->cmd->rejected_calls++;
3918 if (c->cmd && c->cmd->proc == execCommand) {
3919 execCommandAbort(c, reply->ptr);
3920 } else {
3921 /* using addReplyError* rather than addReply so that the error can be logged. */
3922 addReplyErrorObject(c, reply);
3923 }
3924}
3925
3926void rejectCommandFormat(client *c, const char *fmt, ...) {
3927 if (c->cmd) c->cmd->rejected_calls++;

Callers 1

processCommandFunction · 0.85

Calls 3

flagTransactionFunction · 0.85
execCommandAbortFunction · 0.85
addReplyErrorObjectFunction · 0.85

Tested by

no test coverage detected