Apache HTTPD
Classes | Macros | Typedefs | Enumerations | Functions | Variables
mod_headers.c File Reference
#include "apr.h"
#include "apr_lib.h"
#include "apr_strings.h"
#include "apr_buckets.h"
#include "apr_hash.h"
#include "apr_want.h"
#include "httpd.h"
#include "http_config.h"
#include "http_request.h"
#include "http_ssl.h"
#include "http_log.h"
#include "util_filter.h"
#include "http_protocol.h"
#include "ap_expr.h"

Go to the source code of this file.

Classes

struct  format_tag
 
struct  header_entry
 
struct  echo_do
 
struct  edit_do
 
struct  headers_conf
 

Macros

#define APR_WANT_STRFUNC
 

Typedefs

typedef const charformat_tag_fn(request_rec *r, char *a)
 

Enumerations

enum  hdr_actions {
  hdr_add = 'a' , hdr_set = 's' , hdr_append = 'm' , hdr_merge = 'g' ,
  hdr_unset = 'u' , hdr_echo = 'e' , hdr_edit = 'r' , hdr_edit_r = 'R' ,
  hdr_setifempty = 'i' , hdr_note = 'n'
}
 

Functions

static const charconstant_item (request_rec *r, char *stuff)
 
static const charheader_request_duration (request_rec *r, char *a)
 
static const charheader_request_time (request_rec *r, char *a)
 
static const charunwrap_header (apr_pool_t *p, const char *hdr)
 
static const charheader_request_env_var (request_rec *r, char *a)
 
static const charheader_request_ssl_var (request_rec *r, char *name)
 
static const charheader_request_loadavg (request_rec *r, char *a)
 
static const charheader_request_idle (request_rec *r, char *a)
 
static const charheader_request_busy (request_rec *r, char *a)
 
static void * create_headers_dir_config (apr_pool_t *p, char *d)
 
static void * merge_headers_config (apr_pool_t *p, void *basev, void *overridesv)
 
static charparse_misc_string (apr_pool_t *p, format_tag *tag, const char **sa)
 
static charparse_format_tag (apr_pool_t *p, format_tag *tag, const char **sa)
 
static charparse_format_string (cmd_parms *cmd, header_entry *hdr, const char *s)
 
static APR_INLINE const charheader_inout_cmd (cmd_parms *cmd, void *indirconf, const char *action, const char *hdr, const char *value, const char *subs, const char *envclause)
 
static const charheader_cmd (cmd_parms *cmd, void *indirconf, const char *args)
 
static charprocess_tags (header_entry *hdr, request_rec *r)
 
static const charprocess_regexp (header_entry *hdr, const char *value, request_rec *r)
 
static int echo_header (void *v, const char *key, const char *val)
 
static int edit_header (void *v, const char *key, const char *val)
 
static int add_them_all (void *v, const char *key, const char *val)
 
static int do_headers_fixup (request_rec *r, apr_table_t *headers, apr_array_header_t *fixup, int early)
 
static void ap_headers_insert_output_filter (request_rec *r)
 
static void ap_headers_insert_error_filter (request_rec *r)
 
static apr_status_t ap_headers_output_filter (ap_filter_t *f, apr_bucket_brigade *in)
 
static apr_status_t ap_headers_error_filter (ap_filter_t *f, apr_bucket_brigade *in)
 
static apr_status_t ap_headers_fixup (request_rec *r)
 
static apr_status_t ap_headers_early (request_rec *r)
 
static void register_format_tag_handler (const char *tag, format_tag_fn *tag_handler)
 
