From: Stefan Eissing Date: Sun, 9 Oct 2016 20:30:40 +0000 (+0000) Subject: Merge of r1764005 from trunk: X-Git-Tag: 2.4.24~208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e46e44c8fc8614a45c9b08bc2fcc94f0a21f0a2a;p=thirdparty%2Fapache%2Fhttpd.git Merge of r1764005 from trunk: mod_http2: reverting int->apr_uint32_t changes from 1.7.x git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1764007 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http2/h2.h b/modules/http2/h2.h index 03e6e3e6236..2f67bd8363b 100644 --- a/modules/http2/h2.h +++ b/modules/http2/h2.h @@ -101,11 +101,11 @@ typedef enum { } h2_session_state; typedef struct h2_session_props { - apr_uint32_t accepted_max; /* the highest remote stream id was/will be handled */ - apr_uint32_t completed_max; /* the highest remote stream completed */ - apr_uint32_t emitted_count; /* the number of local streams sent */ - apr_uint32_t emitted_max; /* the highest local stream id sent */ - apr_uint32_t error; /* the last session error encountered */ + int accepted_max; /* the highest remote stream id was/will be handled */ + int completed_max; /* the highest remote stream completed */ + int emitted_count; /* the number of local streams sent */ + int emitted_max; /* the highest local stream id sent */ + int error; /* the last session error encountered */ unsigned int accepting : 1; /* if the session is accepting new streams */ unsigned int shutdown : 1; /* if the final GOAWAY has been sent */ } h2_session_props; diff --git a/modules/http2/h2_bucket_beam.c b/modules/http2/h2_bucket_beam.c index 4397e19c76f..15fb4c813ca 100644 --- a/modules/http2/h2_bucket_beam.c +++ b/modules/http2/h2_bucket_beam.c @@ -458,7 +458,7 @@ apr_status_t h2_beam_destroy(h2_bucket_beam *beam) } apr_status_t h2_beam_create(h2_bucket_beam **pbeam, apr_pool_t *red_pool, - apr_uint32_t id, const char *tag, + int id, const char *tag, apr_size_t max_buf_size) { h2_bucket_beam *beam; diff --git a/modules/http2/h2_bucket_beam.h b/modules/http2/h2_bucket_beam.h index 80fa9e127d4..6a0d4c6d28d 100644 --- a/modules/http2/h2_bucket_beam.h +++ b/modules/http2/h2_bucket_beam.h @@ -170,7 +170,7 @@ typedef int h2_beam_can_beam_callback(void *ctx, h2_bucket_beam *beam, int h2_beam_no_files(void *ctx, h2_bucket_beam *beam, apr_file_t *file); struct h2_bucket_beam { - apr_uint32_t id; + int id; const char *tag; h2_blist red; h2_blist hold; @@ -223,7 +223,7 @@ struct h2_bucket_beam { */ apr_status_t h2_beam_create(h2_bucket_beam **pbeam, apr_pool_t *red_pool, - apr_uint32_t id, const char *tag, + int id, const char *tag, apr_size_t buffer_size); /** diff --git a/modules/http2/h2_conn.c b/modules/http2/h2_conn.c index 1d96e4c6aa1..2407822e238 100644 --- a/modules/http2/h2_conn.c +++ b/modules/http2/h2_conn.c @@ -241,7 +241,7 @@ apr_status_t h2_conn_pre_close(struct h2_ctx *ctx, conn_rec *c) return status; } -conn_rec *h2_slave_create(conn_rec *master, apr_uint32_t slave_id, +conn_rec *h2_slave_create(conn_rec *master, int slave_id, apr_pool_t *parent, apr_allocator_t *allocator) { apr_pool_t *pool; diff --git a/modules/http2/h2_conn.h b/modules/http2/h2_conn.h index 4c2799696ac..13b20539b1a 100644 --- a/modules/http2/h2_conn.h +++ b/modules/http2/h2_conn.h @@ -66,7 +66,7 @@ typedef enum { h2_mpm_type_t h2_conn_mpm_type(void); -conn_rec *h2_slave_create(conn_rec *master, apr_uint32_t slave_id, +conn_rec *h2_slave_create(conn_rec *master, int slave_id, apr_pool_t *parent, apr_allocator_t *allocator); void h2_slave_destroy(conn_rec *slave, apr_allocator_t **pallocator); diff --git a/modules/http2/h2_mplx.c b/modules/http2/h2_mplx.c index 461c88d64c4..4501e0a734f 100644 --- a/modules/http2/h2_mplx.c +++ b/modules/http2/h2_mplx.c @@ -45,7 +45,7 @@ #include "h2_util.h" -static void h2_beam_log(h2_bucket_beam *beam, apr_uint32_t id, const char *msg, +static void h2_beam_log(h2_bucket_beam *beam, int id, const char *msg, conn_rec *c, int level) { if (beam && APLOG_C_IS_LEVEL(c,level)) { @@ -319,7 +319,7 @@ h2_mplx *h2_mplx_create(conn_rec *c, apr_pool_t *parent, return m; } -apr_uint32_t h2_mplx_shutdown(h2_mplx *m) +int h2_mplx_shutdown(h2_mplx *m) { int acquired, max_stream_started = 0; @@ -702,7 +702,7 @@ apr_status_t h2_mplx_stream_done(h2_mplx *m, h2_stream *stream) return status; } -h2_stream *h2_mplx_stream_get(h2_mplx *m, apr_uint32_t id) +h2_stream *h2_mplx_stream_get(h2_mplx *m, int id) { h2_stream *s = NULL; int acquired; @@ -1330,7 +1330,7 @@ apr_status_t h2_mplx_req_engine_push(const char *ngn_type, apr_status_t h2_mplx_req_engine_pull(h2_req_engine *ngn, apr_read_type_e block, - apr_uint32_t capacity, + int capacity, request_rec **pr) { h2_ngn_shed *shed = h2_ngn_shed_get_shed(ngn); @@ -1429,7 +1429,7 @@ apr_status_t h2_mplx_dispatch_master_events(h2_mplx *m, ap_log_cerror(APLOG_MARK, APLOG_TRACE3, 0, m->c, "h2_mplx(%ld-%d): on_resume", m->id, stream->id); - on_resume(on_ctx, stream->id); + on_resume(on_ctx, stream); } } @@ -1438,7 +1438,7 @@ apr_status_t h2_mplx_dispatch_master_events(h2_mplx *m, return status; } -apr_status_t h2_mplx_keep_active(h2_mplx *m, apr_uint32_t stream_id) +apr_status_t h2_mplx_keep_active(h2_mplx *m, int stream_id) { apr_status_t status; int acquired; diff --git a/modules/http2/h2_mplx.h b/modules/http2/h2_mplx.h index 308facd895b..f7e3501783a 100644 --- a/modules/http2/h2_mplx.h +++ b/modules/http2/h2_mplx.h @@ -80,12 +80,12 @@ struct h2_mplx { struct h2_ihash_t *tasks; /* all tasks started and not destroyed */ struct h2_ihash_t *redo_tasks; /* all tasks that need to be redone */ - apr_uint32_t max_streams; /* max # of concurrent streams */ - apr_uint32_t max_stream_started; /* highest stream id that started processing */ - apr_uint32_t workers_busy; /* # of workers processing on this mplx */ - apr_uint32_t workers_limit; /* current # of workers limit, dynamic */ - apr_uint32_t workers_def_limit; /* default # of workers limit */ - apr_uint32_t workers_max; /* max, hard limit # of workers in a process */ + int max_streams; /* max # of concurrent streams */ + int max_stream_started; /* highest stream id that started processing */ + int workers_busy; /* # of workers processing on this mplx */ + int workers_limit; /* current # of workers limit, dynamic */ + int workers_def_limit; /* default # of workers limit */ + int workers_max; /* max, hard limit # of workers in a process */ apr_time_t last_idle_block; /* last time, this mplx entered IDLE while * streams were ready */ apr_time_t last_limit_change; /* last time, worker limit changed */ @@ -103,8 +103,8 @@ struct h2_mplx { apr_array_header_t *spare_slaves; /* spare slave connections */ struct h2_workers *workers; - apr_uint32_t tx_handles_reserved; - apr_uint32_t tx_chunk_size; + int tx_handles_reserved; + int tx_chunk_size; h2_mplx_consumed_cb *input_consumed; void *input_consumed_ctx; @@ -154,7 +154,7 @@ void h2_mplx_task_done(h2_mplx *m, struct h2_task *task, struct h2_task **ptask) * but let the ongoing ones finish normally. * @return the highest stream id being/been processed */ -apr_uint32_t h2_mplx_shutdown(h2_mplx *m); +int h2_mplx_shutdown(h2_mplx *m); int h2_mplx_is_busy(h2_mplx *m); @@ -162,7 +162,7 @@ int h2_mplx_is_busy(h2_mplx *m); * IO lifetime of streams. ******************************************************************************/ -struct h2_stream *h2_mplx_stream_get(h2_mplx *m, apr_uint32_t id); +struct h2_stream *h2_mplx_stream_get(h2_mplx *m, int id); /** * Notifies mplx that a stream has finished processing. @@ -181,7 +181,7 @@ apr_status_t h2_mplx_stream_done(h2_mplx *m, struct h2_stream *stream); apr_status_t h2_mplx_out_trywait(h2_mplx *m, apr_interval_time_t timeout, struct apr_thread_cond_t *iowait); -apr_status_t h2_mplx_keep_active(h2_mplx *m, apr_uint32_t stream_id); +apr_status_t h2_mplx_keep_active(h2_mplx *m, int stream_id); /******************************************************************************* * Stream processing. @@ -220,7 +220,7 @@ apr_status_t h2_mplx_reprioritize(h2_mplx *m, h2_stream_pri_cmp *cmp, void *ctx) void h2_mplx_set_consumed_cb(h2_mplx *m, h2_mplx_consumed_cb *cb, void *ctx); -typedef apr_status_t stream_ev_callback(void *ctx, int stream_id); +typedef apr_status_t stream_ev_callback(void *ctx, struct h2_stream *stream); /** * Dispatch events for the master connection, such as @@ -339,7 +339,7 @@ typedef apr_status_t h2_mplx_req_engine_init(struct h2_req_engine *engine, const char *id, const char *type, apr_pool_t *pool, - apr_uint32_t req_buffer_size, + apr_size_t req_buffer_size, request_rec *r, h2_output_consumed **pconsumed, void **pbaton); @@ -349,7 +349,7 @@ apr_status_t h2_mplx_req_engine_push(const char *ngn_type, h2_mplx_req_engine_init *einit); apr_status_t h2_mplx_req_engine_pull(struct h2_req_engine *ngn, apr_read_type_e block, - apr_uint32_t capacity, + int capacity, request_rec **pr); void h2_mplx_req_engine_done(struct h2_req_engine *ngn, conn_rec *r_conn); diff --git a/modules/http2/h2_ngn_shed.c b/modules/http2/h2_ngn_shed.c index 8dae7b8fa5b..5f397d6d262 100644 --- a/modules/http2/h2_ngn_shed.c +++ b/modules/http2/h2_ngn_shed.c @@ -79,10 +79,10 @@ struct h2_req_engine { unsigned int done : 1; /* engine has finished */ APR_RING_HEAD(h2_req_entries, h2_ngn_entry) entries; - apr_uint32_t capacity; /* maximum concurrent requests */ - apr_uint32_t no_assigned; /* # of assigned requests */ - apr_uint32_t no_live; /* # of live */ - apr_uint32_t no_finished; /* # of finished */ + int capacity; /* maximum concurrent requests */ + int no_assigned; /* # of assigned requests */ + int no_live; /* # of live */ + int no_finished; /* # of finished */ h2_output_consumed *out_consumed; void *out_consumed_ctx; @@ -107,8 +107,8 @@ void h2_req_engine_out_consumed(h2_req_engine *engine, conn_rec *c, } h2_ngn_shed *h2_ngn_shed_create(apr_pool_t *pool, conn_rec *c, - apr_uint32_t default_capacity, - apr_uint32_t req_buffer_size) + int default_capacity, + apr_size_t req_buffer_size) { h2_ngn_shed *shed; @@ -246,7 +246,7 @@ static h2_ngn_entry *pop_detached(h2_req_engine *ngn) apr_status_t h2_ngn_shed_pull_request(h2_ngn_shed *shed, h2_req_engine *ngn, - apr_uint32_t capacity, + int capacity, int want_shutdown, request_rec **pr) { diff --git a/modules/http2/h2_ngn_shed.h b/modules/http2/h2_ngn_shed.h index 1f61466a5c5..bcafc509b18 100644 --- a/modules/http2/h2_ngn_shed.h +++ b/modules/http2/h2_ngn_shed.h @@ -28,8 +28,8 @@ struct h2_ngn_shed { unsigned int aborted : 1; - apr_uint32_t default_capacity; - apr_uint32_t req_buffer_size; /* preferred buffer size for responses */ + int default_capacity; + apr_size_t req_buffer_size; /* preferred buffer size for responses */ }; const char *h2_req_engine_get_id(h2_req_engine *engine); @@ -42,14 +42,14 @@ typedef apr_status_t h2_shed_ngn_init(h2_req_engine *engine, const char *id, const char *type, apr_pool_t *pool, - apr_uint32_t req_buffer_size, + apr_size_t req_buffer_size, request_rec *r, h2_output_consumed **pconsumed, void **pbaton); h2_ngn_shed *h2_ngn_shed_create(apr_pool_t *pool, conn_rec *c, - apr_uint32_t default_capactiy, - apr_uint32_t req_buffer_size); + int default_capactiy, + apr_size_t req_buffer_size); void h2_ngn_shed_set_ctx(h2_ngn_shed *shed, void *user_ctx); void *h2_ngn_shed_get_ctx(h2_ngn_shed *shed); @@ -63,7 +63,7 @@ apr_status_t h2_ngn_shed_push_request(h2_ngn_shed *shed, const char *ngn_type, h2_shed_ngn_init *init_cb); apr_status_t h2_ngn_shed_pull_request(h2_ngn_shed *shed, h2_req_engine *pub_ngn, - apr_uint32_t capacity, + int capacity, int want_shutdown, request_rec **pr); apr_status_t h2_ngn_shed_done_task(h2_ngn_shed *shed, diff --git a/modules/http2/h2_proxy_util.c b/modules/http2/h2_proxy_util.c index 39e139d5c8f..215f8e4a4e9 100644 --- a/modules/http2/h2_proxy_util.c +++ b/modules/http2/h2_proxy_util.c @@ -27,7 +27,7 @@ #include "h2_proxy_util.h" /* h2_log2(n) iff n is a power of 2 */ -unsigned char h2_log2(apr_uint32_t n) +unsigned char h2_log2(int n) { int lz = 0; if (!n) { diff --git a/modules/http2/h2_proxy_util.h b/modules/http2/h2_proxy_util.h index 98f297fab4a..ebf77ecbde1 100644 --- a/modules/http2/h2_proxy_util.h +++ b/modules/http2/h2_proxy_util.h @@ -149,7 +149,7 @@ int h2_iq_shift(h2_iqueue *q); * common helpers ******************************************************************************/ /* h2_log2(n) iff n is a power of 2 */ -unsigned char h2_log2(apr_uint32_t n); +unsigned char h2_log2(int n); /******************************************************************************* * HTTP/2 header helpers diff --git a/modules/http2/h2_push.c b/modules/http2/h2_push.c index 042042704e9..6de93bd7d5a 100644 --- a/modules/http2/h2_push.c +++ b/modules/http2/h2_push.c @@ -714,9 +714,9 @@ static apr_int32_t h2_log2inv(unsigned char log2) typedef struct { h2_push_diary *diary; unsigned char log2p; - apr_uint32_t mask_bits; - apr_uint32_t delta_bits; - apr_uint32_t fixed_bits; + int mask_bits; + int delta_bits; + int fixed_bits; apr_uint64_t fixed_mask; apr_pool_t *pool; unsigned char *data; @@ -815,7 +815,7 @@ static apr_status_t gset_encode_next(gset_encoder *encoder, apr_uint64_t pval) * @param plen on successful return, the length of the binary data */ apr_status_t h2_push_diary_digest_get(h2_push_diary *diary, apr_pool_t *pool, - apr_uint32_t maxP, const char *authority, + int maxP, const char *authority, const char **pdata, apr_size_t *plen) { apr_size_t nelts, N, i; diff --git a/modules/http2/h2_push.h b/modules/http2/h2_push.h index bfe204f5a4c..7e85f13c6be 100644 --- a/modules/http2/h2_push.h +++ b/modules/http2/h2_push.h @@ -38,8 +38,8 @@ typedef void h2_push_digest_calc(h2_push_diary *diary, apr_uint64_t *phash, h2_p struct h2_push_diary { apr_array_header_t *entries; - apr_uint32_t NMax; /* Maximum for N, should size change be necessary */ - apr_uint32_t N; /* Current maximum number of entries, power of 2 */ + int NMax; /* Maximum for N, should size change be necessary */ + int N; /* Current maximum number of entries, power of 2 */ apr_uint64_t mask; /* mask for relevant bits */ unsigned int mask_bits; /* number of relevant bits */ const char *authority; @@ -95,7 +95,7 @@ apr_array_header_t *h2_push_collect_update(struct h2_stream *stream, * @param plen on successful return, the length of the binary data */ apr_status_t h2_push_diary_digest_get(h2_push_diary *diary, apr_pool_t *p, - apr_uint32_t maxP, const char *authority, + int maxP, const char *authority, const char **pdata, apr_size_t *plen); /** diff --git a/modules/http2/h2_session.c b/modules/http2/h2_session.c index a941ee0b806..81f14685ffe 100644 --- a/modules/http2/h2_session.c +++ b/modules/http2/h2_session.c @@ -1288,7 +1288,7 @@ apr_status_t h2_session_set_prio(h2_session *session, h2_stream *stream, s_parent = nghttp2_stream_get_parent(s); if (s_parent) { nghttp2_priority_spec ps; - apr_uint32_t id_parent, id_grandpa, w_parent, w; + int id_parent, id_grandpa, w_parent, w; int rv = 0; char *ptype = "AFTER"; h2_dependency dep = prio->dependency; @@ -1546,43 +1546,41 @@ leave: } /** - * A stream was resumed as new output data arrived. + * A stream was resumed as new response/output data arrived. */ -static apr_status_t on_stream_resume(void *ctx, int stream_id) +static apr_status_t on_stream_resume(void *ctx, h2_stream *stream) { h2_session *session = ctx; - h2_stream *stream = get_stream(session, stream_id); apr_status_t status = APR_EAGAIN; int rv; + apr_off_t len = 0; + int eos = 0; + h2_headers *headers = NULL; + ap_assert(stream); ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, session->c, - "h2_stream(%ld-%d): on_resume", session->id, stream_id); - if (stream) { - apr_off_t len = 0; - int eos = 0; - h2_headers *headers = NULL; + "h2_stream(%ld-%d): on_resume", session->id, stream->id); - send_headers: - status = h2_stream_out_prepare(stream, &len, &eos, &headers); - ap_log_cerror(APLOG_MARK, APLOG_TRACE2, status, session->c, - "h2_stream(%ld-%d): prepared len=%ld, eos=%d", - session->id, stream_id, (long)len, eos); - if (headers) { - status = on_stream_headers(session, stream, headers, len, eos); - if (status != APR_SUCCESS) { - return status; - } - goto send_headers; - } - else if (status != APR_EAGAIN) { - rv = nghttp2_session_resume_data(session->ngh2, stream_id); - session->have_written = 1; - ap_log_cerror(APLOG_MARK, nghttp2_is_fatal(rv)? - APLOG_ERR : APLOG_DEBUG, 0, session->c, - APLOGNO(02936) - "h2_stream(%ld-%d): resuming %s", - session->id, stream->id, rv? nghttp2_strerror(rv) : ""); +send_headers: + status = h2_stream_out_prepare(stream, &len, &eos, &headers); + ap_log_cerror(APLOG_MARK, APLOG_TRACE2, status, session->c, + "h2_stream(%ld-%d): prepared len=%ld, eos=%d", + session->id, stream->id, (long)len, eos); + if (headers) { + status = on_stream_headers(session, stream, headers, len, eos); + if (status != APR_SUCCESS) { + return status; } + goto send_headers; + } + else if (status != APR_EAGAIN) { + rv = nghttp2_session_resume_data(session->ngh2, stream->id); + session->have_written = 1; + ap_log_cerror(APLOG_MARK, nghttp2_is_fatal(rv)? + APLOG_ERR : APLOG_DEBUG, 0, session->c, + APLOGNO(02936) + "h2_stream(%ld-%d): resuming %s", + session->id, stream->id, rv? nghttp2_strerror(rv) : ""); } return status; } diff --git a/modules/http2/h2_stream.c b/modules/http2/h2_stream.c index 35747710cdd..bce39ca1fba 100644 --- a/modules/http2/h2_stream.c +++ b/modules/http2/h2_stream.c @@ -192,7 +192,7 @@ static apr_status_t stream_pool_cleanup(void *ctx) return APR_SUCCESS; } -h2_stream *h2_stream_open(apr_uint32_t id, apr_pool_t *pool, h2_session *session, +h2_stream *h2_stream_open(int id, apr_pool_t *pool, h2_session *session, int initiated_on) { h2_stream *stream = apr_pcalloc(pool, sizeof(h2_stream)); diff --git a/modules/http2/h2_stream.h b/modules/http2/h2_stream.h index 346e4e2a228..8e772275f50 100644 --- a/modules/http2/h2_stream.h +++ b/modules/http2/h2_stream.h @@ -42,8 +42,8 @@ struct h2_bucket_beam; typedef struct h2_stream h2_stream; struct h2_stream { - apr_uint32_t id; /* http2 stream id */ - apr_uint32_t initiated_on; /* initiating stream id (PUSH) or 0 */ + int id; /* http2 stream id */ + int initiated_on; /* initiating stream id (PUSH) or 0 */ apr_time_t created; /* when stream was created */ h2_stream_state_t state; /* http/2 state of this stream */ struct h2_session *session; /* the session this stream belongs to */ @@ -84,7 +84,7 @@ struct h2_stream { * @param session the session this stream belongs to * @return the newly opened stream */ -h2_stream *h2_stream_open(apr_uint32_t id, apr_pool_t *pool, struct h2_session *session, +h2_stream *h2_stream_open(int id, apr_pool_t *pool, struct h2_session *session, int initiated_on); /** diff --git a/modules/http2/h2_task.c b/modules/http2/h2_task.c index d6f1ff23772..5affec3dce9 100644 --- a/modules/http2/h2_task.c +++ b/modules/http2/h2_task.c @@ -526,7 +526,7 @@ static int h2_task_pre_conn(conn_rec* c, void *arg) return OK; } -h2_task *h2_task_create(conn_rec *c, apr_uint32_t stream_id, +h2_task *h2_task_create(conn_rec *c, int stream_id, const h2_request *req, h2_bucket_beam *input, h2_mplx *mplx) { diff --git a/modules/http2/h2_task.h b/modules/http2/h2_task.h index f607c884380..e5c32f147e1 100644 --- a/modules/http2/h2_task.h +++ b/modules/http2/h2_task.h @@ -50,7 +50,7 @@ typedef struct h2_task h2_task; struct h2_task { const char *id; - apr_uint32_t stream_id; + int stream_id; conn_rec *c; apr_pool_t *pool; @@ -89,7 +89,7 @@ struct h2_task { struct h2_req_engine *assigned; /* engine that task has been assigned to */ }; -h2_task *h2_task_create(conn_rec *c, apr_uint32_t stream_id, +h2_task *h2_task_create(conn_rec *c, int stream_id, const struct h2_request *req, struct h2_bucket_beam *input, struct h2_mplx *mplx); diff --git a/modules/http2/h2_util.c b/modules/http2/h2_util.c index f62bc6c8b7e..3a3900dd09f 100644 --- a/modules/http2/h2_util.c +++ b/modules/http2/h2_util.c @@ -27,7 +27,7 @@ #include "h2_util.h" /* h2_log2(n) iff n is a power of 2 */ -unsigned char h2_log2(apr_uint32_t n) +unsigned char h2_log2(int n) { int lz = 0; if (!n) { diff --git a/modules/http2/h2_util.h b/modules/http2/h2_util.h index 024c31381e6..d1abd6cce59 100644 --- a/modules/http2/h2_util.h +++ b/modules/http2/h2_util.h @@ -160,7 +160,7 @@ int h2_iq_shift(h2_iqueue *q); * common helpers ******************************************************************************/ /* h2_log2(n) iff n is a power of 2 */ -unsigned char h2_log2(apr_uint32_t n); +unsigned char h2_log2(int n); /** * Count the bytes that all key/value pairs in a table have diff --git a/modules/http2/h2_version.h b/modules/http2/h2_version.h index b7c051e22e6..e7c28655f82 100644 --- a/modules/http2/h2_version.h +++ b/modules/http2/h2_version.h @@ -26,7 +26,7 @@ * @macro * Version number of the http2 module as c string */ -#define MOD_HTTP2_VERSION "1.7.2" +#define MOD_HTTP2_VERSION "1.7.3" /** * @macro @@ -34,7 +34,7 @@ * release. This is a 24 bit number with 8 bits for major number, 8 bits * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. */ -#define MOD_HTTP2_VERSION_NUM 0x010702 +#define MOD_HTTP2_VERSION_NUM 0x010703 #endif /* mod_h2_h2_version_h */ diff --git a/modules/http2/mod_http2.c b/modules/http2/mod_http2.c index 8cf6e2de69c..9495724dbc6 100644 --- a/modules/http2/mod_http2.c +++ b/modules/http2/mod_http2.c @@ -160,7 +160,7 @@ static apr_status_t http2_req_engine_push(const char *ngn_type, static apr_status_t http2_req_engine_pull(h2_req_engine *ngn, apr_read_type_e block, - apr_uint32_t capacity, + int capacity, request_rec **pr) { return h2_mplx_req_engine_pull(ngn, block, capacity, pr); diff --git a/modules/http2/mod_http2.h b/modules/http2/mod_http2.h index 3073579282f..15cf9d0677b 100644 --- a/modules/http2/mod_http2.h +++ b/modules/http2/mod_http2.h @@ -49,7 +49,7 @@ typedef apr_status_t http2_req_engine_init(h2_req_engine *engine, const char *id, const char *type, apr_pool_t *pool, - apr_uint32_t req_buffer_size, + apr_size_t req_buffer_size, request_rec *r, http2_output_consumed **pconsumed, void **pbaton); @@ -75,8 +75,9 @@ APR_DECLARE_OPTIONAL_FN(apr_status_t, /** * Get a new request for processing in this engine. * @param engine the engine which is done processing the slave - * @param timeout wait a maximum amount of time for a new slave, 0 will not wait - * @param pslave the slave connection that needs processing or NULL + * @param block if call should block waiting for request to come + * @param capacity how many parallel requests are acceptable + * @param pr the request that needs processing or NULL * @return APR_SUCCESS if new request was assigned * APR_EAGAIN if no new request is available * APR_EOF if engine may shut down, as no more request will be scheduled @@ -85,7 +86,7 @@ APR_DECLARE_OPTIONAL_FN(apr_status_t, APR_DECLARE_OPTIONAL_FN(apr_status_t, http2_req_engine_pull, (h2_req_engine *engine, apr_read_type_e block, - apr_uint32_t capacity, + int capacity, request_rec **pr)); APR_DECLARE_OPTIONAL_FN(void, http2_req_engine_done, (h2_req_engine *engine, diff --git a/modules/http2/mod_proxy_http2.c b/modules/http2/mod_proxy_http2.c index df1d7811757..2754df02e75 100644 --- a/modules/http2/mod_proxy_http2.c +++ b/modules/http2/mod_proxy_http2.c @@ -44,7 +44,7 @@ static apr_status_t (*req_engine_push)(const char *name, request_rec *r, http2_req_engine_init *einit); static apr_status_t (*req_engine_pull)(h2_req_engine *engine, apr_read_type_e block, - apr_uint32_t capacity, + int capacity, request_rec **pr); static void (*req_engine_done)(h2_req_engine *engine, conn_rec *r_conn); @@ -63,7 +63,7 @@ typedef struct h2_proxy_ctx { const char *engine_id; const char *engine_type; apr_pool_t *engine_pool; - apr_uint32_t req_buffer_size; + apr_size_t req_buffer_size; request_rec *next; apr_size_t capacity; @@ -210,7 +210,7 @@ static apr_status_t proxy_engine_init(h2_req_engine *engine, const char *id, const char *type, apr_pool_t *pool, - apr_uint32_t req_buffer_size, + apr_size_t req_buffer_size, request_rec *r, http2_output_consumed **pconsumed, void **pctx)