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

Function randomizeClientKey

src/keydb-diagnostic-tool.cpp:309–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307}
308
309static void randomizeClientKey(client c) {
310 size_t i;
311
312 for (i = 0; i < c->randlen; i++) {
313 char *p = c->randptr[i]+11;
314 size_t r = 0;
315 if (config.randomkeys_keyspacelen != 0)
316 r = random() % config.randomkeys_keyspacelen;
317 size_t j;
318
319 for (j = 0; j < 12; j++) {
320 *p = '0'+r%10;
321 r/=10;
322 p--;
323 }
324 }
325}
326
327static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
328 client c = (client)privdata;

Callers 1

writeHandlerFunction · 0.70

Calls 1

randomFunction · 0.85

Tested by

no test coverage detected