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

Function _serverAssertPrintClientInfo

src/debug.cpp:1022–1045  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1020}
1021
1022void _serverAssertPrintClientInfo(const client *c) {
1023 int j;
1024 char conninfo[CONN_INFO_LEN];
1025
1026 bugReportStart();
1027 serverLog(LL_WARNING,"=== ASSERTION FAILED CLIENT CONTEXT ===");
1028 serverLog(LL_WARNING,"client->flags = %llu", (unsigned long long) c->flags);
1029 serverLog(LL_WARNING,"client->conn = %s", connGetInfo(c->conn, conninfo, sizeof(conninfo)));
1030 serverLog(LL_WARNING,"client->argc = %d", c->argc);
1031 for (j=0; j < c->argc; j++) {
1032 char buf[128];
1033 char *arg;
1034
1035 if (c->argv[j]->type == OBJ_STRING && sdsEncodedObject(c->argv[j])) {
1036 arg = (char*) ptrFromObj(c->argv[j]);
1037 } else {
1038 snprintf(buf,sizeof(buf),"Object type: %u, encoding: %u",
1039 c->argv[j]->type, c->argv[j]->encoding);
1040 arg = buf;
1041 }
1042 serverLog(LL_WARNING,"client->argv[%d] = \"%s\" (refcount: %d)",
1043 j, arg, static_cast<int>(c->argv[j]->getrefcount(std::memory_order_relaxed)));
1044 }
1045}
1046
1047void serverLogObjectDebugInfo(robj_roptr o) {
1048 serverLog(LL_WARNING,"Object type: %d", o->type);

Callers 1

_serverAssertWithInfoFunction · 0.85

Calls 5

bugReportStartFunction · 0.85
serverLogFunction · 0.85
connGetInfoFunction · 0.85
ptrFromObjFunction · 0.85
getrefcountMethod · 0.80

Tested by

no test coverage detected