]> granicus.if.org Git - apache/blob - modules/http2/h2_conn.h
Fix alignment in a <highlight> block.
[apache] / modules / http2 / h2_conn.h
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 __mod_h2__h2_conn__
18 #define __mod_h2__h2_conn__
19
20 struct h2_ctx;
21 struct h2_task;
22
23 /**
24  * Setup the connection and our context for HTTP/2 processing
25  *
26  * @param c the connection HTTP/2 is starting on
27  * @param r the upgrade request that still awaits an answer, optional
28  * @param s the server selected for this connection (can be != c->base_server)
29  */
30 apr_status_t h2_conn_setup(conn_rec *c, request_rec *r, server_rec *s);
31
32 /**
33  * Run the HTTP/2 connection in synchronous fashion. 
34  * Return when the HTTP/2 session is done
35  * and the connection will close or a fatal error occurred.
36  *
37  * @param c the http2 connection to run
38  * @return APR_SUCCESS when session is done.
39  */
40 apr_status_t h2_conn_run(conn_rec *c);
41
42 /**
43  * The connection is about to close. If we have not send a GOAWAY
44  * yet, this is the last chance.
45  */
46 apr_status_t h2_conn_pre_close(struct h2_ctx *ctx, conn_rec *c);
47
48 /* Initialize this child process for h2 connection work,
49  * to be called once during child init before multi processing
50  * starts.
51  */
52 apr_status_t h2_conn_child_init(apr_pool_t *pool, server_rec *s);
53
54
55 typedef enum {
56     H2_MPM_UNKNOWN,
57     H2_MPM_WORKER,
58     H2_MPM_EVENT,
59     H2_MPM_PREFORK,
60     H2_MPM_MOTORZ,
61     H2_MPM_SIMPLE,
62     H2_MPM_NETWARE,
63     H2_MPM_WINNT,
64 } h2_mpm_type_t;
65
66 /* Returns the type of MPM module detected */
67 h2_mpm_type_t h2_conn_mpm_type(void);
68 const char *h2_conn_mpm_name(void);
69 int h2_mpm_supported(void);
70
71 conn_rec *h2_slave_create(conn_rec *master, int slave_id, apr_pool_t *parent);
72 void h2_slave_destroy(conn_rec *slave);
73
74 apr_status_t h2_slave_run_pre_connection(conn_rec *slave, apr_socket_t *csd);
75 void h2_slave_run_connection(conn_rec *slave);
76
77 #endif /* defined(__mod_h2__h2_conn__) */