1 /* Copyright 2015 greenbytes GmbH (https://www.greenbytes.de)
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef __mod_h2__h2_conn_io__
17 #define __mod_h2__h2_conn_io__
19 /* h2_io is the basic handler of a httpd connection. It keeps two brigades,
20 * one for input, one for output and works with the installed connection
22 * The read is done via a callback function, so that input can be processed
23 * directly without copying.
27 apr_bucket_brigade *input;
28 apr_bucket_brigade *output;
31 apr_time_t last_write;
32 apr_size_t bytes_written;
40 apr_status_t h2_conn_io_init(h2_conn_io *io, conn_rec *c);
41 void h2_conn_io_destroy(h2_conn_io *io);
43 typedef apr_status_t (*h2_conn_io_on_read_cb)(const char *data, apr_size_t len,
44 apr_size_t *readlen, int *done,
47 apr_status_t h2_conn_io_read(h2_conn_io *io,
48 apr_read_type_e block,
49 h2_conn_io_on_read_cb on_read_cb,
52 apr_status_t h2_conn_io_write(h2_conn_io *io,
56 apr_status_t h2_conn_io_flush(h2_conn_io *io);
58 #endif /* defined(__mod_h2__h2_conn_io__) */