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 /* Copyright 2015 greenbytes GmbH (https://www.greenbytes.de)
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8 
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef __mod_h2__h2_ctx__
17 #define __mod_h2__h2_ctx__
18 
19 struct h2_session;
20 struct h2_task;
21 struct h2_config;
22 
31 typedef struct h2_ctx {
32  const char *protocol; /* the protocol negotiated */
33  struct h2_session *session; /* the session established */
34  struct h2_task *task; /* the h2_task executing or NULL */
35  const char *hostname; /* hostname negotiated via SNI, optional */
36  server_rec *server; /* httpd server config selected. */
37  const struct h2_config *config; /* effective config in this context */
38 } h2_ctx;
39 
46 h2_ctx *h2_ctx_get(const conn_rec *c, int create);
47 void h2_ctx_clear(const conn_rec *c);
48 
50 h2_ctx *h2_ctx_create_for(const conn_rec *c, struct h2_task *task);
51 
52 
53 /* Set the h2 protocol established on this connection context or
54  * NULL when other protocols are in place.
55  */
56 h2_ctx *h2_ctx_protocol_set(h2_ctx *ctx, const char *proto);
57 
58 /* Set the server_rec relevant for this context.
59  */
62 
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 
71 int h2_ctx_is_task(h2_ctx *ctx);
72 
73 struct h2_task *h2_ctx_get_task(h2_ctx *ctx);
76 
77 #endif /* defined(__mod_h2__h2_ctx__) */
struct h2_session * h2_ctx_session_get(h2_ctx *ctx)
Definition: h2_task.h:52
struct h2_ctx h2_ctx
struct h2_task * h2_ctx_rget_task(request_rec *r)
struct h2_task * task
Definition: h2_ctx.h:34
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:37
Structure to store things which are per connection.
Definition: httpd.h:1110
struct h2_session * session
Definition: h2_ctx.h:33
Definition: h2_ctx.h:31
const char * hostname
Definition: h2_ctx.h:35
h2_ctx * h2_ctx_protocol_set(h2_ctx *ctx, const char *proto)
A structure to store information for each virtual server.
Definition: httpd.h:1302
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:32
h2_ctx * h2_ctx_server_set(h2_ctx *ctx, server_rec *s)
A structure that represents the current request.
Definition: httpd.h:805
struct h2_task * h2_ctx_cget_task(conn_rec *c)
server_rec * server
Definition: h2_ctx.h:36
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:519
conn_rec * c
Definition: h2_task.h:55
int h2_ctx_is_task(h2_ctx *ctx)
Definition: h2_session.h:76