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_request;
46 struct h2_response_parser;
47 struct h2_stream;
48 struct h2_worker;
49 
50 typedef struct h2_task h2_task;
51 
52 struct h2_task {
53  const char *id;
54  int stream_id;
57 
58  const struct h2_request *request;
60  int rst_error; /* h2 related stream abort error */
61 
62  struct {
64  unsigned int eos : 1;
68  } input;
69  struct {
70  struct h2_bucket_beam *beam;
71  unsigned int opened : 1;
72  unsigned int sent_response : 1;
73  unsigned int copy_files : 1;
74  struct h2_response_parser *rparser;
77  } output;
78 
79  struct h2_mplx *mplx;
80 
81  unsigned int filters_set : 1;
82  unsigned int worker_started : 1; /* h2_worker started processing */
83  unsigned int redo : 1; /* was throttled, should be restarted later */
84 
85  int worker_done; /* h2_worker finished */
86  int done_done; /* task_done has been handled */
87 
88  apr_time_t started_at; /* when processing started */
89  apr_time_t done_at; /* when processing was done */
91 };
92 
93 h2_task *h2_task_create(conn_rec *secondary, int stream_id,
94  const h2_request *req, struct h2_mplx *m,
95  struct h2_bucket_beam *input,
96  apr_interval_time_t timeout,
97  apr_size_t output_max_mem);
98 
99 void h2_task_destroy(h2_task *task);
100 
101 apr_status_t h2_task_do(h2_task *task, apr_thread_t *thread, int worker_id);
102 
103 void h2_task_redo(h2_task *task);
104 int h2_task_can_redo(h2_task *task);
105 int h2_task_has_started(h2_task *task);
106 
110 void h2_task_rst(h2_task *task, int error);
111 
112 void h2_task_register_hooks(void);
113 /*
114  * One time, post config initialization.
115  */
117 
118 extern APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_in) *h2_task_logio_add_bytes_in;
119 extern APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_out) *h2_task_logio_add_bytes_out;
120 
121 #endif /* defined(__mod_h2__h2_task__) */
apr_time_t started_at
Definition: h2_task.h:88
size_t apr_size_t
Definition: apr.h:393
struct h2_task::@5 output
void h2_task_destroy(h2_task *task)
unsigned int sent_response
Definition: h2_task.h:72
unsigned int copy_files
Definition: h2_task.h:73
Definition: h2_task.h:52
Definition: h2_mplx.h:57
unsigned int opened
Definition: h2_task.h:71
apr_interval_time_t timeout
Definition: h2_task.h:59
unsigned int worker_started
Definition: h2_task.h:82
int worker_done
Definition: h2_task.h:85
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:555
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:66
Definition: h2_bucket_beam.h:163
struct h2_mplx * mplx
Definition: h2_task.h:79
int stream_id
Definition: h2_task.h:54
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:1183
int done_done
Definition: h2_task.h:86
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:76
A structure to store information for each virtual server.
Definition: httpd.h:1370
Definition: apr_buckets.h:224
Definition: apr_arch_threadproc.h:42
int rst_error
Definition: h2_task.h:60
int h2_task_can_redo(h2_task *task)
Definition: h2_stream.h:65
struct h2_response_parser * rparser
Definition: h2_task.h:74
unsigned int filters_set
Definition: h2_task.h:81
void ap_logio_add_bytes_in(conn_rec *c, apr_off_t bytes)
void ap_logio_add_bytes_out(conn_rec *c, apr_off_t bytes)
apr_off_t chunked_total
Definition: h2_task.h:67
const struct h2_request * request
Definition: h2_task.h:58
unsigned int eos
Definition: h2_task.h:64
struct h2_bucket_beam * beam
Definition: h2_task.h:63
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:56
int apr_status_t
Definition: apr_errno.h:44
h2_task * h2_task_create(conn_rec *secondary, 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_status_t h2_task_init(apr_pool_t *pool, server_rec *s)
conn_rec * c
Definition: h2_task.h:55
apr_bucket_brigade * bb
Definition: h2_task.h:65
void h2_task_redo(h2_task *task)
const char * id
Definition: h2_task.h:53
unsigned int redo
Definition: h2_task.h:83
apr_status_t h2_task_do(h2_task *task, apr_thread_t *thread, int worker_id)
off_t apr_off_t
Definition: apr.h:395
int h2_task_has_started(h2_task *task)
server_rec * s
Definition: h2_mplx.h:61