MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / decodeTimeoutKey

Function decodeTimeoutKey

src/timeout.cpp:106–110  ·  view source on GitHub ↗

Given a key encoded with encodeTimeoutKey(), resolve the fields and write * the timeout into *toptr and the client pointer into *cptr. */

Source from the content-addressed store, hash-verified

104/* Given a key encoded with encodeTimeoutKey(), resolve the fields and write
105 * the timeout into *toptr and the client pointer into *cptr. */
106void decodeTimeoutKey(unsigned char *buf, uint64_t *toptr, client **cptr) {
107 memcpy(toptr,buf,sizeof(*toptr));
108 *toptr = ntohu64(*toptr);
109 memcpy(cptr,buf+8,sizeof(*cptr));
110}
111
112/* Add the specified client id / timeout as a key in the radix tree we use
113 * to handle blocked clients timeouts. The client is not added to the list

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected