Apache HTTPD
Functions | Variables
mod_cache_disk.c File Reference
#include "apr_lib.h"
#include "apr_file_io.h"
#include "apr_strings.h"
#include "mod_cache.h"
#include "mod_cache_disk.h"
#include "http_config.h"
#include "http_log.h"
#include "http_core.h"
#include "ap_provider.h"
#include "util_filter.h"
#include "util_script.h"
#include "util_charset.h"

Go to the source code of this file.

Functions

static int remove_entity (cache_handle_t *h)
 
static apr_status_t store_headers (cache_handle_t *h, request_rec *r, cache_info *i)
 
static apr_status_t store_body (cache_handle_t *h, request_rec *r, apr_bucket_brigade *in, apr_bucket_brigade *out)
 
static apr_status_t recall_headers (cache_handle_t *h, request_rec *r)
 
static apr_status_t recall_body (cache_handle_t *h, apr_pool_t *p, apr_bucket_brigade *bb)
 
static apr_status_t read_array (request_rec *r, apr_array_header_t *arr, apr_file_t *file)
 
static charheader_file (apr_pool_t *p, disk_cache_conf *conf, disk_cache_object_t *dobj, const char *name)
 
static chardata_file (apr_pool_t *p, disk_cache_conf *conf, disk_cache_object_t *dobj, const char *name)
 
static apr_status_t mkdir_structure (disk_cache_conf *conf, const char *file, apr_pool_t *pool)
 
static apr_status_t safe_file_rename (disk_cache_conf *conf, const char *src, const char *dest, apr_pool_t *pool)
 
static apr_status_t file_cache_el_final (disk_cache_conf *conf, disk_cache_file_t *file, request_rec *r)
 
static apr_status_t file_cache_temp_cleanup (void *dummy)
 
static apr_status_t file_cache_create (disk_cache_conf *conf, disk_cache_file_t *file, apr_pool_t *pool)
 
static int file_cache_recall_mydata (apr_file_t *fd, cache_info *info, disk_cache_object_t *dobj, request_rec *r)
 
static const charregen_key (apr_pool_t *p, apr_table_t *headers, apr_array_header_t *varray, const char *oldkey)
 
static int array_alphasort (const void *fn1, const void *fn2)
 
static void tokens_to_array (apr_pool_t *p, const char *data, apr_array_header_t *arr)
 
static int create_entity (cache_handle_t *h, request_rec *r, const char *key, apr_off_t len, apr_bucket_brigade *bb)
 
static int open_entity (cache_handle_t *h, request_rec *r, const char *key)
 
static void close_disk_cache_fd (disk_cache_file_t *file)
 
static int remove_url (cache_handle_t *h, request_rec *r)
 
static apr_status_t store_array (apr_file_t *fd, apr_array_header_t *arr)
 
static apr_status_t read_table (cache_handle_t *handle, request_rec *r, apr_table_t *table, apr_file_t *file)
 
static apr_status_t store_table (apr_file_t *fd, apr_table_t *table)
 
static apr_status_t write_headers (cache_handle_t *h, request_rec *r)
 
static apr_status_t commit_entity (cache_handle_t *h, request_rec *r)
 
static apr_status_t invalidate_entity (cache_handle_t *h, request_rec *r)
 
static void * create_dir_config (apr_pool_t *p, char *dummy)
 
static void * merge_dir_config (apr_pool_t *p, void *basev, void *addv)
 
static void * create_config (apr_pool_t *p, server_rec *s)
 
static const charset_cache_root (cmd_parms *parms, void *in_struct_ptr, const char *arg)
 
static const charset_cache_dirlevels (cmd_parms *parms, void *in_struct_ptr, const char *arg)
 
static const charset_cache_dirlength (cmd_parms *parms, void *in_struct_ptr, const char *arg)
 
static const charset_cache_minfs (cmd_parms *parms, void *in_struct_ptr, const char *arg)
 
static const charset_cache_maxfs (cmd_parms *parms, void *in_struct_ptr, const char *arg)
 
static const charset_cache_readsize (cmd_parms *parms, void *in_struct_ptr, const char *arg)
 
static const charset_cache_readtime (cmd_parms *parms, void *in_struct_ptr, const char *arg)
 
static void disk_cache_register_hook (apr_pool_t *p)
 

Variables

static const command_rec disk_cache_cmds []
 
static const cache_provider cache_disk_provider
 
static int *const aplog_module_index = &( cache_disk_module.module_index)
 

