Check if this blocked client timedout (does nothing if the client is * not blocked right now). If so send a reply, unblock it, and return 1. * Otherwise 0 is returned and no operation is performed. */
| 35 | * not blocked right now). If so send a reply, unblock it, and return 1. |
| 36 | * Otherwise 0 is returned and no operation is performed. */ |
| 37 | int checkBlockedClientTimeout(client *c, mstime_t now) { |
| 38 | if (c->flags & CLIENT_BLOCKED && |
| 39 | c->bpop.timeout != 0 |
| 40 | && c->bpop.timeout < now) |
| 41 | { |
| 42 | /* Handle blocking operation specific timeout. */ |
| 43 | replyToBlockedClientTimedOut(c); |
| 44 | unblockClient(c); |
| 45 | return 1; |
| 46 | } else { |
| 47 | return 0; |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | /* Check for timeouts. Returns non-zero if the client was terminated. |
| 52 | * The function gets the current time in milliseconds as argument since |
no test coverage detected