rv = apr_memcache_create(p, nservers, 0, &ctx->mc);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
- "SSLSessionCache: Failed to create Memcache Object of '%d' size.",
+ "socache: Failed to create Memcache Object of '%d' size.",
nservers);
return rv;
}
rv = apr_parse_addr_port(&host_str, &scope_id, &port, split, p);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
- "SSLSessionCache: Failed to Parse Server: '%s'", split);
+ "socache: Failed to Parse memcache Server: '%s'", split);
return rv;
}
if (host_str == NULL) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
- "SSLSessionCache: Failed to Parse Server, "
+ "socache: Failed to Parse Server, "
"no hostname specified: '%s'", split);
return APR_EINVAL;
}
&st);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
- "SSLSessionCache: Failed to Create Server: %s:%d",
+ "socache: Failed to Create memcache Server: %s:%d",
host_str, port);
return rv;
}
rv = apr_memcache_add_server(ctx->mc, st);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
- "SSLSessionCache: Failed to Add Server: %s:%d",
+ "socache: Failed to Add memcache Server: %s:%d",
host_str, port);
return rv;
}
unsigned char *dest, unsigned int *destlen,
apr_pool_t *p)
{
- apr_size_t der_len;
- char buf[MC_KEY_LEN], *der;
+ apr_size_t data_len;
+ char buf[MC_KEY_LEN], *data;
apr_status_t rv;
if (socache_mc_id2key(ctx, id, idlen, buf, sizeof buf)) {
/* ### this could do with a subpool, but _getp looks like it will
* eat memory like it's going out of fashion anyway. */
- rv = apr_memcache_getp(ctx->mc, p, buf,
- &der, &der_len, NULL);
+ rv = apr_memcache_getp(ctx->mc, p, buf, &data, &data_len, NULL);
if (rv) {
if (rv != APR_NOTFOUND) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
- "scache_mc: 'get_session' FAIL");
+ "scache_mc: 'retrieve' FAIL");
}
return rv;
}
- else if (der_len > *destlen) {
+ else if (data_len > *destlen) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
- "scache_mc: 'get_session' OVERFLOW");
- return rv;
+ "scache_mc: 'retrieve' OVERFLOW");
+ return APR_ENOMEM;
}
- memcpy(dest, der, der_len);
- *destlen = der_len;
+ memcpy(dest, data, data_len);
+ *destlen = data_len;
return APR_SUCCESS;
}