mod_cache_socache.c revision 8eb78a55c83fee3383fd2862f66a3ab20d059283
0d72955a51d8dbff9564b0983239561cff4bff56Tim Reddehase/* Licensed to the Apache Software Foundation (ASF) under one or more
27caf7f48edaed40a295eaeefbfdeaf9ced10ff9Christian Clausen * contributor license agreements. See the NOTICE file distributed with
27caf7f48edaed40a295eaeefbfdeaf9ced10ff9Christian Clausen * this work for additional information regarding copyright ownership.
4e91a7a04053ace25f8a60fd6e777fd620948176Christian Clausen * The ASF licenses this file to You under the Apache License, Version 2.0
4e91a7a04053ace25f8a60fd6e777fd620948176Christian Clausen * (the "License"); you may not use this file except in compliance with
4e91a7a04053ace25f8a60fd6e777fd620948176Christian Clausen * the License. You may obtain a copy of the License at
4e91a7a04053ace25f8a60fd6e777fd620948176Christian Clausen * http://www.apache.org/licenses/LICENSE-2.0
4e91a7a04053ace25f8a60fd6e777fd620948176Christian Clausen * Unless required by applicable law or agreed to in writing, software
9207b76195d960634cc7bf91a1c9331632fedf29Christian Clausen * distributed under the License is distributed on an "AS IS" BASIS,
4e91a7a04053ace25f8a60fd6e777fd620948176Christian Clausen * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4e91a7a04053ace25f8a60fd6e777fd620948176Christian Clausen * See the License for the specific language governing permissions and
9207b76195d960634cc7bf91a1c9331632fedf29Christian Clausen * limitations under the License.
#include "mod_status.h"
#include "cache_socache_common.h"
typedef struct cache_socache_object_t
#define DEFAULT_READSIZE 0
#define DEFAULT_READTIME 0
typedef struct cache_socache_provider_conf
const char *args;
typedef struct cache_socache_conf
typedef struct cache_socache_dir_conf
(*slider)++;
return APR_SUCCESS;
(*slider)++;
(*slider)++;
(*slider)++;
return APR_SUCCESS;
(*slider)++;
return APR_EOF;
int i, len;
const char **elts;
return APR_EOF;
if (buffer) {
return APR_SUCCESS;
if (!colon) {
(*slider)++;
(*slider)++;
(*slider)++;
return APR_SUCCESS;
return APR_EGENERAL;
colon++;
(*slider)++;
(*slider)++;
colon = 0;
(*slider)++;
return APR_SUCCESS;
(*slider)++;
return APR_EOF;
int i, len;
return APR_EOF;
return APR_EOF;
if (buffer) {
return APR_SUCCESS;
int nvec;
const char *header;
const char **elts;
if (!header) {
char *token;
return DECLINED;
key);
return DECLINED;
if (len < 0) {
return DECLINED;
return DECLINED;
&total)) {
return DECLINED;
return DECLINED;
return OK;
unsigned int buffer_len;
const char *nkey;
return DECLINED;
if (socache_mutex) {
return DECLINED;
if (socache_mutex) {
return DECLINED;
return DECLINED;
return DECLINED;
return DECLINED;
if (socache_mutex) {
return DECLINED;
if (socache_mutex) {
return DECLINED;
return DECLINED;
goto fail;
goto fail;
goto fail;
return DECLINED;
goto fail;
return DECLINED;
&slider)) {
goto fail;
&slider)) {
goto fail;
apr_bucket *e;
return OK;
fail:
if (socache_mutex) {
return DECLINED;
if (socache_mutex) {
return DECLINED;
return OK;
if (!sobj) {
return DECLINED;
if (socache_mutex) {
return DECLINED;
if (socache_mutex) {
return DECLINED;
return OK;
return APR_SUCCESS;
apr_bucket *e;
return APR_SUCCESS;
if (r->headers_out) {
if (r->headers_in) {
const char *vary;
if (vary) {
return rv;
if (socache_mutex) {
return status;
if (socache_mutex) {
return rv;
return APR_EGENERAL;
return APR_EGENERAL;
return APR_EGENERAL;
return APR_SUCCESS;
apr_bucket *e;
int seen_eos = 0;
const char *str;
if (APR_BUCKET_IS_EOS(e)) {
if (APR_BUCKET_IS_FLUSH(e)) {
if (APR_BUCKET_IS_METADATA(e)) {
return rv;
if (!length) {
return APR_EGENERAL;
return rv;
if (seen_eos) {
return APR_EGENERAL;
if (cl_header) {
return APR_EGENERAL;
return APR_SUCCESS;
goto fail;
goto fail;
if (socache_mutex) {
return rv;
if (socache_mutex) {
return DECLINED;
goto fail;
return APR_SUCCESS;
fail:
if (socache_mutex) {
return rv;
if (socache_mutex) {
return rv;
return commit_entity(h, r);
return dconf;
*new =
return new;
return conf;
return ps;
const char *arg)
if (sep) {
sep++;
return err;
const char *arg)
return "CacheSocacheMaxSize argument must be a integer representing the max size of a cached entry (headers and body), at least 1024";
return NULL;
const char *arg)
return "CacheSocacheMaxTime argument must be the maximum amount of time in seconds to cache an entry.";
return NULL;
const char *arg)
return "CacheSocacheMinTime argument must be the minimum amount of time in seconds to cache an entry.";
return NULL;
const char *arg)
return "CacheSocacheReadSize argument must be a non-negative integer representing the max amount of data to cache in go.";
return NULL;
const char *arg)
|| milliseconds < 0) {
return "CacheSocacheReadTime argument must be a non-negative integer representing the max amount of time taken to cache in go.";
return NULL;
if (socache_mutex) {
return APR_SUCCESS;
return APR_SUCCESS;
return DECLINED;
if (socache_mutex) {
r, flags);
return OK;
APR_LOCK_DEFAULT, 0);
return OK;
server_rec *s;
const char *errmsg;
pconf);
if (errmsg) {
return OK;
const char *lock;
if (!socache_mutex) {
{ NULL }