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

Function encodeTimeoutKey

app/redis-6.2.6/src/timeout.c:96–101  ·  view source on GitHub ↗

Given client ID and timeout, write the resulting radix tree key in buf. */

Source from the content-addressed store, hash-verified

94
95/* Given client ID and timeout, write the resulting radix tree key in buf. */
96void encodeTimeoutKey(unsigned char *buf, uint64_t timeout, client *c) {
97 timeout = htonu64(timeout);
98 memcpy(buf,&timeout,sizeof(timeout));
99 memcpy(buf+8,&c,sizeof(c));
100 if (sizeof(c) == 4) memset(buf+12,0,4); /* Zero padding for 32bit target. */
101}
102
103/* Given a key encoded with encodeTimeoutKey(), resolve the fields and write
104 * the timeout into *toptr and the client pointer into *cptr. */

Callers 2

addClientToTimeoutTableFunction · 0.85

Calls 2

memsetFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected