Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
h2_task.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_task__
18 #define __mod_h2__h2_task__
19 
20 #include <http_core.h>
21 
41 struct h2_bucket_beam;
42 struct h2_conn;
43 struct h2_mplx;
44 struct h2_task;
45 struct h2_req_engine;
46 struct h2_request;
47 struct h2_response_parser;
48 struct h2_stream;
49 struct h2_worker;
50 
51 typedef struct h2_task h2_task;
52 
53 struct h2_task {
54  const char *id;
55  int stream_id;
58 
59  const struct h2_request *request;
61  int rst_error; /* h2 related stream abort error */
62 
63  struct {
65  unsigned int eos : 1;
69  } input;
70  struct {
71  struct h2_bucket_beam *beam;
72  unsigned int opened : 1;
73  unsigned int sent_response : 1;
74  unsigned int copy_files : 1;
75  struct h2_response_parser *rparser;
78  } output;
79 
80  struct h2_mplx *mplx;
81 
82  unsigned int filters_set : 1;
83  unsigned int frozen : 1;
84  unsigned int thawed : 1;
85  unsigned int worker_started : 1; /* h2_worker started processing */
86  unsigned int worker_done : 1; /* h2_worker finished */
87 
88  apr_time_t started_at; /* when processing started */
89  apr_time_t done_at; /* when processing was done */
91 
92  struct h2_req_engine *engine; /* engine hosted by this task */
93  struct h2_req_engine *assigned; /* engine that task has been assigned to */
94 };
95 
96 h2_task *h2_task_create(conn_rec *slave, int stream_id,
97  const h2_request *req, struct h2_mplx *m,
98  struct h2_bucket_beam *input,
99  apr_interval_time_t timeout,
100  apr_size_t output_max_mem);
101 
102 void h2_task_destroy(h2_task *task);
103 
104 apr_status_t h2_task_do(h2_task *task, apr_thread_t *thread, int worker_id);
105 
106 void h2_task_redo(h2_task *task);
107 int h2_task_can_redo(h2_task *task);
108 
112 void h2_task_rst(h2_task *task, int error);
113 
114 void h2_task_register_hooks(void);
115 /*
116  * One time, post config initialization.
117  */
119 
120 extern APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_in) *h2_task_logio_add_bytes_in;
121 extern APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_out) *h2_task_logio_add_bytes_out;
122 
125 int h2_task_has_thawed(h2_task *task);
126 
127 #endif /* defined(__mod_h2__h2_task__) */
apr_status_t h2_task_freeze(h2_task *task)
apr_time_t started_at
Definition: h2_task.h:88
size_t apr_size_t
Definition: apr.h:375
struct h2_req_engine h2_req_engine
Definition: mod_http2.h:38
struct h2_task::@5 output
void h2_task_destroy(h2_task *task)
struct h2_req_engine * engine
Definition: h2_task.h:92
unsigned int sent_response
Definition: h2_task.h:73
unsigned int copy_files
Definition: h2_task.h:74
Definition: h2_task.h:53
Definition: h2_mplx.h:57
unsigned int opened
Definition: h2_task.h:72
apr_interval_time_t timeout
Definition: h2_task.h:60
unsigned int frozen
Definition: h2_task.h:83
unsigned int worker_started
Definition: h2_task.h:85
h2_task * h2_task_create(conn_rec *slave, int stream_id, const h2_request *req, struct h2_mplx *m, struct h2_bucket_beam *input, apr_interval_time_t timeout, apr_size_t output_max_mem)
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:552
struct h2_task::@4 input
apr_bucket * eor
Definition: h2_task.h:90
Definition: h2.h:133
CORE HTTP Daemon.
apr_bucket_brigade * bbchunk
Definition: h2_task.h:67
Definition: h2_bucket_beam.h:164
int h2_task_has_thawed(h2_task *task)
struct h2_mplx * mplx
Definition: h2_task.h:80
int stream_id
Definition: h2_task.h:55
void h2_task_rst(h2_task *task, int error)
Definition: apr_buckets.h:258
apr_int64_t apr_interval_time_t
Definition: apr_time.h:55
apr_time_t done_at
Definition: h2_task.h:89
Structure to store things which are per connection.
Definition: httpd.h:1124
unsigned int thawed
Definition: h2_task.h:84
void h2_task_register_hooks(void)
apr_int64_t apr_time_t
Definition: apr_time.h:45
apr_size_t max_buffer
Definition: h2_task.h:77
A structure to store information for each virtual server.
Definition: httpd.h:1311
Definition: apr_buckets.h:224
Definition: apr_arch_threadproc.h:42
int rst_error
Definition: h2_task.h:61
int h2_task_can_redo(h2_task *task)
Definition: h2_stream.h:65
struct h2_response_parser * rparser
Definition: h2_task.h:75
unsigned int filters_set
Definition: h2_task.h:82
void ap_logio_add_bytes_in(conn_rec *c, apr_off_t bytes)
apr_status_t h2_task_thaw(h2_task *task)
void ap_logio_add_bytes_out(conn_rec *c, apr_off_t bytes)
apr_off_t chunked_total
Definition: h2_task.h:68
const struct h2_request * request
Definition: h2_task.h:59
struct h2_req_engine * assigned
Definition: h2_task.h:93
unsigned int eos
Definition: h2_task.h:65
struct h2_bucket_beam * beam
Definition: h2_task.h:64
APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_in)*h2_task_logio_add_bytes_in
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
apr_pool_t * pool
Definition: h2_task.h:57
int apr_status_t
Definition: apr_errno.h:44
apr_status_t h2_task_init(apr_pool_t *pool, server_rec *s)
conn_rec * c
Definition: h2_task.h:56
apr_bucket_brigade * bb
Definition: h2_task.h:66
void h2_task_redo(h2_task *task)
const char * id
Definition: h2_task.h:54
unsigned int worker_done
Definition: h2_task.h:86
apr_status_t h2_task_do(h2_task *task, apr_thread_t *thread, int worker_id)
off_t apr_off_t
Definition: apr.h:377