Function Documentation

◆ array_alphasort()

static int array_alphasort ( const void *  fn1,
const void *  fn2 
)
static

Definition at line 316 of file mod_cache_disk.c.

◆ close_disk_cache_fd()

static void close_disk_cache_fd ( disk_cache_file_t file)
static

Definition at line 601 of file mod_cache_disk.c.

◆ commit_entity()

static apr_status_t commit_entity ( cache_handle_t h,
request_rec r 
)
static

Definition at line 1327 of file mod_cache_disk.c.

◆ create_config()

static void * create_config ( apr_pool_t p,
server_rec s 
)
static

Definition at line 1416 of file mod_cache_disk.c.

◆ create_dir_config()

static void * create_dir_config ( apr_pool_t p,
char dummy 
)
static

Definition at line 1386 of file mod_cache_disk.c.

◆ create_entity()

static int create_entity ( cache_handle_t h,
request_rec r,
const char key,
apr_off_t  len,
apr_bucket_brigade bb 
)
static

< Module declines to handle

< Module declines to handle

< Module declines to handle

< Module declines to handle

< Module has handled this stage.

Definition at line 338 of file mod_cache_disk.c.

◆ data_file()

static char * data_file ( apr_pool_t p,
disk_cache_conf conf,
disk_cache_object_t dobj,
const char name 
)
static

Definition at line 92 of file mod_cache_disk.c.

◆ disk_cache_register_hook()

static void disk_cache_register_hook ( apr_pool_t p)
static

Definition at line 1570 of file mod_cache_disk.c.

◆ file_cache_create()

static apr_status_t file_cache_create ( disk_cache_conf conf,
disk_cache_file_t file,
apr_pool_t pool 
)
static

Definition at line 203 of file mod_cache_disk.c.

◆ file_cache_el_final()

static apr_status_t file_cache_el_final ( disk_cache_conf conf,
disk_cache_file_t file,
request_rec r 
)
static

Definition at line 161 of file mod_cache_disk.c.

◆ file_cache_recall_mydata()

static int file_cache_recall_mydata ( apr_file_t fd,
cache_info info,
disk_cache_object_t dobj,
request_rec r 
)
static

Definition at line 218 of file mod_cache_disk.c.

◆ file_cache_temp_cleanup()

static apr_status_t file_cache_temp_cleanup ( void *  dummy)
static

Definition at line 188 of file mod_cache_disk.c.

◆ header_file()

static char * header_file ( apr_pool_t p,
disk_cache_conf conf,
disk_cache_object_t dobj,
const char name 
)
static

Definition at line 74 of file mod_cache_disk.c.

◆ invalidate_entity()

static apr_status_t invalidate_entity ( cache_handle_t h,
request_rec r 
)
static

Definition at line 1371 of file mod_cache_disk.c.

◆ merge_dir_config()

static void * merge_dir_config ( apr_pool_t p,
void *  basev,
void *  addv 
)
static

Definition at line 1398 of file mod_cache_disk.c.

◆ mkdir_structure()

static apr_status_t mkdir_structure ( disk_cache_conf conf,
const char file,
apr_pool_t pool 
)
static

< Read by user

<

Deprecated:
See also
APR_FPROT_UREAD

< Write by user

<

Deprecated:
See also
APR_FPROT_UWRITE

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

Definition at line 110 of file mod_cache_disk.c.

◆ open_entity()

static int open_entity ( cache_handle_t h,
request_rec r,
const char key 
)
static

< Module declines to handle

< Open the file for reading

<

Deprecated:
See also
APR_FOPEN_READ

< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)

<

Deprecated:
See also
APR_FOPEN_BINARY

< Open the file for buffered I/O

<

Deprecated:
See also
APR_FOPEN_BUFFERED

< Module declines to handle

< Module declines to handle

< Open the file for reading

<

Deprecated:
See also
APR_FOPEN_READ

< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)

<

Deprecated:
See also
APR_FOPEN_BINARY

< Open the file for buffered I/O

<

Deprecated:
See also
APR_FOPEN_BUFFERED

< Module declines to handle

< Module declines to handle

< Module declines to handle

< Module declines to handle

< Open the file for reading

<

Deprecated:
See also
APR_FOPEN_READ

< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)

<

Deprecated:
See also
APR_FOPEN_BINARY

< Advisory flag that this file should support apr_socket_sendfile operation

<

Deprecated:
See also
APR_FOPEN_SENDFILE_ENABLED

