2
0
Fork 0

[mod_memcached]: set default ttl to 30 seconds

This commit is contained in:
Stefan Bühler 2010-07-18 11:13:24 +02:00
parent d5bc446ebe
commit cbb9165eb0
1 changed files with 3 additions and 3 deletions

View File

@ -150,7 +150,7 @@ static memcached_ctx* mc_ctx_parse(liServer *srv, liPlugin *p, liValue *config)
ctx->pattern = li_pattern_new("%{req.path}");
ctx->flags = 0;
ctx->ttl = 0;
ctx->ttl = 30;
ctx->maxsize = 64*1024; /* 64 kB */
ctx->headers = FALSE;
@ -193,8 +193,8 @@ static memcached_ctx* mc_ctx_parse(liServer *srv, liPlugin *p, liValue *config)
}
ctx->flags = value->data.number;
} else if (g_string_equal(key, &mon_ttl)) {
if (value->type != LI_VALUE_NUMBER || value->data.number <= 0) {
ERROR(srv, "memcache option '%s' expects positive integer as parameter", mon_ttl.str);
if (value->type != LI_VALUE_NUMBER || value->data.number < 0) {
ERROR(srv, "memcache option '%s' expects non-negative integer as parameter", mon_ttl.str);
goto option_failed;
}
ctx->ttl = value->data.number;