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