Apache HTTPD
h2_conn_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_conn_ctx__
18#define __mod_h2__h2_conn_ctx__
19
20#include "h2.h"
21
22struct h2_session;
23struct h2_stream;
24struct h2_mplx;
25struct h2_bucket_beam;
27struct h2_c2_transit;
28
29#define H2_PIPE_OUT 0
30#define H2_PIPE_IN 1
31
41 const char *id; /* c*: our identifier of this connection */
42 server_rec *server; /* c*: httpd server selected. */
43 const char *protocol; /* c1: the protocol negotiated */
44 struct h2_session *session; /* c1: the h2 session established */
45 struct h2_mplx *mplx; /* c2: the multiplexer */
46 struct h2_c2_transit *transit; /* c2: transit pool and bucket_alloc */
47
48#if !AP_HAS_RESPONSE_BUCKETS
49 int pre_conn_done; /* has pre_connection setup run? */
50#endif
51 int stream_id; /* c1: 0, c2: stream id processed */
52 apr_pool_t *req_pool; /* c2: a c2 child pool for a request */
53 const struct h2_request *request; /* c2: the request to process */
54 struct h2_bucket_beam *beam_out; /* c2: data out, created from req_pool */
55 struct h2_bucket_beam *beam_in; /* c2: data in or NULL, borrowed from request stream */
56 unsigned input_chunked:1; /* c2: if input needs HTTP/1.1 chunking applied */
57 unsigned is_upgrade:1; /* c2: if requst is a HTTP Upgrade */
58
59 apr_file_t *pipe_in[2]; /* c2: input produced notification pipe */
60 apr_pollfd_t pfd; /* c1: poll socket input, c2: NUL */
61
62 int has_final_response; /* final HTTP response passed on out */
63 apr_status_t last_err; /* APR_SUCCES or last error encountered in filters */
64
65 apr_off_t bytes_sent; /* c2: bytes acutaly sent via c1 */
66 /* atomic */ apr_uint32_t started; /* c2: processing was started */
67 apr_time_t started_at; /* c2: when processing started */
68 /* atomic */ apr_uint32_t done; /* c2: processing has finished */
69 apr_time_t done_at; /* c2: when processing was done */
70};
72
78#define h2_conn_ctx_get(c) \
79 ((c)? (h2_conn_ctx_t*)ap_get_module_config((c)->conn_config, &http2_module) : NULL)
80
89
91
93 struct h2_mplx *mplx, struct h2_stream *stream,
94 struct h2_c2_transit *transit);
95
97
99
100#endif /* defined(__mod_h2__h2_conn_ctx__) */
apr_brigade_flush void * ctx
apr_size_t size
int apr_status_t
Definition apr_errno.h:44
apr_vformatter_buff_t * c
Definition apr_lib.h:175
int int int protocol
const char * s
Definition apr_strings.h:95
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_conn_ctx_set_timeout(h2_conn_ctx_t *conn_ctx, apr_interval_time_t timeout)
void h2_conn_ctx_assign_session(h2_conn_ctx_t *ctx, struct h2_session *session)
Definition h2_conn_ctx.c:71
h2_conn_ctx_t * h2_conn_ctx_create_for_c1(conn_rec *c, server_rec *s, const char *protocol)
Definition h2_conn_ctx.c:54
apr_status_t h2_conn_ctx_init_for_c2(h2_conn_ctx_t **pctx, conn_rec *c, struct h2_mplx *mplx, struct h2_stream *stream, struct h2_c2_transit *transit)
Definition h2_conn_ctx.c:77
void h2_conn_ctx_detach(conn_rec *c)
Definition h2_conn_ctx.c:37
static void transit(h2_proxy_session *session, const char *action, h2_proxys_state nstate)
Structure to store things which are per connection.
Definition httpd.h:1152
struct h2_mplx * mplx
Definition h2_conn_ctx.h:45
unsigned input_chunked
Definition h2_conn_ctx.h:56
apr_pollfd_t pfd
Definition h2_conn_ctx.h:60
apr_uint32_t done
Definition h2_conn_ctx.h:68
struct h2_session * session
Definition h2_conn_ctx.h:44
apr_file_t * pipe_in[2]
Definition h2_conn_ctx.h:59
unsigned is_upgrade
Definition h2_conn_ctx.h:57
const struct h2_request * request
Definition h2_conn_ctx.h:53
struct h2_c2_transit * transit
Definition h2_conn_ctx.h:46
const char * id
Definition h2_conn_ctx.h:41
server_rec * server
Definition h2_conn_ctx.h:42
apr_pool_t * req_pool
Definition h2_conn_ctx.h:52
const char * protocol
Definition h2_conn_ctx.h:43
apr_time_t done_at
Definition h2_conn_ctx.h:69
apr_uint32_t started
Definition h2_conn_ctx.h:66
apr_time_t started_at
Definition h2_conn_ctx.h:67
apr_status_t last_err
Definition h2_conn_ctx.h:63
struct h2_bucket_beam * beam_out
Definition h2_conn_ctx.h:54
int has_final_response
Definition h2_conn_ctx.h:62
struct h2_bucket_beam * beam_in
Definition h2_conn_ctx.h:55
apr_off_t bytes_sent
Definition h2_conn_ctx.h:65
A structure to store information for each virtual server.
Definition httpd.h:1322
IN ULONG IN INT timeout