summaryrefslogtreecommitdiff
path: root/src/debug.c
diff options
context:
space:
mode:
authorYossi Gottlieb <yossigo@gmail.com>2013-06-23 08:59:01 +0300
committerYossi Gottlieb <yossigo@gmail.com>2013-06-23 08:59:01 +0300
commita9a29ff16effa0d36a16c0859c3dadb4ab87889a (patch)
tree89e376da1560d6fb16b20d1b570d9a53017458be /src/debug.c
parent9cc3257e94cdbea94ea259f834409a221f121da4 (diff)
parent16ddbb7dfc435f1abb01ecd4df316827be341899 (diff)
downloadredis-2.6.14-1.tar.gz
Merge upstream 2.6.14.2.6.14-1
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/debug.c b/src/debug.c
index a74358383..e1d42cc65 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -330,9 +330,14 @@ void debugCommand(redisClient *c) {
usleep(utime);
addReply(c,shared.ok);
+ } else if (!strcasecmp(c->argv[1]->ptr,"set-active-expire") &&
+ c->argc == 3)
+ {
+ server.active_expire_enabled = atoi(c->argv[2]->ptr);
+ addReply(c,shared.ok);
} else {
- addReplyError(c,
- "Syntax error, try DEBUG [SEGFAULT|OBJECT <key>|SWAPIN <key>|SWAPOUT <key>|RELOAD]");
+ addReplyErrorFormat(c, "Unknown DEBUG subcommand or wrong number of arguments for '%s'",
+ (char*)c->argv[1]->ptr);
}
}
@@ -382,9 +387,12 @@ void redisLogObjectDebugInfo(robj *o) {
redisLog(REDIS_WARNING,"Object encoding: %d", o->encoding);
redisLog(REDIS_WARNING,"Object refcount: %d", o->refcount);
if (o->type == REDIS_STRING && o->encoding == REDIS_ENCODING_RAW) {
- redisLog(REDIS_WARNING,"Object raw string len: %d", sdslen(o->ptr));
- if (sdslen(o->ptr) < 4096)
- redisLog(REDIS_WARNING,"Object raw string content: \"%s\"", (char*)o->ptr);
+ redisLog(REDIS_WARNING,"Object raw string len: %zu", sdslen(o->ptr));
+ if (sdslen(o->ptr) < 4096) {
+ sds repr = sdscatrepr(sdsempty(),o->ptr,sdslen(o->ptr));
+ redisLog(REDIS_WARNING,"Object raw string content: %s", repr);
+ sdsfree(repr);
+ }
} else if (o->type == REDIS_LIST) {
redisLog(REDIS_WARNING,"List length: %d", (int) listTypeLength(o));
} else if (o->type == REDIS_SET) {
@@ -794,7 +802,7 @@ void enableWatchdog(int period) {
/* If the configured period is smaller than twice the timer period, it is
* too short for the software watchdog to work reliably. Fix it now
* if needed. */
- min_period = (1000/REDIS_HZ)*2;
+ min_period = (1000/server.hz)*2;
if (period < min_period) period = min_period;
watchdogScheduleSignal(period); /* Adjust the current timer. */
server.watchdog_period = period;