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 /* Set the server_rec relevant for this context.
60  */
63 
65 void h2_ctx_session_set(h2_ctx *ctx, struct h2_session *session);
66 
70 const char *h2_ctx_protocol_get(const conn_rec *c);
71 
72 int h2_ctx_is_task(h2_ctx *ctx);
73 
74 struct h2_task *h2_ctx_get_task(h2_ctx *ctx);
77 
78 #endif /* defined(__mod_h2__h2_ctx__) */
struct h2_session * h2_ctx_session_get(h2_ctx *ctx)
Definition: h2_task.h:53
struct h2_ctx h2_ctx
struct h2_task * h2_ctx_rget_task(request_rec *r)
struct h2_task * task
Definition: h2_ctx.h:35
h2_ctx * h2_ctx_create_for(const conn_rec *c, struct h2_task *task)
Definition: h2_config.h:57
const struct h2_config * config
Definition: h2_ctx.h:38
Structure to store things which are per connection.
Definition: httpd.h:1124
struct h2_session * session
Definition: h2_ctx.h:34
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:1311
void h2_ctx_session_set(h2_ctx *ctx, struct h2_session *session)
conn_rec * c
Definition: h2_session.h:79
h2_ctx * h2_ctx_get(const conn_rec *c, int create)
server_rec * h2_ctx_server_get(h2_ctx *ctx)
const char * protocol
Definition: h2_ctx.h:33
h2_ctx * h2_ctx_server_set(h2_ctx *ctx, server_rec *s)
A structure that represents the current request.
Definition: httpd.h:811
struct h2_task * h2_ctx_cget_task(conn_rec *c)
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)
struct h2_task * h2_ctx_get_task(h2_ctx *ctx)
const char * h2_ctx_protocol_get(const conn_rec *c)
request_rec * r
Definition: mod_dav.h:515
conn_rec * c
Definition: h2_task.h:56
int h2_ctx_is_task(h2_ctx *ctx)
Definition: h2_session.h:76