Apache HTTPD
Classes | Macros | Typedefs | Functions | Variables
h2_config.c File Reference
#include <assert.h>
#include <apr_hash.h>
#include <apr_lib.h>
#include <httpd.h>
#include <http_core.h>
#include <http_config.h>
#include <http_log.h>
#include <http_vhost.h>
#include <ap_mpm.h>
#include <apr_strings.h>
#include "h2.h"
#include "h2_conn_ctx.h"
#include "h2_c1.h"
#include "h2_config.h"
#include "h2_protocol.h"
#include "h2_private.h"

Go to the source code of this file.

Classes

struct  h2_config
 
struct  h2_dir_config
 

Macros

#define DEF_VAL   (-1)
 
#define H2_CONFIG_GET(a, b, n)    (((a)->n == DEF_VAL)? (b) : (a))->n
 
#define H2_CONFIG_SET(a, n, v)    ((a)->n = v)
 
#define CONFIG_CMD_SET(cmd, dir, var, val)    h2_config_seti(((cmd)->path? (dir) : NULL), h2_config_sget((cmd)->server), var, val)
 
#define CONFIG_CMD_SET64(cmd, dir, var, val)    h2_config_seti64(((cmd)->path? (dir) : NULL), h2_config_sget((cmd)->server), var, val)
 
#define AP_END_CMD   AP_INIT_TAKE1(NULL, NULL, NULL, RSRC_CONF, NULL)
 

Typedefs

typedef struct h2_config h2_config
 
typedef struct h2_dir_config h2_dir_config
 

Functions

void h2_config_init (apr_pool_t *pool)
 
void * h2_config_create_svr (apr_pool_t *pool, server_rec *s)
 
static void * h2_config_merge (apr_pool_t *pool, void *basev, void *addv)
 
void * h2_config_merge_svr (apr_pool_t *pool, void *basev, void *addv)
 
void * h2_config_create_dir (apr_pool_t *pool, char *x)
 
void * h2_config_merge_dir (apr_pool_t *pool, void *basev, void *addv)
 
static apr_int64_t h2_srv_config_geti64 (const h2_config *conf, h2_config_var_t var)
 
static void h2_srv_config_seti (h2_config *conf, h2_config_var_t var, int val)
 
static void h2_srv_config_seti64 (h2_config *conf, h2_config_var_t var, apr_int64_t val)
 
static h2_configh2_config_sget (server_rec *s)
 
static const h2_dir_configh2_config_rget (request_rec *r)
 
static apr_int64_t h2_dir_config_geti64 (const h2_dir_config *conf, h2_config_var_t var)
 
static void h2_config_seti (h2_dir_config *dconf, h2_config *conf, h2_config_var_t var, int val)
 
static void h2_config_seti64 (h2_dir_config *dconf, h2_config *conf, h2_config_var_t var, apr_int64_t val)
 
static const h2_configh2_config_get (conn_rec *c)
 
int h2_config_cgeti (conn_rec *c, h2_config_var_t var)
 
apr_int64_t h2_config_cgeti64 (conn_rec *c, h2_config_var_t var)
 
int h2_config_sgeti (server_rec *s, h2_config_var_t var)
 
apr_int64_t h2_config_sgeti64 (server_rec *s, h2_config_var_t var)
 
int h2_config_geti (request_rec *r, server_rec *s, h2_config_var_t var)
 
apr_int64_t h2_config_geti64 (request_rec *r, server_rec *s, h2_config_var_t var)
 
int h2_config_rgeti (request_rec *r, h2_config_var_t var)
 
apr_int64_t h2_config_rgeti64 (request_rec *r, h2_config_var_t var)
 
apr_array_header_th2_config_push_list (request_rec *r)
 
apr_table_th2_config_early_headers (request_rec *r)
 
const struct h2_priorityh2_cconfig_get_priority (conn_rec *c, const char *content_type)
 
