MCPcopy Create free account
hub / github.com/F-Stack/f-stack / linkClient

Function linkClient

app/redis-6.2.6/src/networking.c:90–98  ·  view source on GitHub ↗

This function links the client to the global linked list of clients. * unlinkClient() does the opposite, among other things. */

Source from the content-addressed store, hash-verified

88/* This function links the client to the global linked list of clients.
89 * unlinkClient() does the opposite, among other things. */
90void 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 */

Callers 2

createClientFunction · 0.85

Calls 2

listAddNodeTailFunction · 0.85
raxInsertFunction · 0.85

Tested by

no test coverage detected