static int header_pre_config (apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
 
static int header_post_config (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
 
static void register_hooks (apr_pool_t *p)
 

Variables

static apr_hash_tformat_tag_hash
 
static char hdr_in = '0'
 
static char hdr_out_onsuccess = '1'
 
static char hdr_out_always = '2'
 
static const charcondition_early = "early"
 
static const command_rec headers_cmds []
 
static int *const aplog_module_index = &( headers_module.module_index)
 

Macro Definition Documentation

◆ APR_WANT_STRFUNC

#define APR_WANT_STRFUNC

Definition at line 75 of file mod_headers.c.

Typedef Documentation

◆ format_tag_fn

typedef const char * format_tag_fn(request_rec *r, char *a)

Definition at line 111 of file mod_headers.c.

Enumeration Type Documentation

◆ hdr_actions

Enumerator
hdr_add 
hdr_set 
hdr_append 
hdr_merge 
hdr_unset 
hdr_echo 
hdr_edit 
hdr_edit_r 
hdr_setifempty 
hdr_note 

Definition at line 90 of file mod_headers.c.

Function Documentation

◆ add_them_all()

static int add_them_all ( void *  v,
const char key,
const char val 
)
static

Definition at line 685 of file mod_headers.c.

◆ ap_headers_early()

static apr_status_t ap_headers_early ( request_rec r)
static

< Module declines to handle

Definition at line 923 of file mod_headers.c.

◆ ap_headers_error_filter()

static apr_status_t ap_headers_error_filter ( ap_filter_t f,
apr_bucket_brigade in 
)
static

Definition at line 883 of file mod_headers.c.

◆ ap_headers_fixup()

static apr_status_t ap_headers_fixup ( request_rec r)
static

< Module declines to handle

Definition at line 911 of file mod_headers.c.

◆ ap_headers_insert_error_filter()

static void ap_headers_insert_error_filter ( request_rec r)
static

Definition at line 849 of file mod_headers.c.

◆ ap_headers_insert_output_filter()

static void ap_headers_insert_output_filter ( request_rec r)
static

Definition at line 836 of file mod_headers.c.

◆ ap_headers_output_filter()

static apr_status_t ap_headers_output_filter ( ap_filter_t f,
apr_bucket_brigade in 
)
static

Definition at line 859 of file mod_headers.c.

◆ constant_item()

static const char * constant_item ( request_rec r,
char stuff 
)
static

Definition at line 166 of file mod_headers.c.

◆ create_headers_dir_config()

static void * create_headers_dir_config ( apr_pool_t p,
char d 
)
static

Definition at line 243 of file mod_headers.c.

◆ do_headers_fixup()

static int do_headers_fixup ( request_rec r,
apr_table_t headers,
apr_array_header_t fixup,
int  early 
)
static

Definition at line 693 of file mod_headers.c.

◆ echo_header()

static int echo_header ( void *  v,
const char key,
const char val 
)
static

Definition at line 660 of file mod_headers.c.

◆ edit_header()

static int edit_header ( void *  v,
const char key,
const char val 
)
static

Definition at line 674 of file mod_headers.c.

◆ header_cmd()

static const char * header_cmd ( cmd_parms cmd,
void *  indirconf,
const char args 
)
static

Definition at line 554 of file mod_headers.c.

◆ header_inout_cmd()

static APR_INLINE const char * header_inout_cmd ( cmd_parms cmd,
void *  indirconf,
const char action,
const char hdr,
const char value,
const char subs,
const char envclause 
)
static

unused

unused

unused

Definition at line 419 of file mod_headers.c.

◆ header_post_config()

static int header_post_config ( apr_pool_t pconf,
apr_pool_t plog,
apr_pool_t ptemp,
server_rec s 
)
static

< Module has handled this stage.

Definition at line 980 of file mod_headers.c.

◆ header_pre_config()

static int header_pre_config ( apr_pool_t p,
apr_pool_t plog,
apr_pool_t ptemp 
)
static

< Module has handled this stage.

Definition at line 966 of file mod_headers.c.

◆ header_request_busy()

static const char * header_request_busy ( request_rec r,
char a 
)
static

Definition at line 232 of file mod_headers.c.

◆ header_request_duration()

static const char * header_request_duration ( request_rec r,
char a 
)
static

Definition at line 170 of file mod_headers.c.

◆ header_request_env_var()

static const char * header_request_env_var ( request_rec r,
char a 
)
static

Definition at line 197 of file mod_headers.c.

◆ header_request_idle()

static const char * header_request_idle ( request_rec r,
char a 
)
static

Definition at line 225 of file mod_headers.c.

◆ header_request_loadavg()

static const char * header_request_loadavg ( request_rec r,
char a 
)
static

Definition at line 217 of file mod_headers.c.

◆ header_request_ssl_var()

static const char * header_request_ssl_var ( request_rec r,
char name 
)
static

Definition at line 207 of file mod_headers.c.

◆ header_request_time()

static const char * header_request_time ( request_rec r,
char a 
)
static

Definition at line 175 of file mod_headers.c.

◆ merge_headers_config()

static void * merge_headers_config ( apr_pool_t p,
void *  basev,
void *  overridesv 
)
static

Definition at line 254 of file mod_headers.c.

◆ parse_format_string()

static char * parse_format_string ( cmd_parms cmd,
header_entry hdr,
const char s 
)
static

Definition at line 382 of file mod_headers.c.

◆ parse_format_tag()

static char * parse_format_tag ( apr_pool_t p,
format_tag tag,
const char **  sa 
)
static

Definition at line 330 of file mod_headers.c.

◆ parse_misc_string()

static char * parse_misc_string ( apr_pool_t p,
format_tag tag,
const char **  sa 
)
static

Definition at line 270 of file mod_headers.c.

◆ process_regexp()

static const char * process_regexp ( header_entry hdr,
const char value,
request_rec r 
)
static

Definition at line 625 of file mod_headers.c.

◆ process_tags()

static char * process_tags ( header_entry hdr,
request_rec r 
)
static

Definition at line 595 of file mod_headers.c.

◆ register_format_tag_handler()

static void register_format_tag_handler ( const char tag,
format_tag_fn tag_handler 
)
static

Definition at line 960 of file mod_headers.c.

◆ register_hooks()

static void register_hooks ( apr_pool_t p)
static

Definition at line 986 of file mod_headers.c.

◆ unwrap_header()

static const char * unwrap_header ( apr_pool_t p,
const char hdr 
)
static

Definition at line 182 of file mod_headers.c.

Variable Documentation

◆ aplog_module_index

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

Definition at line 1001 of file mod_headers.c.

◆ condition_early

const char* condition_early = "early"
static

Definition at line 123 of file mod_headers.c.

◆ format_tag_hash

apr_hash_t* format_tag_hash
static

Definition at line 88 of file mod_headers.c.

◆ hdr_in

char hdr_in = '0'
static

Definition at line 106 of file mod_headers.c.

◆ hdr_out_always

char hdr_out_always = '2'
static

Definition at line 108 of file mod_headers.c.

◆ hdr_out_onsuccess

char hdr_out_onsuccess = '1'
static

Definition at line 107 of file mod_headers.c.

◆ headers_cmds

const command_rec headers_cmds[]
static
Initial value:
=
{
{ "Header" , header_cmd , &hdr_out_onsuccess , 4 , RAW_ARGS, "an optional condition, an action, header and value " "followed by optional env clause" },
{ "RequestHeader" , header_cmd , &hdr_in , 4 , RAW_ARGS, "an action, header and value followed by optional env " "clause" },
{NULL}
}
@ RAW_ARGS
Definition http_config.h:50
static const char * header_cmd(cmd_parms *cmd, void *indirconf, const char *args)
static char hdr_in
static char hdr_out_onsuccess
return NULL
Definition mod_so.c:359

Definition at line 949 of file mod_headers.c.