diff options
author | Stefan Fritsch <sf@sfritsch.de> | 2015-12-19 09:17:42 +0100 |
---|---|---|
committer | Stefan Fritsch <sf@sfritsch.de> | 2015-12-19 09:17:42 +0100 |
commit | d5325781b38052fbdf4cc28a6c6d3052b9424b51 (patch) | |
tree | 0dd970f541f3d816f3b2217a9cd7a77f1733cbc9 /modules/http2/h2_io.h | |
parent | f775596dea7222b55efc18005acf1919609c3602 (diff) | |
download | apache2-d5325781b38052fbdf4cc28a6c6d3052b9424b51.tar.gz |
Imported Upstream version 2.4.18
Diffstat (limited to 'modules/http2/h2_io.h')
-rw-r--r-- | modules/http2/h2_io.h | 53 |
1 files changed, 41 insertions, 12 deletions
diff --git a/modules/http2/h2_io.h b/modules/http2/h2_io.h index 946ee443..08f3aa3d 100644 --- a/modules/http2/h2_io.h +++ b/modules/http2/h2_io.h @@ -18,11 +18,12 @@ struct h2_response; struct apr_thread_cond_t; -struct h2_task; +struct h2_request; -typedef apr_status_t h2_io_data_cb(void *ctx, - const char *data, apr_size_t len); +typedef apr_status_t h2_io_data_cb(void *ctx, const char *data, apr_off_t len); + +typedef int h2_stream_pri_cmp(int stream_id1, int stream_id2, void *ctx); typedef struct h2_io h2_io; @@ -30,17 +31,24 @@ typedef struct h2_io h2_io; struct h2_io { int id; /* stream identifier */ apr_pool_t *pool; /* stream pool */ - apr_bucket_brigade *bbin; /* input data for stream */ - int eos_in; - int task_done; + int orphaned; /* h2_stream is gone for this io */ - apr_size_t input_consumed; /* how many bytes have been read */ + int task_done; + const struct h2_request *request; /* request on this io */ + int request_body; /* == 0 iff request has no body */ + struct h2_response *response;/* response for submit, once created */ + int rst_error; + + int eos_in; + apr_bucket_brigade *bbin; /* input data for stream */ struct apr_thread_cond_t *input_arrived; /* block on reading */ + apr_size_t input_consumed; /* how many bytes have been read */ + int eos_out; apr_bucket_brigade *bbout; /* output data from stream */ + apr_bucket_alloc_t *bucket_alloc; struct apr_thread_cond_t *output_drained; /* block on writing */ - struct h2_response *response;/* submittable response created */ int files_handles_owned; }; @@ -59,6 +67,16 @@ h2_io *h2_io_create(int id, apr_pool_t *pool, apr_bucket_alloc_t *bucket_alloc); void h2_io_destroy(h2_io *io); /** + * Set the response of this stream. + */ +void h2_io_set_response(h2_io *io, struct h2_response *response); + +/** + * Reset the stream with the given error code. + */ +void h2_io_rst(h2_io *io, int error); + +/** * The input data is completely queued. Blocked reads will return immediately * and give either data or EOF. */ @@ -89,6 +107,12 @@ apr_status_t h2_io_in_write(h2_io *io, apr_bucket_brigade *bb); */ apr_status_t h2_io_in_close(h2_io *io); +/** + * Shuts all input down. Will close input and mark any data buffered + * as consumed. + */ +apr_status_t h2_io_in_shutdown(h2_io *io); + /******************************************************************************* * Output handling of streams. ******************************************************************************/ @@ -105,22 +129,27 @@ apr_status_t h2_io_in_close(h2_io *io); */ apr_status_t h2_io_out_readx(h2_io *io, h2_io_data_cb *cb, void *ctx, - apr_size_t *plen, int *peos); + apr_off_t *plen, int *peos); + +apr_status_t h2_io_out_read_to(h2_io *io, + apr_bucket_brigade *bb, + apr_off_t *plen, int *peos); apr_status_t h2_io_out_write(h2_io *io, apr_bucket_brigade *bb, - apr_size_t maxlen, int *pfile_buckets_allowed); + apr_size_t maxlen, apr_table_t *trailers, + int *pfile_buckets_allowed); /** * Closes the input. After existing data has been read, APR_EOF will * be returned. */ -apr_status_t h2_io_out_close(h2_io *io); +apr_status_t h2_io_out_close(h2_io *io, apr_table_t *trailers); /** * Gives the overall length of the data that is currently queued for * output. */ -apr_size_t h2_io_out_length(h2_io *io); +apr_off_t h2_io_out_length(h2_io *io); #endif /* defined(__mod_h2__h2_io__) */ |