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

Function logCurrentClient

app/redis-6.2.6/src/debug.c:1606–1640  ·  view source on GitHub ↗

Log information about the "current" client, that is, the client that is * currently being served by Redis. May be NULL if Redis is not serving a * client right now. */

Source from the content-addressed store, hash-verified

1604 * currently being served by Redis. May be NULL if Redis is not serving a
1605 * client right now. */
1606void logCurrentClient(void) {
1607 if (server.current_client == NULL) return;
1608
1609 client *cc = server.current_client;
1610 sds client;
1611 int j;
1612
1613 serverLogRaw(LL_WARNING|LL_RAW, "\n------ CURRENT CLIENT INFO ------\n");
1614 client = catClientInfoString(sdsempty(),cc);
1615 serverLog(LL_WARNING|LL_RAW,"%s\n", client);
1616 sdsfree(client);
1617 for (j = 0; j < cc->argc; j++) {
1618 robj *decoded;
1619
1620 decoded = getDecodedObject(cc->argv[j]);
1621 serverLog(LL_WARNING|LL_RAW,"argv[%d]: '%s'\n", j,
1622 (char*)decoded->ptr);
1623 decrRefCount(decoded);
1624 }
1625 /* Check if the first argument, usually a key, is found inside the
1626 * selected DB, and if so print info about the associated object. */
1627 if (cc->argc > 1) {
1628 robj *val, *key;
1629 dictEntry *de;
1630
1631 key = getDecodedObject(cc->argv[1]);
1632 de = dictFind(cc->db->dict, key->ptr);
1633 if (de) {
1634 val = dictGetVal(de);
1635 serverLog(LL_WARNING,"key '%s' found in DB containing the following object:", (char*)key->ptr);
1636 serverLogObjectDebugInfo(val);
1637 }
1638 decrRefCount(key);
1639 }
1640}
1641
1642#if defined(HAVE_PROC_MAPS)
1643

Callers 1

printCrashReportFunction · 0.85

Calls 8

serverLogRawFunction · 0.85
catClientInfoStringFunction · 0.85
sdsemptyFunction · 0.85
sdsfreeFunction · 0.85
getDecodedObjectFunction · 0.85
decrRefCountFunction · 0.85
serverLogObjectDebugInfoFunction · 0.85
dictFindFunction · 0.70

Tested by

no test coverage detected