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. */
| 1604 | * currently being served by Redis. May be NULL if Redis is not serving a |
| 1605 | * client right now. */ |
| 1606 | void 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 |
no test coverage detected