Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
h2_ctx.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 __mod_h2__h2_ctx__
18 #define __mod_h2__h2_ctx__
19 
20 struct h2_session;
21 struct h2_task;
22 struct h2_config;
23 
32 typedef struct h2_ctx {
33  const char *protocol; /* the protocol negotiated */
34  struct h2_session *session; /* the session established */
35  struct h2_task *task; /* the h2_task executing or NULL */
36  const char *hostname; /* hostname negotiated via SNI, optional */
37  server_rec *server; /* httpd server config selected. */
38  const struct h2_config *config; /* effective config in this context */
39 } h2_ctx;
40 
47 h2_ctx *h2_ctx_get(const conn_rec *c, int create);
48 void h2_ctx_clear(const conn_rec *c);
49 
51 h2_ctx *h2_ctx_create_for(const conn_rec *c, struct h2_task *task);
52 
53 
54 /* Set the h2 protocol established on this connection context or
55  * NULL when other protocols are in place.
56  */
57 h2_ctx *h2_ctx_protocol_set(h2_ctx *ctx, const char *proto);
58 
59 /* Update the server_rec relevant for this context. A server for
60  * a connection may change during SNI handling, for example.
61  */
63 
64 void h2_ctx_session_set(h2_ctx *ctx, struct h2_session *session);
65 
69 const char *h2_ctx_protocol_get(const conn_rec *c);
70 
73 
74 
75 #endif /* defined(__mod_h2__h2_ctx__) */
Definition: h2_task.h:52
struct h2_ctx h2_ctx
struct h2_task * task
Definition: h2_ctx.h:35
h2_ctx * h2_ctx_create_for(const conn_rec *c, struct h2_task *task)
const struct h2_config * config
Definition: h2_ctx.h:38
Structure to store things which are per connection.
Definition: httpd.h:1183
struct h2_session * session
Definition: h2_ctx.h:34
struct h2_task * h2_ctx_get_task(conn_rec *c)
Definition: h2_ctx.h:32
const char * hostname
Definition: h2_ctx.h:36
h2_ctx * h2_ctx_protocol_set(h2_ctx *ctx, const char *proto)
A structure to store information for each virtual server.
Definition: httpd.h:1370
void h2_ctx_session_set(h2_ctx *ctx, struct h2_session *session)
conn_rec * c
Definition: h2_session.h:79
struct h2_session * h2_ctx_get_session(conn_rec *c)
h2_ctx * h2_ctx_get(const conn_rec *c, int create)
const char * protocol
Definition: h2_ctx.h:33
A structure that represents the current request.
Definition: httpd.h:860
h2_ctx * h2_ctx_server_update(h2_ctx *ctx, server_rec *s)
server_rec * server
Definition: h2_ctx.h:37
h2_ctx * h2_ctx_rget(const request_rec *r)
void h2_ctx_clear(const conn_rec *c)
const char * h2_ctx_protocol_get(const conn_rec *c)
request_rec * r
Definition: mod_dav.h:518
conn_rec * c
Definition: h2_task.h:55
Definition: h2_session.h:76