17 #ifndef __mod_h2__h2__
18 #define __mod_h2__h2__
23 #include <nghttp2/nghttp2ver.h>
33 #define H2_USE_PIPES 0
35 #define H2_USE_PIPES (APR_FILES_AS_SOCKETS && APR_VERSION_AT_LEAST(1,6,0))
38 #if AP_MODULE_MAGIC_AT_LEAST(20211221, 15)
39 #define H2_USE_POLLFD_FROM_CONN 1
41 #define H2_USE_POLLFD_FROM_CONN 0
46 #if H2_USE_PIPES && defined(NGHTTP2_VERSION_NUM) && NGHTTP2_VERSION_NUM >= 0x012200 && APR_VERSION_AT_LEAST(1,7,0)
47 #define H2_USE_WEBSOCKETS 1
49 #define H2_USE_WEBSOCKETS 0
58 #define H2_ERR_NO_ERROR (0x00)
59 #define H2_ERR_PROTOCOL_ERROR (0x01)
60 #define H2_ERR_INTERNAL_ERROR (0x02)
61 #define H2_ERR_FLOW_CONTROL_ERROR (0x03)
62 #define H2_ERR_SETTINGS_TIMEOUT (0x04)
63 #define H2_ERR_STREAM_CLOSED (0x05)
64 #define H2_ERR_FRAME_SIZE_ERROR (0x06)
65 #define H2_ERR_REFUSED_STREAM (0x07)
66 #define H2_ERR_CANCEL (0x08)
67 #define H2_ERR_COMPRESSION_ERROR (0x09)
68 #define H2_ERR_CONNECT_ERROR (0x0a)
69 #define H2_ERR_ENHANCE_YOUR_CALM (0x0b)
70 #define H2_ERR_INADEQUATE_SECURITY (0x0c)
71 #define H2_ERR_HTTP_1_1_REQUIRED (0x0d)
73 #define H2_HEADER_METHOD ":method"
74 #define H2_HEADER_METHOD_LEN 7
75 #define H2_HEADER_SCHEME ":scheme"
76 #define H2_HEADER_SCHEME_LEN 7
77 #define H2_HEADER_AUTH ":authority"
78 #define H2_HEADER_AUTH_LEN 10
79 #define H2_HEADER_PATH ":path"
80 #define H2_HEADER_PATH_LEN 5
81 #define H2_HEADER_PROTO ":protocol"
82 #define H2_HEADER_PROTO_LEN 9
83 #define H2_CRLF "\r\n"
86 #define H2_FRAME_HDR_LEN 9
89 #define H2_DATA_CHUNK_SIZE ((16*1024) - 100 - H2_FRAME_HDR_LEN)
92 #define H2_MAX_PADLEN 256
94 #define H2_INITIAL_WINDOW_SIZE ((64*1024)-1)
96 #define H2_STREAM_CLIENT_INITIATED(id) (id&0x01)
98 #define H2_ALEN(a) (sizeof(a)/sizeof((a)[0]))
100 #define H2MAX(x,y) ((x) > (y) ? (x) : (y))
101 #define H2MIN(x,y) ((x) < (y) ? (x) : (y))
190 #define H2_HTTP_STATUS_UNSET (0)
198 #define H2_HDR_CONFORMANCE "http2-hdr-conformance"
199 #define H2_HDR_CONFORMANCE_UNSAFE "unsafe"
200 #define H2_PUSH_MODE_NOTE "http2-push-mode"
203 #if AP_MODULE_MAGIC_AT_LEAST(20211221, 6)
204 #define AP_HAS_RESPONSE_BUCKETS 1
207 #define AP_HAS_RESPONSE_BUCKETS 0
APR Versioning Interface.
int apr_status_t
Definition: apr_errno.h:44
struct apr_table_t apr_table_t
Definition: apr_tables.h:56
apr_int64_t apr_time_t
Definition: apr_time.h:45
h2_stream_state_t
Definition: h2.h:141
@ H2_SS_RSVD_L
Definition: h2.h:144
@ H2_SS_CLOSED
Definition: h2.h:148
@ H2_SS_CLOSED_R
Definition: h2.h:146
@ H2_SS_CLOSED_L
Definition: h2.h:147
@ H2_SS_IDLE
Definition: h2.h:142
@ H2_SS_MAX
Definition: h2.h:150
@ H2_SS_OPEN
Definition: h2.h:145
@ H2_SS_RSVD_R
Definition: h2.h:143
@ H2_SS_CLEANUP
Definition: h2.h:149
h2_push_policy
Definition: h2.h:114
@ H2_PUSH_FAST_LOAD
Definition: h2.h:118
@ H2_PUSH_NONE
Definition: h2.h:115
@ H2_PUSH_HEAD
Definition: h2.h:117
@ H2_PUSH_DEFAULT
Definition: h2.h:116
struct h2_priority h2_priority
h2_dependency
Definition: h2.h:103
@ H2_DEPENDANT_AFTER
Definition: h2.h:104
@ H2_DEPENDANT_INTERLEAVED
Definition: h2.h:105
@ H2_DEPENDANT_BEFORE
Definition: h2.h:106
apr_status_t h2_io_data_cb(void *ctx, const char *data, apr_off_t len)
Definition: h2.h:192
h2_stream_event_t
Definition: h2.h:153
@ H2_SEV_IN_ERROR
Definition: h2.h:158
@ H2_SEV_CLOSED_L
Definition: h2.h:154
@ H2_SEV_EOS_SENT
Definition: h2.h:157
@ H2_SEV_CLOSED_R
Definition: h2.h:155
@ H2_SEV_IN_DATA_PENDING
Definition: h2.h:159
@ H2_SEV_OUT_C1_BLOCK
Definition: h2.h:160
@ H2_SEV_CANCELLED
Definition: h2.h:156
struct h2_stream * h2_stream_get_fn(struct h2_session *session, int stream_id)
Definition: h2.h:195
int h2_stream_pri_cmp_fn(int stream_id1, int stream_id2, void *session)
Definition: h2.h:194
h2_session_state
Definition: h2.h:121
@ H2_SESSION_ST_INIT
Definition: h2.h:122
@ H2_SESSION_ST_IDLE
Definition: h2.h:124
@ H2_SESSION_ST_CLEANUP
Definition: h2.h:127
@ H2_SESSION_ST_DONE
Definition: h2.h:123
@ H2_SESSION_ST_WAIT
Definition: h2.h:126
@ H2_SESSION_ST_BUSY
Definition: h2.h:125
const char * H2_MAGIC_TOKEN
struct h2_session_props h2_session_props
int weight
Definition: h2.h:111
h2_dependency dependency
Definition: h2.h:110
const char * method
Definition: h2.h:170
const char * authority
Definition: h2.h:172
const char * scheme
Definition: h2.h:171
int http_status
Definition: h2.h:179
const char * path
Definition: h2.h:173
apr_table_t * headers
Definition: h2.h:175
apr_time_t request_time
Definition: h2.h:177
apr_off_t raw_bytes
Definition: h2.h:178
const char * protocol
Definition: h2.h:174
unsigned int shutdown
Definition: h2.h:138
unsigned int accepting
Definition: h2.h:137
int error
Definition: h2.h:135
int emitted_max
Definition: h2.h:134
const char * error_msg
Definition: h2.h:136
int completed_max
Definition: h2.h:132
int emitted_count
Definition: h2.h:133
int accepted_max
Definition: h2.h:131
Definition: h2_session.h:64
Definition: h2_stream.h:78
struct h2_session * session
Definition: h2_stream.h:85