Lines Matching refs:c
263 void debugCommand(client *c) { in debugCommand() argument
264 if (c->argc == 1) { in debugCommand()
265 addReplyError(c,"You must specify a subcommand for DEBUG. Try DEBUG HELP for info."); in debugCommand()
269 if (!strcasecmp(c->argv[1]->ptr,"help")) { in debugCommand()
270 void *blenp = addDeferredMultiBulkLength(c); in debugCommand()
272 blen++; addReplyStatus(c, in debugCommand()
274 blen++; addReplyStatus(c, in debugCommand()
276 blen++; addReplyStatus(c, in debugCommand()
278 blen++; addReplyStatus(c, in debugCommand()
280 blen++; addReplyStatus(c, in debugCommand()
282 blen++; addReplyStatus(c, in debugCommand()
284 blen++; addReplyStatus(c, in debugCommand()
286 blen++; addReplyStatus(c, in debugCommand()
288 blen++; addReplyStatus(c, in debugCommand()
290 blen++; addReplyStatus(c, in debugCommand()
292 blen++; addReplyStatus(c, in debugCommand()
294 blen++; addReplyStatus(c, in debugCommand()
296 blen++; addReplyStatus(c, in debugCommand()
298 blen++; addReplyStatus(c, in debugCommand()
300 blen++; addReplyStatus(c, in debugCommand()
302 blen++; addReplyStatus(c, in debugCommand()
304 blen++; addReplyStatus(c, in debugCommand()
306 blen++; addReplyStatus(c, in debugCommand()
308 blen++; addReplyStatus(c, in debugCommand()
310 setDeferredMultiBulkLength(c,blenp,blen); in debugCommand()
311 } else if (!strcasecmp(c->argv[1]->ptr,"segfault")) { in debugCommand()
313 } else if (!strcasecmp(c->argv[1]->ptr,"restart") || in debugCommand()
314 !strcasecmp(c->argv[1]->ptr,"crash-and-recover")) in debugCommand()
317 if (c->argc >= 3) { in debugCommand()
318 if (getLongLongFromObjectOrReply(c, c->argv[2], &delay, NULL) in debugCommand()
322 int flags = !strcasecmp(c->argv[1]->ptr,"restart") ? in debugCommand()
326 addReplyError(c,"failed to restart the server. Check server logs."); in debugCommand()
327 } else if (!strcasecmp(c->argv[1]->ptr,"oom")) { in debugCommand()
330 addReply(c,shared.ok); in debugCommand()
331 } else if (!strcasecmp(c->argv[1]->ptr,"assert")) { in debugCommand()
332 if (c->argc >= 3) c->argv[2] = tryObjectEncoding(c->argv[2]); in debugCommand()
333 serverAssertWithInfo(c,c->argv[0],1 == 2); in debugCommand()
334 } else if (!strcasecmp(c->argv[1]->ptr,"reload")) { in debugCommand()
336 addReply(c,shared.err); in debugCommand()
341 addReplyError(c,"Error trying to load the RDB dump"); in debugCommand()
345 addReply(c,shared.ok); in debugCommand()
346 } else if (!strcasecmp(c->argv[1]->ptr,"loadaof")) { in debugCommand()
350 addReply(c,shared.err); in debugCommand()
355 addReply(c,shared.ok); in debugCommand()
356 } else if (!strcasecmp(c->argv[1]->ptr,"object") && c->argc == 3) { in debugCommand()
361 if ((de = dictFind(c->db->dict,c->argv[2]->ptr)) == NULL) { in debugCommand()
362 addReply(c,shared.nokeyerr); in debugCommand()
401 addReplyStatusFormat(c, in debugCommand()
408 } else if (!strcasecmp(c->argv[1]->ptr,"sdslen") && c->argc == 3) { in debugCommand()
413 if ((de = dictFind(c->db->dict,c->argv[2]->ptr)) == NULL) { in debugCommand()
414 addReply(c,shared.nokeyerr); in debugCommand()
421 addReplyError(c,"Not an sds encoded string."); in debugCommand()
423 addReplyStatusFormat(c, in debugCommand()
431 } else if (!strcasecmp(c->argv[1]->ptr,"populate") && in debugCommand()
432 (c->argc == 3 || c->argc == 4)) { in debugCommand()
437 if (getLongFromObjectOrReply(c, c->argv[2], &keys, NULL) != C_OK) in debugCommand()
439 dictExpand(c->db->dict,keys); in debugCommand()
442 (c->argc == 3) ? "key" : (char*)c->argv[3]->ptr, j); in debugCommand()
444 if (lookupKeyWrite(c->db,key) != NULL) { in debugCommand()
450 dbAdd(c->db,key,val); in debugCommand()
451 signalModifiedKey(c->db,key); in debugCommand()
454 addReply(c,shared.ok); in debugCommand()
455 } else if (!strcasecmp(c->argv[1]->ptr,"digest") && c->argc == 2) { in debugCommand()
463 addReplyStatus(c,d); in debugCommand()
465 } else if (!strcasecmp(c->argv[1]->ptr,"sleep") && c->argc == 3) { in debugCommand()
466 double dtime = strtod(c->argv[2]->ptr,NULL); in debugCommand()
473 addReply(c,shared.ok); in debugCommand()
474 } else if (!strcasecmp(c->argv[1]->ptr,"set-active-expire") && in debugCommand()
475 c->argc == 3) in debugCommand()
477 server.active_expire_enabled = atoi(c->argv[2]->ptr); in debugCommand()
478 addReply(c,shared.ok); in debugCommand()
479 } else if (!strcasecmp(c->argv[1]->ptr,"lua-always-replicate-commands") && in debugCommand()
480 c->argc == 3) in debugCommand()
482 server.lua_always_replicate_commands = atoi(c->argv[2]->ptr); in debugCommand()
483 addReply(c,shared.ok); in debugCommand()
484 } else if (!strcasecmp(c->argv[1]->ptr,"error") && c->argc == 3) { in debugCommand()
487 errstr = sdscatsds(errstr,c->argv[2]->ptr); in debugCommand()
490 addReplySds(c,errstr); in debugCommand()
491 } else if (!strcasecmp(c->argv[1]->ptr,"structsize") && c->argc == 2) { in debugCommand()
501 addReplyBulkSds(c,sizes); in debugCommand()
502 } else if (!strcasecmp(c->argv[1]->ptr,"htstats") && c->argc == 3) { in debugCommand()
507 if (getLongFromObjectOrReply(c, c->argv[2], &dbid, NULL) != C_OK) in debugCommand()
510 addReplyError(c,"Out of range database"); in debugCommand()
522 addReplyBulkSds(c,stats); in debugCommand()
523 } else if (!strcasecmp(c->argv[1]->ptr,"jemalloc") && c->argc == 3) { in debugCommand()
525 if (!strcasecmp(c->argv[2]->ptr, "info")) { in debugCommand()
528 addReplyBulkSds(c, info); in debugCommand()
529 } else if (!strcasecmp(c->argv[2]->ptr, "purge")) { in debugCommand()
536 addReply(c, shared.ok); in debugCommand()
540 addReplyError(c, "Error purging dirty pages"); in debugCommand()
542 addReplyErrorFormat(c, "Valid jemalloc debug fields: info, purge"); in debugCommand()
545 addReplyErrorFormat(c, "jemalloc support not available"); in debugCommand()
548 addReplyErrorFormat(c, "Unknown DEBUG subcommand or wrong number of arguments for '%s'", in debugCommand()
549 (char*)c->argv[1]->ptr); in debugCommand()
568 void _serverAssertPrintClientInfo(client *c) { in _serverAssertPrintClientInfo() argument
573 serverLog(LL_WARNING,"client->flags = %d", c->flags); in _serverAssertPrintClientInfo()
574 serverLog(LL_WARNING,"client->fd = %d", c->fd); in _serverAssertPrintClientInfo()
575 serverLog(LL_WARNING,"client->argc = %d", c->argc); in _serverAssertPrintClientInfo()
576 for (j=0; j < c->argc; j++) { in _serverAssertPrintClientInfo()
580 if (c->argv[j]->type == OBJ_STRING && sdsEncodedObject(c->argv[j])) { in _serverAssertPrintClientInfo()
581 arg = (char*) c->argv[j]->ptr; in _serverAssertPrintClientInfo()
584 c->argv[j]->type, c->argv[j]->encoding); in _serverAssertPrintClientInfo()
588 j, arg, c->argv[j]->refcount); in _serverAssertPrintClientInfo()
622 void _serverAssertWithInfo(client *c, robj *o, char *estr, char *file, int line) { in _serverAssertWithInfo() argument
623 if (c) _serverAssertPrintClientInfo(c); in _serverAssertWithInfo()