]> granicus.if.org Git - apache/blob - modules/http2/h2_config.h
merged latest changes in 2.4.x
[apache] / modules / http2 / h2_config.h
1 /* Copyright 2015 greenbytes GmbH (https://www.greenbytes.de)
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 #ifndef __mod_h2__h2_config_h__
17 #define __mod_h2__h2_config_h__
18
19 #undef PACKAGE_VERSION
20 #undef PACKAGE_TARNAME
21 #undef PACKAGE_STRING
22 #undef PACKAGE_NAME
23 #undef PACKAGE_BUGREPORT
24
25 typedef enum {
26     H2_CONF_MAX_STREAMS,
27     H2_CONF_WIN_SIZE,
28     H2_CONF_MIN_WORKERS,
29     H2_CONF_MAX_WORKERS,
30     H2_CONF_MAX_WORKER_IDLE_SECS,
31     H2_CONF_STREAM_MAX_MEM,
32     H2_CONF_ALT_SVCS,
33     H2_CONF_ALT_SVC_MAX_AGE,
34     H2_CONF_SER_HEADERS,
35     H2_CONF_DIRECT,
36     H2_CONF_SESSION_FILES,
37 } h2_config_var_t;
38
39 /* Apache httpd module configuration for h2. */
40 typedef struct h2_config {
41     const char *name;
42     int h2_max_streams;           /* max concurrent # streams (http2) */
43     int h2_window_size;           /* stream window size (http2) */
44     int min_workers;              /* min # of worker threads/child */
45     int max_workers;              /* max # of worker threads/child */
46     int max_worker_idle_secs;     /* max # of idle seconds for worker */
47     int stream_max_mem_size;      /* max # bytes held in memory/stream */
48     apr_array_header_t *alt_svcs; /* h2_alt_svc specs for this server */
49     int alt_svc_max_age;          /* seconds clients can rely on alt-svc info*/
50     int serialize_headers;        /* Use serialized HTTP/1.1 headers for 
51                                      processing, better compatibility */
52     int h2_direct;                /* if mod_h2 is active directly */
53     int session_extra_files;      /* # of extra files a session may keep open */  
54 } h2_config;
55
56
57 void *h2_config_create_dir(apr_pool_t *pool, char *x);
58 void *h2_config_create_svr(apr_pool_t *pool, server_rec *s);
59 void *h2_config_merge(apr_pool_t *pool, void *basev, void *addv);
60
61 apr_status_t h2_config_apply_header(h2_config *config, request_rec *r);
62
63 extern const command_rec h2_cmds[];
64
65 h2_config *h2_config_get(conn_rec *c);
66 h2_config *h2_config_sget(server_rec *s);
67 h2_config *h2_config_rget(request_rec *r);
68
69 int h2_config_geti(h2_config *conf, h2_config_var_t var);
70
71 void h2_config_init(apr_pool_t *pool);
72
73 #endif /* __mod_h2__h2_config_h__ */
74