static const charh2_conf_set_max_streams (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_window_size (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_min_workers (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_max_workers (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_max_worker_idle_limit (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_stream_max_mem_size (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_max_data_frame_len (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_session_extra_files (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_serialize_headers (cmd_parms *parms, void *dirconf, const char *value)
 
static const charh2_conf_set_direct (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_push (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_websockets (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_add_push_priority (cmd_parms *cmd, void *_cfg, const char *ctype, const char *sdependency, const char *sweight)
 
static const charh2_conf_set_modern_tls_only (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_upgrade (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_tls_warmup_size (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_tls_cooldown_secs (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_push_diary_size (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_copy_files (cmd_parms *cmd, void *dirconf, const char *value)
 
static void add_push (apr_array_header_t **plist, apr_pool_t *pool, h2_push_res *push)
 
static const charh2_conf_add_push_res (cmd_parms *cmd, void *dirconf, const char *arg1, const char *arg2, const char *arg3)
 
static const charh2_conf_add_early_hint (cmd_parms *cmd, void *dirconf, const char *name, const char *value)
 
static const charh2_conf_set_early_hints (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_padding (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_output_buffer (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_stream_timeout (cmd_parms *cmd, void *dirconf, const char *value)
 
static const charh2_conf_set_proxy_requests (cmd_parms *cmd, void *dirconf, const char *value)
 
void h2_get_workers_config (server_rec *s, int *pminw, int *pmaxw, apr_time_t *pidle_limit)
 

Variables

static h2_config defconf
 
static h2_dir_config defdconf
 
const command_rec h2_cmds []
 

Macro Definition Documentation

◆ AP_END_CMD

#define AP_END_CMD   AP_INIT_TAKE1(NULL, NULL, NULL, RSRC_CONF, NULL)

Definition at line 1025 of file h2_config.c.

◆ CONFIG_CMD_SET

#define CONFIG_CMD_SET (   cmd,
  dir,
  var,
  val 
)     h2_config_seti(((cmd)->path? (dir) : NULL), h2_config_sget((cmd)->server), var, val)

Definition at line 47 of file h2_config.c.

◆ CONFIG_CMD_SET64

#define CONFIG_CMD_SET64 (   cmd,
  dir,
  var,
  val 
)     h2_config_seti64(((cmd)->path? (dir) : NULL), h2_config_sget((cmd)->server), var, val)

Definition at line 50 of file h2_config.c.

◆ DEF_VAL

#define DEF_VAL   (-1)

Definition at line 39 of file h2_config.c.

◆ H2_CONFIG_GET

#define H2_CONFIG_GET (   a,
  b,
  n 
)     (((a)->n == DEF_VAL)? (b) : (a))->n

Definition at line 41 of file h2_config.c.

◆ H2_CONFIG_SET

#define H2_CONFIG_SET (   a,
  n,
 
)     ((a)->n = v)

Definition at line 44 of file h2_config.c.

Typedef Documentation

◆ h2_config

◆ h2_dir_config

Function Documentation

◆ add_push()

static void add_push ( apr_array_header_t **  plist,
apr_pool_t pool,
h2_push_res push 
)
static

Definition at line 854 of file h2_config.c.

◆ h2_cconfig_get_priority()

const struct h2_priority * h2_cconfig_get_priority ( conn_rec c,
const char content_type 
)

Definition at line 561 of file h2_config.c.

◆ h2_conf_add_early_hint()

static const char * h2_conf_add_early_hint ( cmd_parms cmd,
void *  dirconf,
const char name,
const char value 
)
static

Definition at line 902 of file h2_config.c.

◆ h2_conf_add_push_priority()

static const char * h2_conf_add_push_priority ( cmd_parms cmd,
void *  _cfg,
const char ctype,
const char sdependency,
const char sweight 
)
static

Definition at line 722 of file h2_config.c.

◆ h2_conf_add_push_res()

static const char * h2_conf_add_push_res ( cmd_parms cmd,
void *  dirconf,
const char arg1,
const char arg2,
const char arg3 
)
static

Definition at line 865 of file h2_config.c.

◆ h2_conf_set_copy_files()

static const char * h2_conf_set_copy_files ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 840 of file h2_config.c.

◆ h2_conf_set_direct()

static const char * h2_conf_set_direct ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 675 of file h2_config.c.

◆ h2_conf_set_early_hints()

static const char * h2_conf_set_early_hints ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 933 of file h2_config.c.

◆ h2_conf_set_max_data_frame_len()

static const char * h2_conf_set_max_data_frame_len ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 642 of file h2_config.c.

◆ h2_conf_set_max_streams()

static const char * h2_conf_set_max_streams ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 572 of file h2_config.c.

◆ h2_conf_set_max_worker_idle_limit()

static const char * h2_conf_set_max_worker_idle_limit ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 616 of file h2_config.c.

◆ h2_conf_set_max_workers()

static const char * h2_conf_set_max_workers ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 605 of file h2_config.c.

◆ h2_conf_set_min_workers()

static const char * h2_conf_set_min_workers ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 594 of file h2_config.c.

◆ h2_conf_set_modern_tls_only()

static const char * h2_conf_set_modern_tls_only ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 779 of file h2_config.c.

◆ h2_conf_set_output_buffer()

static const char * h2_conf_set_output_buffer ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 965 of file h2_config.c.

◆ h2_conf_set_padding()

static const char * h2_conf_set_padding ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 950 of file h2_config.c.

◆ h2_conf_set_proxy_requests()

static const char * h2_conf_set_proxy_requests ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 993 of file h2_config.c.

◆ h2_conf_set_push()

static const char * h2_conf_set_push ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 689 of file h2_config.c.

◆ h2_conf_set_push_diary_size()

static const char * h2_conf_set_push_diary_size ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 823 of file h2_config.c.

◆ h2_conf_set_serialize_headers()

static const char * h2_conf_set_serialize_headers ( cmd_parms parms,
void *  dirconf,
const char value 
)
static

Definition at line 664 of file h2_config.c.

◆ h2_conf_set_session_extra_files()

static const char * h2_conf_set_session_extra_files ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 653 of file h2_config.c.

◆ h2_conf_set_stream_max_mem_size()

static const char * h2_conf_set_stream_max_mem_size ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 631 of file h2_config.c.

◆ h2_conf_set_stream_timeout()

static const char * h2_conf_set_stream_timeout ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 979 of file h2_config.c.

◆ h2_conf_set_tls_cooldown_secs()

static const char * h2_conf_set_tls_cooldown_secs ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 815 of file h2_config.c.

◆ h2_conf_set_tls_warmup_size()

static const char * h2_conf_set_tls_warmup_size ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 807 of file h2_config.c.

◆ h2_conf_set_upgrade()

static const char * h2_conf_set_upgrade ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 793 of file h2_config.c.

◆ h2_conf_set_websockets()

static const char * h2_conf_set_websockets ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 702 of file h2_config.c.

◆ h2_conf_set_window_size()

static const char * h2_conf_set_window_size ( cmd_parms cmd,
void *  dirconf,
const char value 
)
static

Definition at line 583 of file h2_config.c.

◆ h2_config_cgeti()

int h2_config_cgeti ( conn_rec c,
h2_config_var_t  var 
)

Get the configured value for variable at the given connection.

Definition at line 496 of file h2_config.c.

◆ h2_config_cgeti64()

apr_int64_t h2_config_cgeti64 ( conn_rec c,
h2_config_var_t  var 
)

Definition at line 501 of file h2_config.c.

◆ h2_config_create_dir()

void * h2_config_create_dir ( apr_pool_t pool,
char x 
)

Definition at line 229 of file h2_config.c.

◆ h2_config_create_svr()

void * h2_config_create_svr ( apr_pool_t pool,
server_rec s 
)

Definition at line 139 of file h2_config.c.

◆ h2_config_early_headers()

apr_table_t * h2_config_early_headers ( request_rec r)

Definition at line 549 of file h2_config.c.

◆ h2_config_get()

static const h2_config * h2_config_get ( conn_rec c)
static

Definition at line 486 of file h2_config.c.

◆ h2_config_geti()

int h2_config_geti ( request_rec r,
server_rec s,
h2_config_var_t  var 
)

Definition at line 516 of file h2_config.c.

◆ h2_config_geti64()

apr_int64_t h2_config_geti64 ( request_rec r,
server_rec s,
h2_config_var_t  var 
)

Definition at line 521 of file h2_config.c.

◆ h2_config_init()

void h2_config_init ( apr_pool_t pool)

Definition at line 134 of file h2_config.c.

◆ h2_config_merge()

static void * h2_config_merge ( apr_pool_t pool,
void *  basev,
void *  addv 
)
static

Definition at line 173 of file h2_config.c.

◆ h2_config_merge_dir()

void * h2_config_merge_dir ( apr_pool_t pool,
void *  basev,
void *  addv 
)

Definition at line 243 of file h2_config.c.

◆ h2_config_merge_svr()

void * h2_config_merge_svr ( apr_pool_t pool,
void *  basev,
void *  addv 
)

Definition at line 224 of file h2_config.c.

◆ h2_config_push_list()

apr_array_header_t * h2_config_push_list ( request_rec r)

Definition at line 537 of file h2_config.c.

◆ h2_config_rget()

static const h2_dir_config * h2_config_rget ( request_rec r)
static

Definition at line 415 of file h2_config.c.

◆ h2_config_rgeti()

int h2_config_rgeti ( request_rec r,
h2_config_var_t  var 
)

Get the configured value for variable at the given request, if configured for the request location. Fallback to request server config otherwise.

Definition at line 527 of file h2_config.c.

◆ h2_config_rgeti64()

apr_int64_t h2_config_rgeti64 ( request_rec r,
h2_config_var_t  var 
)

Definition at line 532 of file h2_config.c.

◆ h2_config_seti()

static void h2_config_seti ( h2_dir_config dconf,
h2_config conf,
h2_config_var_t  var,
int  val 
)
static

Definition at line 440 of file h2_config.c.

◆ h2_config_seti64()

static void h2_config_seti64 ( h2_dir_config dconf,
h2_config conf,
h2_config_var_t  var,
apr_int64_t  val 
)
static

Definition at line 466 of file h2_config.c.

◆ h2_config_sget()

static h2_config * h2_config_sget ( server_rec s)
static

Definition at line 407 of file h2_config.c.

◆ h2_config_sgeti()

int h2_config_sgeti ( server_rec s,
h2_config_var_t  var 
)

Get the configured value for variable at the given server.

Definition at line 506 of file h2_config.c.

◆ h2_config_sgeti64()

apr_int64_t h2_config_sgeti64 ( server_rec s,
h2_config_var_t  var 
)

Definition at line 511 of file h2_config.c.

◆ h2_dir_config_geti64()

static apr_int64_t h2_dir_config_geti64 ( const h2_dir_config conf,
h2_config_var_t  var 
)
static

Definition at line 423 of file h2_config.c.

◆ h2_get_workers_config()

void h2_get_workers_config ( server_rec s,
int pminw,
int pmaxw,
apr_time_t pidle_limit 
)

Definition at line 1007 of file h2_config.c.

◆ h2_srv_config_geti64()

static apr_int64_t h2_srv_config_geti64 ( const h2_config conf,
h2_config_var_t  var 
)
static

Definition at line 269 of file h2_config.c.

◆ h2_srv_config_seti()

static void h2_srv_config_seti ( h2_config conf,
h2_config_var_t  var,
int  val 
)
static

Definition at line 321 of file h2_config.c.

◆ h2_srv_config_seti64()

static void h2_srv_config_seti64 ( h2_config conf,
h2_config_var_t  var,
apr_int64_t  val 
)
static

Definition at line 389 of file h2_config.c.

Variable Documentation

◆ defconf

h2_config defconf
static
Initial value:
= {
"default",
100,
((64*1024)-1) ,
-1,
-1,
((apr_time_t)( 10 * 60 ) * APR_INT64_C( 1000000 ) ),
32 * 1024,
-1,
1,
-1,
1024*1024,
1,
1,
NULL,
256,
0,
NULL,
NULL,
0,
0,
1,
1,
-1,
0,
0,
0,
}
apr_size_t size
apr_int64_t apr_time_t
Definition apr_time.h:45
return NULL
Definition mod_so.c:359

Definition at line 95 of file h2_config.c.

◆ defdconf

h2_dir_config defdconf
static
Initial value:
= {
"default",
-1,
-1,
NULL,
NULL,
-1,
-1,
}

Definition at line 124 of file h2_config.c.

◆ h2_cmds

const command_rec h2_cmds[]

Definition at line 1027 of file h2_config.c.