Add the specified client id / timeout as a key in the radix tree we use * to handle blocked clients timeouts. The client is not added to the list * if its timeout is zero (block forever). */
| 112 | * to handle blocked clients timeouts. The client is not added to the list |
| 113 | * if its timeout is zero (block forever). */ |
| 114 | void addClientToTimeoutTable(client *c) { |
| 115 | if (c->bpop.timeout == 0) return; |
| 116 | uint64_t timeout = c->bpop.timeout; |
| 117 | unsigned char buf[CLIENT_ST_KEYLEN]; |
| 118 | encodeTimeoutKey(buf,timeout,c); |
| 119 | if (raxTryInsert(server.clients_timeout_table,buf,sizeof(buf),NULL,NULL)) |
| 120 | c->flags |= CLIENT_IN_TO_TABLE; |
| 121 | } |
| 122 | |
| 123 | /* Remove the client from the table when it is unblocked for reasons |
| 124 | * different than timing out. */ |
no test coverage detected