This function links the client to the global linked list of clients. * unlinkClient() does the opposite, among other things. */
| 88 | /* This function links the client to the global linked list of clients. |
| 89 | * unlinkClient() does the opposite, among other things. */ |
| 90 | void linkClient(client *c) { |
| 91 | listAddNodeTail(server.clients,c); |
| 92 | /* Note that we remember the linked list node where the client is stored, |
| 93 | * this way removing the client in unlinkClient() will not require |
| 94 | * a linear scan, but just a constant time operation. */ |
| 95 | c->client_list_node = listLast(server.clients); |
| 96 | uint64_t id = htonu64(c->id); |
| 97 | raxInsert(server.clients_index,(unsigned char*)&id,sizeof(id),c,NULL); |
| 98 | } |
| 99 | |
| 100 | /* Initialize client authentication state. |
| 101 | */ |
no test coverage detected