/* Bring the current buffer content into the output brigade, appropriately
* chunked.
*/
-static apr_status_t bucketeer_buffer(h2_conn_io *io) {
+static apr_status_t bucketeer_buffer(h2_conn_io *io)
+{
const char *data = io->buffer;
apr_size_t remaining = io->buflen;
apr_bucket *b;
}
return DECLINED;
}
-
-
-
} while(0)
-static int is_aborted(h2_mplx *m, apr_status_t *pstatus) {
+static int is_aborted(h2_mplx *m, apr_status_t *pstatus)
+{
AP_DEBUG_ASSERT(m);
if (m->aborted) {
*pstatus = APR_ECONNABORTED;
release(m, 1);
}
-static void workers_register(h2_mplx *m) {
+static void workers_register(h2_mplx *m)
+{
/* Initially, there was ref count increase for this as well, but
* this is not needed, even harmful.
* h2_workers is only a hub for all the h2_worker instances.
h2_workers_register(m->workers, m);
}
-static void workers_unregister(h2_mplx *m) {
+static void workers_unregister(h2_mplx *m)
+{
h2_workers_unregister(m->workers, m);
}
-static int io_process_events(h2_mplx *m, h2_io *io) {
+static int io_process_events(h2_mplx *m, h2_io *io)
+{
if (io->input_consumed && m->input_consumed) {
m->input_consumed(m->input_consumed_ctx,
io->id, io->input_consumed);
return 0;
}
-
static void io_destroy(h2_mplx *m, h2_io *io, int events)
{
apr_pool_t *pool = io->pool;
}
}
-static int stream_done_iter(void *ctx, h2_io *io) {
+static int stream_done_iter(void *ctx, h2_io *io)
+{
return io_stream_done((h2_mplx*)ctx, io, 0);
}
return status;
}
-
apr_status_t h2_mplx_out_write(h2_mplx *m, int stream_id,
ap_filter_t* f, apr_bucket_brigade *bb,
apr_table_t *trailers,
int resume_count;
} resume_ctx;
-static int resume_on_data(void *ctx, h2_stream *stream) {
+static int resume_on_data(void *ctx, h2_stream *stream)
+{
resume_ctx *rctx = (resume_ctx*)ctx;
h2_session *session = rctx->session;
AP_DEBUG_ASSERT(session);
return 1;
}
-static int h2_session_resume_streams_with_data(h2_session *session) {
+static int h2_session_resume_streams_with_data(h2_session *session)
+{
AP_DEBUG_ASSERT(session);
if (!h2_stream_set_is_empty(session->streams)
&& session->mplx && !session->aborted) {
return APR_SUCCESS;
}
-
-
static apr_status_t h2_session_read(h2_session *session, int block)
{
-
while (1) {
apr_status_t status;
ap_hook_protocol_switch(h2_protocol_switch, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_protocol_get(h2_protocol_get, NULL, NULL, APR_HOOK_MIDDLE);
}
-
apr_bucket_brigade* brigade,
ap_input_mode_t mode,
apr_read_type_e block,
- apr_off_t readbytes) {
+ apr_off_t readbytes)
+{
h2_task *task = filter->ctx;
AP_DEBUG_ASSERT(task);
if (!task->input) {
}
static apr_status_t h2_filter_stream_output(ap_filter_t* filter,
- apr_bucket_brigade* brigade) {
+ apr_bucket_brigade* brigade)
+{
h2_task *task = filter->ctx;
AP_DEBUG_ASSERT(task);
if (!task->output) {
}
static apr_status_t h2_filter_read_response(ap_filter_t* f,
- apr_bucket_brigade* bb) {
+ apr_bucket_brigade* bb)
+{
h2_task *task = f->ctx;
AP_DEBUG_ASSERT(task);
if (!task->output || !task->output->from_h1) {
static int h2_task_pre_conn(conn_rec* c, void *arg)
{
-
h2_ctx *ctx;
if (!c->master) {
}
return DECLINED;
}
-
-
-
-
-
return status;
}
-int h2_util_has_flush_or_eos(apr_bucket_brigade *bb) {
+int h2_util_has_flush_or_eos(apr_bucket_brigade *bb)
+{
apr_bucket *b;
for (b = APR_BRIGADE_FIRST(bb);
b != APR_BRIGADE_SENTINEL(bb);
return 0;
}
-static void cleanup_zombies(h2_workers *workers, int lock) {
+static void cleanup_zombies(h2_workers *workers, int lock)
+{
if (lock) {
apr_thread_mutex_lock(workers->lock);
}
}
}
-
/**
* Get the next task for the given worker. Will block until a task arrives
* or the max_wait timer expires and more than min workers exist.
}
}
-
static apr_status_t add_worker(h2_workers *workers)
{
h2_worker *w = h2_worker_create(workers->next_worker_id++,
return APR_SUCCESS;
}
-static apr_status_t h2_workers_start(h2_workers *workers) {
+static apr_status_t h2_workers_start(h2_workers *workers)
+{
apr_status_t status = apr_thread_mutex_lock(workers->lock);
if (status == APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, workers->s,
}
apr_atomic_set32(&workers->max_idle_secs, idle_secs);
}
-