]> granicus.if.org Git - apache/blob - modules/http2/h2_task_output.h
3e3b857bc1e678ce9ba3e789d3147a2d2474c2e9
[apache] / modules / http2 / h2_task_output.h
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_task_output__
17 #define __mod_h2__h2_task_output__
18
19 /* h2_task_output reads a HTTP/1 response from the brigade and applies
20  * them to a h2_output_converter. The brigade is setup as the output brigade
21  * for our pseudo httpd conn_rec that is handling a specific h2_task.
22  * 
23  */
24 struct apr_thread_cond_t;
25 struct h2_mplx;
26 struct h2_task;
27 struct h2_from_h1;
28
29 typedef enum {
30     H2_TASK_OUT_INIT,
31     H2_TASK_OUT_STARTED,
32     H2_TASK_OUT_DONE,
33 } h2_task_output_state_t;
34
35 typedef struct h2_task_output h2_task_output;
36
37 struct h2_task_output {
38     struct h2_task *task;
39     h2_task_output_state_t state;
40     struct h2_from_h1 *from_h1;
41     unsigned int trailers_passed : 1;
42 };
43
44 h2_task_output *h2_task_output_create(struct h2_task *task, apr_pool_t *pool);
45
46 void h2_task_output_destroy(h2_task_output *output);
47
48 apr_status_t h2_task_output_write(h2_task_output *output,
49                                   ap_filter_t* filter,
50                                   apr_bucket_brigade* brigade);
51
52 void h2_task_output_close(h2_task_output *output);
53
54 int h2_task_output_has_started(h2_task_output *output);
55
56 #endif /* defined(__mod_h2__h2_task_output__) */