mod_socache_dc.c revision 0797faae937515a5225a36db4a1ec79480d2555c
/* 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 context {
/* Configured target server: */
const char *target;
/* distcache client context: */
};
{
return NULL;
}
{
#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;
}
{
}
}
{
/* !@#$%^ - why do we deal with *absolute* time anyway??? */
/* Send the serialised session to the distributed cache context */
(unsigned long)timeout * 1000)) {
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_EGENERAL;
}
return APR_ENOSPC;
}
return APR_SUCCESS;
}
apr_pool_t *p)
{
/* Remove any corresponding session from the distributed cache context */
} else {
}
}
{
"distributed scache 'socache_dc_status'");
ap_rprintf(r, "cache type: <b>DC (Distributed Cache)</b>, "
}
static const ap_socache_provider_t socache_dc = {
"distcache",
0,
};
static void register_hooks(apr_pool_t *p)
{
&socache_dc);
}
};