]> granicus.if.org Git - apache/blob - modules/http2/h2_task_output.h
sharing bucket_alloc for all streams inside mplx, explicit lifetime handling of EOR...
[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_out_state_t;
34
35 typedef struct h2_task_output h2_task_output;
36
37 struct h2_task_output {
38     conn_rec *c;
39     struct h2_task *task;
40     h2_task_out_state_t state;
41     struct h2_from_h1 *from_h1;
42     
43     unsigned int trailers_passed : 1;
44
45     apr_off_t written;
46     apr_bucket_brigade *bb;
47 };
48
49 h2_task_output *h2_task_output_create(struct h2_task *task, conn_rec *c);
50
51 apr_status_t h2_task_output_write(h2_task_output *output,
52                                   ap_filter_t* filter,
53                                   apr_bucket_brigade* brigade);
54
55 apr_status_t h2_task_output_freeze(h2_task_output *output);
56 apr_status_t h2_task_output_thaw(h2_task_output *output);
57
58 #endif /* defined(__mod_h2__h2_task_output__) */