< Module declines to handle

< Size of the file

< dev and inode

< Module has handled this stage.

< Module has handled this stage.

< Module declines to handle

Definition at line 404 of file mod_cache_disk.c.

◆ read_array()

static apr_status_t read_array ( request_rec r,
apr_array_header_t arr,
apr_file_t file 
)
static

Definition at line 712 of file mod_cache_disk.c.

◆ read_table()

static apr_status_t read_table ( cache_handle_t handle,
request_rec r,
apr_table_t table,
apr_file_t file 
)
static

Definition at line 776 of file mod_cache_disk.c.

◆ recall_body()

static apr_status_t recall_body ( cache_handle_t h,
apr_pool_t p,
apr_bucket_brigade bb 
)
static

Definition at line 901 of file mod_cache_disk.c.

◆ recall_headers()

static apr_status_t recall_headers ( cache_handle_t h,
request_rec r 
)
static

Definition at line 865 of file mod_cache_disk.c.

◆ regen_key()

static const char * regen_key ( apr_pool_t p,
apr_table_t headers,
apr_array_header_t varray,
const char oldkey 
)
static

Definition at line 260 of file mod_cache_disk.c.

◆ remove_entity()

static int remove_entity ( cache_handle_t h)
static

< Module has handled this stage.

Definition at line 613 of file mod_cache_disk.c.

◆ remove_url()

static int remove_url ( cache_handle_t h,
request_rec r 
)
static

< Module declines to handle

< Module declines to handle

< Module declines to handle

< Module has handled this stage.

Definition at line 626 of file mod_cache_disk.c.

◆ safe_file_rename()

static apr_status_t safe_file_rename ( disk_cache_conf conf,
const char src,
const char dest,
apr_pool_t pool 
)
static

Definition at line 135 of file mod_cache_disk.c.

◆ set_cache_dirlength()

static const char * set_cache_dirlength ( cmd_parms parms,
void *  in_struct_ptr,
const char arg 
)
static

Definition at line 1465 of file mod_cache_disk.c.

◆ set_cache_dirlevels()

static const char * set_cache_dirlevels ( cmd_parms parms,
void *  in_struct_ptr,
const char arg 
)
static

Definition at line 1452 of file mod_cache_disk.c.

◆ set_cache_maxfs()

static const char * set_cache_maxfs ( cmd_parms parms,
void *  in_struct_ptr,
const char arg 
)
static

Definition at line 1494 of file mod_cache_disk.c.

◆ set_cache_minfs()

static const char * set_cache_minfs ( cmd_parms parms,
void *  in_struct_ptr,
const char arg 
)
static

Definition at line 1480 of file mod_cache_disk.c.

◆ set_cache_readsize()

static const char * set_cache_readsize ( cmd_parms parms,
void *  in_struct_ptr,
const char arg 
)
static

Definition at line 1508 of file mod_cache_disk.c.

◆ set_cache_readtime()

static const char * set_cache_readtime ( cmd_parms parms,
void *  in_struct_ptr,
const char arg 
)
static

Definition at line 1522 of file mod_cache_disk.c.

◆ set_cache_root()

static const char * set_cache_root ( cmd_parms parms,
void *  in_struct_ptr,
const char arg 
)
static

Definition at line 1434 of file mod_cache_disk.c.

◆ store_array()

static apr_status_t store_array ( apr_file_t fd,
apr_array_header_t arr 
)
static

Definition at line 748 of file mod_cache_disk.c.

◆ store_body()

static apr_status_t store_body ( cache_handle_t h,
request_rec r,
apr_bucket_brigade in,
apr_bucket_brigade out 
)
static

< Create the file if not there

<

Deprecated:
See also
APR_FOPEN_CREATE

< Open the file for writing

<

Deprecated:
See also
APR_FOPEN_WRITE

< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)

<

Deprecated:
See also
APR_FOPEN_BINARY

< Open the file for buffered I/O

<

Deprecated:
See also
APR_FOPEN_BUFFERED

< Open should fail if APR_FOPEN_CREATE and file exists.

<

Deprecated:
See also
APR_FOPEN_EXCL

< dev and inode

Definition at line 1137 of file mod_cache_disk.c.

◆ store_headers()

static apr_status_t store_headers ( cache_handle_t h,
request_rec r,
cache_info i 
)
static

Definition at line 944 of file mod_cache_disk.c.

◆ store_table()

static apr_status_t store_table ( apr_file_t fd,
apr_table_t table 
)
static

