| 2547 | } |
| 2548 | |
| 2549 | bool FClientReady(client *c) { |
| 2550 | /* Immediately abort if the client is in the middle of something. */ |
| 2551 | if (c->flags & CLIENT_BLOCKED) return false; |
| 2552 | if (c->flags & CLIENT_PENDING_COMMAND) return false; |
| 2553 | |
| 2554 | if (c->flags & CLIENT_EXECUTING_COMMAND) return false; |
| 2555 | |
| 2556 | /* Don't process input from the master while there is a busy script |
| 2557 | * condition on the replica. We want just to accumulate the replication |
| 2558 | * stream (instead of replying -BUSY like we do with other clients) and |
| 2559 | * later resume the processing. */ |
| 2560 | if (g_pserver->lua_timedout && c->flags & CLIENT_MASTER) return false; |
| 2561 | |
| 2562 | /* CLIENT_CLOSE_AFTER_REPLY closes the connection once the reply is |
| 2563 | * written to the client. Make sure to not let the reply grow after |
| 2564 | * this flag has been set (i.e. don't process more commands). |
| 2565 | * |
| 2566 | * The same applies for clients we want to terminate ASAP. */ |
| 2567 | if (c->flags & (CLIENT_CLOSE_AFTER_REPLY|CLIENT_CLOSE_ASAP)) return false; |
| 2568 | |
| 2569 | return true; |
| 2570 | } |
| 2571 | |
| 2572 | void parseClientCommandBuffer(client *c) { |
| 2573 | if (!FClientReady(c)) |
no outgoing calls
no test coverage detected