"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "mod_http2/h2_config.c" between
mod_http2-1.15.16.tar.gz and mod_http2-1.15.17.tar.gz

About: mod_h[ttp]2 is an Apache httpd module implementing the HTTP2 protocol. It uses nghttp2 as base engine and connects it with the Apache infrastructure. Hint: Module (previous name "mod_h2") now integrated into Apache httpd (since v2.4.17). Experimental release.

h2_config.c  (mod_http2-1.15.16):h2_config.c  (mod_http2-1.15.17)
skipping to change at line 81 skipping to change at line 81
int tls_cooldown_secs; /* Seconds of idle time before going back to s mall TLS records */ int tls_cooldown_secs; /* Seconds of idle time before going back to s mall TLS records */
int h2_push; /* if HTTP/2 server push is enabled */ int h2_push; /* if HTTP/2 server push is enabled */
struct apr_hash_t *priorities;/* map of content-type to h2_priority records */ struct apr_hash_t *priorities;/* map of content-type to h2_priority records */
int push_diary_size; /* # of entries in push diary */ int push_diary_size; /* # of entries in push diary */
int copy_files; /* if files shall be copied vs setaside on out put */ int copy_files; /* if files shall be copied vs setaside on out put */
apr_array_header_t *push_list;/* list of h2_push_res configurations */ apr_array_header_t *push_list;/* list of h2_push_res configurations */
int early_hints; /* support status code 103 */ int early_hints; /* support status code 103 */
int padding_bits; int padding_bits;
int padding_always; int padding_always;
int output_buffered;
} h2_config; } h2_config;
typedef struct h2_dir_config { typedef struct h2_dir_config {
const char *name; const char *name;
apr_array_header_t *alt_svcs; /* h2_alt_svc specs for this server */ apr_array_header_t *alt_svcs; /* h2_alt_svc specs for this server */
int alt_svc_max_age; /* seconds clients can rely on alt-svc info*/ int alt_svc_max_age; /* seconds clients can rely on alt-svc info*/
int h2_upgrade; /* Allow HTTP/1 upgrade to h2/h2c */ int h2_upgrade; /* Allow HTTP/1 upgrade to h2/h2c */
int h2_push; /* if HTTP/2 server push is enabled */ int h2_push; /* if HTTP/2 server push is enabled */
apr_array_header_t *push_list;/* list of h2_push_res configurations */ apr_array_header_t *push_list;/* list of h2_push_res configurations */
int early_hints; /* support status code 103 */ int early_hints; /* support status code 103 */
skipping to change at line 117 skipping to change at line 118
1024*1024, /* TLS warmup size */ 1024*1024, /* TLS warmup size */
1, /* TLS cooldown secs */ 1, /* TLS cooldown secs */
1, /* HTTP/2 server push enabled */ 1, /* HTTP/2 server push enabled */
NULL, /* map of content-type to priorities */ NULL, /* map of content-type to priorities */
256, /* push diary size */ 256, /* push diary size */
0, /* copy files across threads */ 0, /* copy files across threads */
NULL, /* push list */ NULL, /* push list */
0, /* early hints, http status 103 */ 0, /* early hints, http status 103 */
0, /* padding bits */ 0, /* padding bits */
1, /* padding always */ 1, /* padding always */
1, /* strean output buffered */
}; };
static h2_dir_config defdconf = { static h2_dir_config defdconf = {
"default", "default",
NULL, /* no alt-svcs */ NULL, /* no alt-svcs */
-1, /* alt-svc max age */ -1, /* alt-svc max age */
-1, /* HTTP/1 Upgrade support */ -1, /* HTTP/1 Upgrade support */
-1, /* HTTP/2 server push enabled */ -1, /* HTTP/2 server push enabled */
NULL, /* push list */ NULL, /* push list */
-1, /* early hints, http status 103 */ -1, /* early hints, http status 103 */
skipping to change at line 161 skipping to change at line 163
conf->tls_warmup_size = DEF_VAL; conf->tls_warmup_size = DEF_VAL;
conf->tls_cooldown_secs = DEF_VAL; conf->tls_cooldown_secs = DEF_VAL;
conf->h2_push = DEF_VAL; conf->h2_push = DEF_VAL;
conf->priorities = NULL; conf->priorities = NULL;
conf->push_diary_size = DEF_VAL; conf->push_diary_size = DEF_VAL;
conf->copy_files = DEF_VAL; conf->copy_files = DEF_VAL;
conf->push_list = NULL; conf->push_list = NULL;
conf->early_hints = DEF_VAL; conf->early_hints = DEF_VAL;
conf->padding_bits = DEF_VAL; conf->padding_bits = DEF_VAL;
conf->padding_always = DEF_VAL; conf->padding_always = DEF_VAL;
conf->output_buffered = DEF_VAL;
return conf; return conf;
} }
static void *h2_config_merge(apr_pool_t *pool, void *basev, void *addv) static void *h2_config_merge(apr_pool_t *pool, void *basev, void *addv)
{ {
h2_config *base = (h2_config *)basev; h2_config *base = (h2_config *)basev;
h2_config *add = (h2_config *)addv; h2_config *add = (h2_config *)addv;
h2_config *n = (h2_config *)apr_pcalloc(pool, sizeof(h2_config)); h2_config *n = (h2_config *)apr_pcalloc(pool, sizeof(h2_config));
char *name = apr_pstrcat(pool, "merged[", add->name, ", ", base->name, "]", NULL); char *name = apr_pstrcat(pool, "merged[", add->name, ", ", base->name, "]", NULL);
n->name = name; n->name = name;
skipping to change at line 195 skipping to change at line 198
n->tls_cooldown_secs = H2_CONFIG_GET(add, base, tls_cooldown_secs); n->tls_cooldown_secs = H2_CONFIG_GET(add, base, tls_cooldown_secs);
n->h2_push = H2_CONFIG_GET(add, base, h2_push); n->h2_push = H2_CONFIG_GET(add, base, h2_push);
if (add->priorities && base->priorities) { if (add->priorities && base->priorities) {
n->priorities = apr_hash_overlay(pool, add->priorities, base->prio rities); n->priorities = apr_hash_overlay(pool, add->priorities, base->prio rities);
} }
else { else {
n->priorities = add->priorities? add->priorities : base->prioritie s; n->priorities = add->priorities? add->priorities : base->prioritie s;
} }
n->push_diary_size = H2_CONFIG_GET(add, base, push_diary_size); n->push_diary_size = H2_CONFIG_GET(add, base, push_diary_size);
n->copy_files = H2_CONFIG_GET(add, base, copy_files); n->copy_files = H2_CONFIG_GET(add, base, copy_files);
n->output_buffered = H2_CONFIG_GET(add, base, output_buffered);
if (add->push_list && base->push_list) { if (add->push_list && base->push_list) {
n->push_list = apr_array_append(pool, base->push_list, add->push_ list); n->push_list = apr_array_append(pool, base->push_list, add->push_ list);
} }
else { else {
n->push_list = add->push_list? add->push_list : base->push_list; n->push_list = add->push_list? add->push_list : base->push_list;
} }
n->early_hints = H2_CONFIG_GET(add, base, early_hints); n->early_hints = H2_CONFIG_GET(add, base, early_hints);
n->padding_bits = H2_CONFIG_GET(add, base, padding_bits); n->padding_bits = H2_CONFIG_GET(add, base, padding_bits);
n->padding_always = H2_CONFIG_GET(add, base, padding_always); n->padding_always = H2_CONFIG_GET(add, base, padding_always);
return n; return n;
skipping to change at line 288 skipping to change at line 292
case H2_CONF_PUSH_DIARY_SIZE: case H2_CONF_PUSH_DIARY_SIZE:
return H2_CONFIG_GET(conf, &defconf, push_diary_size); return H2_CONFIG_GET(conf, &defconf, push_diary_size);
case H2_CONF_COPY_FILES: case H2_CONF_COPY_FILES:
return H2_CONFIG_GET(conf, &defconf, copy_files); return H2_CONFIG_GET(conf, &defconf, copy_files);
case H2_CONF_EARLY_HINTS: case H2_CONF_EARLY_HINTS:
return H2_CONFIG_GET(conf, &defconf, early_hints); return H2_CONFIG_GET(conf, &defconf, early_hints);
case H2_CONF_PADDING_BITS: case H2_CONF_PADDING_BITS:
return H2_CONFIG_GET(conf, &defconf, padding_bits); return H2_CONFIG_GET(conf, &defconf, padding_bits);
case H2_CONF_PADDING_ALWAYS: case H2_CONF_PADDING_ALWAYS:
return H2_CONFIG_GET(conf, &defconf, padding_always); return H2_CONFIG_GET(conf, &defconf, padding_always);
case H2_CONF_OUTPUT_BUFFER:
return H2_CONFIG_GET(conf, &defconf, output_buffered);
default: default:
return DEF_VAL; return DEF_VAL;
} }
} }
static void h2_srv_config_seti(h2_config *conf, h2_config_var_t var, int val) static void h2_srv_config_seti(h2_config *conf, h2_config_var_t var, int val)
{ {
switch(var) { switch(var) {
case H2_CONF_MAX_STREAMS: case H2_CONF_MAX_STREAMS:
H2_CONFIG_SET(conf, h2_max_streams, val); H2_CONFIG_SET(conf, h2_max_streams, val);
skipping to change at line 353 skipping to change at line 359
break; break;
case H2_CONF_EARLY_HINTS: case H2_CONF_EARLY_HINTS:
H2_CONFIG_SET(conf, early_hints, val); H2_CONFIG_SET(conf, early_hints, val);
break; break;
case H2_CONF_PADDING_BITS: case H2_CONF_PADDING_BITS:
H2_CONFIG_SET(conf, padding_bits, val); H2_CONFIG_SET(conf, padding_bits, val);
break; break;
case H2_CONF_PADDING_ALWAYS: case H2_CONF_PADDING_ALWAYS:
H2_CONFIG_SET(conf, padding_always, val); H2_CONFIG_SET(conf, padding_always, val);
break; break;
case H2_CONF_OUTPUT_BUFFER:
H2_CONFIG_SET(conf, output_buffered, val);
break;
default: default:
break; break;
} }
} }
static void h2_srv_config_seti64(h2_config *conf, h2_config_var_t var, apr_int64 _t val) static void h2_srv_config_seti64(h2_config *conf, h2_config_var_t var, apr_int64 _t val)
{ {
switch(var) { switch(var) {
case H2_CONF_TLS_WARMUP_SIZE: case H2_CONF_TLS_WARMUP_SIZE:
H2_CONFIG_SET(conf, tls_warmup_size, val); H2_CONFIG_SET(conf, tls_warmup_size, val);
skipping to change at line 907 skipping to change at line 916
if (val < 0) { if (val < 0) {
return "number of bits must be >= 0"; return "number of bits must be >= 0";
} }
if (val > 8) { if (val > 8) {
return "number of bits must be <= 8"; return "number of bits must be <= 8";
} }
CONFIG_CMD_SET(cmd, dirconf, H2_CONF_PADDING_BITS, val); CONFIG_CMD_SET(cmd, dirconf, H2_CONF_PADDING_BITS, val);
return NULL; return NULL;
} }
static const char *h2_conf_set_output_buffer(cmd_parms *cmd,
void *dirconf, const char *value)
{
if (!strcasecmp(value, "On")) {
CONFIG_CMD_SET(cmd, dirconf, H2_CONF_OUTPUT_BUFFER, 1);
return NULL;
}
else if (!strcasecmp(value, "Off")) {
CONFIG_CMD_SET(cmd, dirconf, H2_CONF_OUTPUT_BUFFER, 0);
return NULL;
}
return "value must be On or Off";
}
void h2_get_num_workers(server_rec *s, int *minw, int *maxw) void h2_get_num_workers(server_rec *s, int *minw, int *maxw)
{ {
int threads_per_child = 0; int threads_per_child = 0;
*minw = h2_config_sgeti(s, H2_CONF_MIN_WORKERS); *minw = h2_config_sgeti(s, H2_CONF_MIN_WORKERS);
*maxw = h2_config_sgeti(s, H2_CONF_MAX_WORKERS); *maxw = h2_config_sgeti(s, H2_CONF_MAX_WORKERS);
ap_mpm_query(AP_MPMQ_MAX_THREADS, &threads_per_child); ap_mpm_query(AP_MPMQ_MAX_THREADS, &threads_per_child);
if (*minw <= 0) { if (*minw <= 0) {
*minw = threads_per_child; *minw = threads_per_child;
skipping to change at line 977 skipping to change at line 1000
AP_INIT_TAKE1("H2PushDiarySize", h2_conf_set_push_diary_size, NULL, AP_INIT_TAKE1("H2PushDiarySize", h2_conf_set_push_diary_size, NULL,
RSRC_CONF, "size of push diary"), RSRC_CONF, "size of push diary"),
AP_INIT_TAKE1("H2CopyFiles", h2_conf_set_copy_files, NULL, AP_INIT_TAKE1("H2CopyFiles", h2_conf_set_copy_files, NULL,
OR_FILEINFO, "on to perform copy of file data"), OR_FILEINFO, "on to perform copy of file data"),
AP_INIT_TAKE123("H2PushResource", h2_conf_add_push_res, NULL, AP_INIT_TAKE123("H2PushResource", h2_conf_add_push_res, NULL,
OR_FILEINFO|OR_AUTHCFG, "add a resource to be pushed in this location/on this server."), OR_FILEINFO|OR_AUTHCFG, "add a resource to be pushed in this location/on this server."),
AP_INIT_TAKE1("H2EarlyHints", h2_conf_set_early_hints, NULL, AP_INIT_TAKE1("H2EarlyHints", h2_conf_set_early_hints, NULL,
RSRC_CONF, "on to enable interim status 103 responses"), RSRC_CONF, "on to enable interim status 103 responses"),
AP_INIT_TAKE1("H2Padding", h2_conf_set_padding, NULL, AP_INIT_TAKE1("H2Padding", h2_conf_set_padding, NULL,
RSRC_CONF, "set payload padding"), RSRC_CONF, "set payload padding"),
AP_INIT_TAKE1("H2OutputBuffering", h2_conf_set_output_buffer, NULL,
RSRC_CONF, "set stream output buffer on/off"),
AP_END_CMD AP_END_CMD
}; };
 End of changes. 8 change blocks. 
0 lines changed or deleted 25 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)