Definition at line 912 of file mod_cache_disk.c.

◆ tokens_to_array()

static void tokens_to_array ( apr_pool_t p,
const char data,
apr_array_header_t arr 
)
static

Definition at line 321 of file mod_cache_disk.c.

◆ write_headers()

static apr_status_t write_headers ( cache_handle_t h,
request_rec r 
)
static

< Create the file if not there

<

Deprecated:
See also
APR_FOPEN_CREATE

< Open the file for writing

<

Deprecated:
See also
APR_FOPEN_WRITE

< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)

<

Deprecated:
See also
APR_FOPEN_BINARY

< Open should fail if APR_FOPEN_CREATE and file exists.

<

Deprecated:
See also
APR_FOPEN_EXCL

< Create the file if not there

<

Deprecated:
See also
APR_FOPEN_CREATE

< Open the file for writing

<

Deprecated:
See also
APR_FOPEN_WRITE

< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)

<

Deprecated:
See also
APR_FOPEN_BINARY

< Open the file for buffered I/O

<

Deprecated:
See also
APR_FOPEN_BUFFERED

< Open should fail if APR_FOPEN_CREATE and file exists.

<

Deprecated:
See also
APR_FOPEN_EXCL

Definition at line 965 of file mod_cache_disk.c.

Variable Documentation

◆ aplog_module_index

int* const aplog_module_index = &( cache_disk_module.module_index)
static

Definition at line 1577 of file mod_cache_disk.c.

◆ cache_disk_provider

const cache_provider cache_disk_provider
static
Initial value:
=
{
}
static apr_status_t recall_body(cache_handle_t *h, apr_pool_t *p, apr_bucket_brigade *bb)
static int remove_entity(cache_handle_t *h)
static apr_status_t store_body(cache_handle_t *h, request_rec *r, apr_bucket_brigade *in, apr_bucket_brigade *out)
static apr_status_t commit_entity(cache_handle_t *h, request_rec *r)
static apr_status_t store_headers(cache_handle_t *h, request_rec *r, cache_info *i)
static int create_entity(cache_handle_t *h, request_rec *r, const char *key, apr_off_t len, apr_bucket_brigade *bb)
static apr_status_t invalidate_entity(cache_handle_t *h, request_rec *r)
static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
static apr_status_t recall_headers(cache_handle_t *h, request_rec *r)
static int remove_url(cache_handle_t *h, request_rec *r)

Definition at line 1556 of file mod_cache_disk.c.

◆ disk_cache_cmds

const command_rec disk_cache_cmds[]
static
Initial value:
=
{
{ "CacheRoot" , set_cache_root , NULL , 128 , TAKE1, "The directory to store cache files" },
{ "CacheDirLevels" , set_cache_dirlevels , NULL , 128 , TAKE1, "The number of levels of subdirectories in the cache" },
{ "CacheDirLength" , set_cache_dirlength , NULL , 128 , TAKE1, "The number of characters in subdirectory names" },
{ "CacheMinFileSize" , set_cache_minfs , NULL , 128 | 64 , TAKE1, "The minimum file size to cache a document" },
{ "CacheMaxFileSize" , set_cache_maxfs , NULL , 128 | 64 , TAKE1, "The maximum file size to cache a document" },
{ "CacheReadSize" , set_cache_readsize , NULL , 128 | 64 , TAKE1, "The maximum quantity of data to attempt to read and cache in one go" },
{ "CacheReadTime" , set_cache_readtime , NULL , 128 | 64 , TAKE1, "The maximum time taken to attempt to read and cache in go" },
{NULL}
}
@ TAKE1
Definition http_config.h:51
static const char * set_cache_dirlength(cmd_parms *parms, void *in_struct_ptr, const char *arg)
static const char * set_cache_readsize(cmd_parms *parms, void *in_struct_ptr, const char *arg)
static const char * set_cache_root(cmd_parms *parms, void *in_struct_ptr, const char *arg)
static const char * set_cache_maxfs(cmd_parms *parms, void *in_struct_ptr, const char *arg)
static const char * set_cache_dirlevels(cmd_parms *parms, void *in_struct_ptr, const char *arg)
static const char * set_cache_minfs(cmd_parms *parms, void *in_struct_ptr, const char *arg)
static const char * set_cache_readtime(cmd_parms *parms, void *in_struct_ptr, const char *arg)
return NULL
Definition mod_so.c:359

Definition at line 1537 of file mod_cache_disk.c.