mod_socache_dc.c revision cf25139efeb705911e931b68a521d8b65ff922ee
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "httpd.h"
#include "http_log.h"
#include "http_request.h"
#include "http_config.h"
#include "http_protocol.h"
#include "apr_strings.h"
#include "apr_time.h"
#include "ap_socache.h"
#include "distcache/dc_client.h"
#error "You must compile with a more recent version of the distcache-base package"
#endif
struct ap_socache_instance_t {
/* Configured target server: */
const char *target;
/* distcache client context: */
};
const char *arg,
{
struct ap_socache_instance_t *ctx;
return NULL;
}
const char *namespace,
const struct ap_socache_hints *hints,
server_rec *s, apr_pool_t *p)
{
#if 0
/* If a "persistent connection" mode of operation is preferred, you *must*
* also use the PIDCHECK flag to ensure fork()'d processes don't interlace
* comms on the same connection as each other. */
#define SESSION_CTX_FLAGS SESSION_CTX_FLAG_PERSISTENT | \
#else
/* This mode of operation will open a temporary connection to the 'target'
* for each cache operation - this makes it safe against fork()
* automatically. This mode is preferred when running a local proxy (over
* unix domain sockets) because overhead is negligable and it reduces the
* performance/stability danger of file-descriptor bloatage. */
#define SESSION_CTX_FLAGS 0
#endif
return APR_EGENERAL;
}
return APR_SUCCESS;
}
{
}
}
apr_pool_t *p)
{
/* !@#$%^ - why do we deal with *absolute* time anyway???
* Uhm - because most things expire things at a specific time?
* Were the API were thought out expiry - r->request_time is a good approximation
*/
/* Send the serialised session to the distributed cache context */
return APR_EGENERAL;
}
return APR_SUCCESS;
}
apr_pool_t *p)
{
unsigned int data_len;
/* Retrieve any corresponding session from the distributed cache context */
return APR_NOTFOUND;
}
return APR_ENOSPC;
}
return APR_SUCCESS;
}
server_rec *s, const unsigned char *id,
unsigned int idlen, apr_pool_t *p)
{
/* Remove any corresponding session from the distributed cache context */
return APR_NOTFOUND;
} else {
return APR_SUCCESS;
}
}
{
"distributed scache 'socache_dc_status'");
ap_rprintf(r, "cache type: <b>DC (Distributed Cache)</b>, "
}
server_rec *s, void *userctx,
{
return APR_ENOTIMPL;
}
static const ap_socache_provider_t socache_dc = {
"distcache",
0,
};
static void register_hooks(apr_pool_t *p)
{
&socache_dc);
}
};