Main Page | Modules | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

mod_expires.c File Reference

#include "apr.h"
#include "apr_strings.h"
#include "apr_lib.h"
#include "apr_want.h"
#include "ap_config.h"
#include "httpd.h"
#include "http_config.h"
#include "http_log.h"
#include "http_request.h"
#include "http_protocol.h"

Include dependency graph for mod_expires.c:

Go to the source code of this file.

Defines

#define APR_WANT_STRFUNC
#define DIR_CMD_PERMS   OR_INDEXES
#define ACTIVE_ON   1
#define ACTIVE_OFF   0
#define ACTIVE_DONTCARE   2

Functions

static void * create_dir_expires_config (apr_pool_t *p, char *dummy)
static const char * set_expiresactive (cmd_parms *cmd, void *in_dir_config, int arg)
static char * check_code (apr_pool_t *p, const char *code, char **real_code)
static const char * set_expiresbytype (cmd_parms *cmd, void *in_dir_config, const char *mime, const char *code)
static const char * set_expiresdefault (cmd_parms *cmd, void *in_dir_config, const char *code)
static void * merge_expires_dir_configs (apr_pool_t *p, void *basev, void *addv)
static int set_expiration_fields (request_rec *r, const char *code, apr_table_t *t)
static apr_status_t expires_filter (ap_filter_t *f, apr_bucket_brigade *b)
static void expires_insert_filter (request_rec *r)
static void register_hooks (apr_pool_t *p)

Variables

module AP_MODULE_DECLARE_DATA expires_module
static const command_rec expires_cmds []


Define Documentation

#define ACTIVE_DONTCARE   2
 

Definition at line 181 of file mod_expires.c.

Referenced by create_dir_expires_config(), and merge_expires_dir_configs().

#define ACTIVE_OFF   0
 

Definition at line 180 of file mod_expires.c.

Referenced by set_expiresactive().

#define ACTIVE_ON   1
 

Definition at line 179 of file mod_expires.c.

Referenced by expires_insert_filter(), and set_expiresactive().

#define APR_WANT_STRFUNC
 

Definition at line 158 of file mod_expires.c.

#define DIR_CMD_PERMS   OR_INDEXES
 

Definition at line 177 of file mod_expires.c.


Function Documentation

static char* check_code apr_pool_t p,
const char *  code,
char **  real_code
[static]
 

Definition at line 214 of file mod_expires.c.

References apr_isdigit, base, NULL, num, strncasecmp(), and word.

Referenced by set_expiresbytype(), and set_expiresdefault().

Here is the call graph for this function:

static void* create_dir_expires_config apr_pool_t p,
char *  dummy
[static]
 

Definition at line 185 of file mod_expires.c.

References ACTIVE_DONTCARE, apr_pcalloc, and NULL.

static apr_status_t expires_filter ap_filter_t f,
apr_bucket_brigade b
[static]
 

Definition at line 444 of file mod_expires.c.

References ap_get_module_config, ap_strchr, conf, request_rec::content_type, request_rec::err_headers_out, expires_module, expires_dir_config::expiresbytype, expires_dir_config::expiresdefault, request_rec::headers_out, ap_filter_t::next, NULL, request_rec::per_dir_config, request_rec::pool, ap_filter_t::r, r, set_expiration_fields(), t, and expires_dir_config::wildcards.

Referenced by register_hooks().

Here is the call graph for this function:

static void expires_insert_filter request_rec r  )  [static]
 

Definition at line 518 of file mod_expires.c.

References expires_dir_config::active, ACTIVE_ON, ap_get_module_config, ap_is_HTTP_ERROR, conf, request_rec::connection, expires_module, expires_dir_config::expiresbytype, expires_dir_config::expiresdefault, request_rec::main, NULL, request_rec::per_dir_config, and request_rec::status.

Referenced by register_hooks().

static void* merge_expires_dir_configs apr_pool_t p,
void *  basev,
void *  addv
[static]
 

Definition at line 361 of file mod_expires.c.

References expires_dir_config::active, ACTIVE_DONTCARE, apr_pcalloc, base, expires_dir_config::expiresbytype, expires_dir_config::expiresdefault, NULL, and expires_dir_config::wildcards.

static void register_hooks apr_pool_t p  )  [static]
 

Definition at line 543 of file mod_expires.c.

References AP_FTYPE_CONTENT_SET, APR_HOOK_MIDDLE, expires_filter(), expires_insert_filter(), and NULL.

Here is the call graph for this function:

static int set_expiration_fields request_rec r,
const char *  code,
apr_table_t t
[static]
 

Definition at line 391 of file mod_expires.c.

References APLOG_ERR, APLOG_MARK, apr_rfc822_date(), APR_RFC822_DATE_LEN, apr_time_from_sec, apr_time_sec, APR_TIME_T_FMT, base, DECLINED, request_rec::filename, apr_finfo_t::filetype, request_rec::finfo, HTTP_INTERNAL_SERVER_ERROR, apr_finfo_t::mtime, OK, request_rec::pool, and request_rec::request_time.

Referenced by expires_filter().

Here is the call graph for this function:

static const char* set_expiresactive cmd_parms cmd,
void *  in_dir_config,
int  arg
[static]
 

Definition at line 196 of file mod_expires.c.

References expires_dir_config::active, ACTIVE_OFF, ACTIVE_ON, dir_config, and NULL.

static const char* set_expiresbytype cmd_parms cmd,
void *  in_dir_config,
const char *  mime,
const char *  code
[static]
 

Definition at line 316 of file mod_expires.c.

References ap_strrchr_c, check_code(), dir_config, expires_dir_config::expiresbytype, NULL, cmd_parms_struct::pool, response, and expires_dir_config::wildcards.

Here is the call graph for this function:

static const char* set_expiresdefault cmd_parms cmd,
void *  in_dir_config,
const char *  code
[static]
 

Definition at line 336 of file mod_expires.c.

References check_code(), dir_config, expires_dir_config::expiresdefault, NULL, cmd_parms_struct::pool, and response.

Here is the call graph for this function:


Variable Documentation

const command_rec expires_cmds[] [static]
 

Initial value:

{
    AP_INIT_FLAG("ExpiresActive", set_expiresactive, NULL, DIR_CMD_PERMS,
                 "Limited to 'on' or 'off'"),
    AP_INIT_TAKE2("ExpiresByType", set_expiresbytype, NULL, DIR_CMD_PERMS,
                  "a MIME type followed by an expiry date code"),
    AP_INIT_TAKE1("ExpiresDefault", set_expiresdefault, NULL, DIR_CMD_PERMS,
                  "an expiry date code"),
    {NULL}
}

Definition at line 350 of file mod_expires.c.

module AP_MODULE_DECLARE_DATA expires_module
 

Initial value:

Definition at line 554 of file mod_expires.c.

Referenced by expires_filter(), and expires_insert_filter().