Apache HTTPD
h2_proxy_session.h
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef h2_proxy_session_h
18#define h2_proxy_session_h
19
20#define H2_ALEN(a) (sizeof(a)/sizeof((a)[0]))
21
22#include <nghttp2/nghttp2.h>
23
24struct h2_proxy_iqueue;
25struct h2_proxy_ihash_t;
26
36
37typedef enum {
38 H2_PROXYS_ST_INIT, /* send initial SETTINGS, etc. */
39 H2_PROXYS_ST_DONE, /* finished, connection close */
40 H2_PROXYS_ST_IDLE, /* no streams to process */
41 H2_PROXYS_ST_BUSY, /* read/write without stop */
42 H2_PROXYS_ST_WAIT, /* waiting for tasks reporting back */
43 H2_PROXYS_ST_LOCAL_SHUTDOWN, /* we announced GOAWAY */
44 H2_PROXYS_ST_REMOTE_SHUTDOWN, /* client announced GOAWAY */
46
47typedef enum {
48 H2_PROXYS_EV_INIT, /* session was initialized */
49 H2_PROXYS_EV_LOCAL_GOAWAY, /* we send a GOAWAY */
50 H2_PROXYS_EV_REMOTE_GOAWAY, /* remote send us a GOAWAY */
51 H2_PROXYS_EV_CONN_ERROR, /* connection error */
52 H2_PROXYS_EV_PROTO_ERROR, /* protocol error */
53 H2_PROXYS_EV_CONN_TIMEOUT, /* connection timeout */
54 H2_PROXYS_EV_NO_IO, /* nothing has been read or written */
55 H2_PROXYS_EV_STREAM_SUBMITTED, /* stream has been submitted */
56 H2_PROXYS_EV_STREAM_DONE, /* stream has been finished */
57 H2_PROXYS_EV_STREAM_RESUMED, /* stream signalled availability of headers/data */
58 H2_PROXYS_EV_DATA_READ, /* connection data has been read */
59 H2_PROXYS_EV_NGH2_DONE, /* nghttp2 wants neither read nor write anything */
60 H2_PROXYS_EV_PRE_CLOSE, /* connection will close after this */
62
63typedef enum {
64 H2_PING_ST_NONE, /* normal connection mode, ProxyTimeout rules */
65 H2_PING_ST_AWAIT_ANY, /* waiting for any frame from backend */
66 H2_PING_ST_AWAIT_PING, /* waiting for PING frame from backend */
68
72 int error_code);
73
107
109 proxy_server_conf *conf,
110 int h2_front,
111 unsigned char window_bits_connection,
112 unsigned char window_bits_stream,
114
116 request_rec *r, int standalone);
117
127
129
131
132#define H2_PROXY_REQ_URL_NOTE "h2-proxy-req-url"
133
135
136#endif /* h2_proxy_session_h */
request_rec * r
const char * url
Definition apr_escape.h:120
apr_size_t size
int apr_status_t
Definition apr_errno.h:44
const char * s
Definition apr_strings.h:95
int int status
apr_int64_t apr_interval_time_t
Definition apr_time.h:55
apr_int64_t apr_time_t
Definition apr_time.h:45
void h2_proxy_session_cleanup(h2_proxy_session *s, h2_proxy_request_done *done)
h2_ping_state_t
@ H2_PING_ST_AWAIT_ANY
@ H2_PING_ST_AWAIT_PING
@ H2_PING_ST_NONE
h2_proxy_stream_state_t
@ H2_STREAM_ST_IDLE
@ H2_STREAM_ST_CLOSED_OUTPUT
@ H2_STREAM_ST_RESV_LOCAL
@ H2_STREAM_ST_CLOSED_INPUT
@ H2_STREAM_ST_RESV_REMOTE
@ H2_STREAM_ST_OPEN
@ H2_STREAM_ST_CLOSED
h2_proxys_state
@ H2_PROXYS_ST_LOCAL_SHUTDOWN
@ H2_PROXYS_ST_DONE
@ H2_PROXYS_ST_BUSY
@ H2_PROXYS_ST_WAIT
@ H2_PROXYS_ST_IDLE
@ H2_PROXYS_ST_REMOTE_SHUTDOWN
@ H2_PROXYS_ST_INIT
void h2_proxy_request_done(h2_proxy_session *s, request_rec *r, apr_status_t status, int touched, int error_code)
h2_proxys_event_t
@ H2_PROXYS_EV_CONN_TIMEOUT
@ H2_PROXYS_EV_STREAM_RESUMED
@ H2_PROXYS_EV_NO_IO
@ H2_PROXYS_EV_STREAM_DONE
@ H2_PROXYS_EV_PRE_CLOSE
@ H2_PROXYS_EV_PROTO_ERROR
@ H2_PROXYS_EV_DATA_READ
@ H2_PROXYS_EV_NGH2_DONE
@ H2_PROXYS_EV_CONN_ERROR
@ H2_PROXYS_EV_REMOTE_GOAWAY
@ H2_PROXYS_EV_INIT
@ H2_PROXYS_EV_LOCAL_GOAWAY
@ H2_PROXYS_EV_STREAM_SUBMITTED
apr_status_t h2_proxy_session_process(h2_proxy_session *s)
int h2_proxy_session_is_reusable(h2_proxy_session *s)
apr_status_t h2_proxy_session_submit(h2_proxy_session *s, const char *url, request_rec *r, int standalone)
h2_proxy_session * h2_proxy_session_setup(const char *id, proxy_conn_rec *p_conn, proxy_server_conf *conf, int h2_front, unsigned char window_bits_connection, unsigned char window_bits_stream, h2_proxy_request_done *done)
void h2_proxy_session_cancel_all(h2_proxy_session *s)
Structure to store things which are per connection.
Definition httpd.h:1152
unsigned int h2_front
h2_proxy_request_done * done
proxy_conn_rec * p_conn
apr_interval_time_t wait_timeout
apr_bucket_brigade * output
apr_bucket_brigade * input
unsigned char window_bits_stream
h2_ping_state_t ping_state
apr_time_t last_frame_received
apr_size_t remote_max_concurrent
struct h2_proxy_ihash_t * streams
proxy_server_conf * conf
unsigned char window_bits_connection
nghttp2_session * ngh2
h2_proxys_state state
struct h2_proxy_iqueue * suspended
unsigned int aborted
A structure that represents the current request.
Definition httpd.h:845