Return a client by ID, or NULL if the client ID is not in the set * of registered clients. Note that "fake clients", created with -1 as FD, * are not registered clients. */
| 1489 | * of registered clients. Note that "fake clients", created with -1 as FD, |
| 1490 | * are not registered clients. */ |
| 1491 | client *lookupClientByID(uint64_t id) { |
| 1492 | id = htonu64(id); |
| 1493 | client *c = raxFind(server.clients_index,(unsigned char*)&id,sizeof(id)); |
| 1494 | return (c == raxNotFound) ? NULL : c; |
| 1495 | } |
| 1496 | |
| 1497 | /* Write data in output buffers to client. Return C_OK if the client |
| 1498 | * is still valid after the call, C_ERR if it was freed because of some |
no test coverage detected