* modules/cache/mod_socache_memcache.c (socache_mc_store): Pass

through expiration time.

Submitted by: Faidon Liambotis <paravoid debian.org>, jorton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1649491 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Joe Orton
2015-01-05 10:06:29 +00:00
parent e5ce6647a4
commit 750aa727b0
2 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,9 @@
-*- coding: utf-8 -*-
Changes with Apache 2.5.0
*) mod_socache_memcache: Pass expiration time through to memcached.
[Faidon Liambotis <paravoid debian.org>, Joe Orton]
*) split-logfile: Fix perl error: 'Can't use string ("example.org:80")
as a symbol ref while "strict refs"'. PR 56329.
[Holger Mauermann <mauermann gmail.com>]

View File

@ -205,8 +205,14 @@ static apr_status_t socache_mc_store(ap_socache_instance_t *ctx, server_rec *s,
return APR_EINVAL;
}
/* In APR-util - unclear what 'timeout' is, as it was not implemented */
rv = apr_memcache_set(ctx->mc, buf, (char*)ucaData, nData, 0, 0);
/* memcache needs time in seconds till expiry; fail if this is not
* positive *before* casting to unsigned (apr_uint32_t). */
expiry -= apr_time_now();
if (apr_time_sec(expiry) <= 0) {
return APR_EINVAL;
}
rv = apr_memcache_set(ctx->mc, buf, (char*)ucaData, nData,
apr_time_sec(expiry), 0);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, APLOGNO(00790)