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 */
| 3913 | * it aborts the transaction. |
| 3914 | * Note: 'reply' is expected to end with \r\n */ |
| 3915 | void 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 | |
| 3926 | void rejectCommandFormat(client *c, const char *fmt, ...) { |
| 3927 | if (c->cmd) c->cmd->rejected_calls++; |
no test coverage detected