Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
h2_ngn_shed.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 h2_req_shed_h
17 #define h2_req_shed_h
18 
19 struct h2_req_engine;
20 struct h2_task;
21 
22 typedef struct h2_ngn_shed h2_ngn_shed;
23 struct h2_ngn_shed {
27  void *user_ctx;
28 
29  unsigned int aborted : 1;
30 
32  apr_size_t req_buffer_size; /* preferred buffer size for responses */
33 };
34 
35 const char *h2_req_engine_get_id(h2_req_engine *engine);
37 
39  apr_off_t bytes);
40 
42  const char *id,
43  const char *type,
44  apr_pool_t *pool,
45  apr_size_t req_buffer_size,
46  request_rec *r,
47  h2_output_consumed **pconsumed,
48  void **pbaton);
49 
51  int default_capactiy,
52  apr_size_t req_buffer_size);
53 
55 
56 void h2_ngn_shed_set_ctx(h2_ngn_shed *shed, void *user_ctx);
57 void *h2_ngn_shed_get_ctx(h2_ngn_shed *shed);
58 
60 
61 void h2_ngn_shed_abort(h2_ngn_shed *shed);
62 
63 apr_status_t h2_ngn_shed_push_request(h2_ngn_shed *shed, const char *ngn_type,
64  request_rec *r,
65  h2_shed_ngn_init *init_cb);
66 
68  int capacity,
69  int want_shutdown, request_rec **pr);
70 
72  struct h2_req_engine *ngn,
73  struct h2_task *task);
74 
75 void h2_ngn_shed_done_ngn(h2_ngn_shed *shed, struct h2_req_engine *ngn);
76 
77 
78 #endif /* h2_req_shed_h */
size_t apr_size_t
Definition: apr.h:375
struct h2_req_engine h2_req_engine
Definition: mod_http2.h:37
apr_pool_t * pool
Definition: h2_ngn_shed.h:25
Definition: h2_task.h:52
void h2_ngn_shed_done_ngn(h2_ngn_shed *shed, struct h2_req_engine *ngn)
conn_rec * c
Definition: h2_ngn_shed.h:24
int default_capacity
Definition: h2_ngn_shed.h:31
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:556
unsigned int aborted
Definition: h2_ngn_shed.h:29
void h2_ngn_shed_destroy(h2_ngn_shed *shed)
apr_status_t h2_ngn_shed_push_request(h2_ngn_shed *shed, const char *ngn_type, request_rec *r, h2_shed_ngn_init *init_cb)
void h2_ngn_shed_set_ctx(h2_ngn_shed *shed, void *user_ctx)
apr_status_t h2_ngn_shed_pull_request(h2_ngn_shed *shed, h2_req_engine *pub_ngn, int capacity, int want_shutdown, request_rec **pr)
apr_status_t h2_shed_ngn_init(h2_req_engine *engine, const char *id, const char *type, apr_pool_t *pool, apr_size_t req_buffer_size, request_rec *r, h2_output_consumed **pconsumed, void **pbaton)
Definition: h2_ngn_shed.h:41
Structure to store things which are per connection.
Definition: httpd.h:1110
void h2_output_consumed(void *ctx, conn_rec *c, apr_off_t consumed)
Definition: h2_mplx.h:336
void h2_ngn_shed_abort(h2_ngn_shed *shed)
h2_ngn_shed * h2_ngn_shed_create(apr_pool_t *pool, conn_rec *c, int default_capactiy, apr_size_t req_buffer_size)
apr_size_t req_buffer_size
Definition: h2_ngn_shed.h:32
Definition: h2_ngn_shed.h:23
int h2_req_engine_is_shutdown(h2_req_engine *engine)
struct apr_hash_t apr_hash_t
Definition: apr_hash.h:52
const char * h2_req_engine_get_id(h2_req_engine *engine)
void * h2_ngn_shed_get_ctx(h2_ngn_shed *shed)
void * user_ctx
Definition: h2_ngn_shed.h:27
A structure that represents the current request.
Definition: httpd.h:805
void h2_req_engine_out_consumed(h2_req_engine *engine, conn_rec *c, apr_off_t bytes)
apr_status_t h2_ngn_shed_done_task(h2_ngn_shed *shed, struct h2_req_engine *ngn, struct h2_task *task)
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
int apr_status_t
Definition: apr_errno.h:44
request_rec * r
Definition: mod_dav.h:519
off_t apr_off_t
Definition: apr.h:377
h2_ngn_shed * h2_ngn_shed_get_shed(struct h2_req_engine *ngn)
apr_hash_t * ngns
Definition: h2_ngn_shed.h:26