Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
h2_mplx.h File Reference
#include <apr_queue.h>
Include dependency graph for h2_mplx.h:

Go to the source code of this file.

Data Structures

struct  h2_mplx
 

Typedefs

typedef struct h2_mplx h2_mplx
 
typedef apr_status_t stream_ev_callback (void *ctx, struct h2_stream *stream)
 
typedef int h2_mplx_stream_cb (struct h2_stream *s, void *ctx)
 

Functions

apr_status_t h2_mplx_m_child_init (apr_pool_t *pool, server_rec *s)
 
h2_mplxh2_mplx_m_create (conn_rec *c, server_rec *s, apr_pool_t *master, struct h2_workers *workers)
 
void h2_mplx_m_release_and_join (h2_mplx *m, struct apr_thread_cond_t *wait)
 
int h2_mplx_m_shutdown (h2_mplx *m)
 
apr_status_t h2_mplx_m_stream_cleanup (h2_mplx *m, struct h2_stream *stream)
 
apr_status_t h2_mplx_m_out_trywait (h2_mplx *m, apr_interval_time_t timeout, struct apr_thread_cond_t *iowait)
 
apr_status_t h2_mplx_m_keep_active (h2_mplx *m, struct h2_stream *stream)
 
apr_status_t h2_mplx_m_process (h2_mplx *m, struct h2_stream *stream, h2_stream_pri_cmp *cmp, void *ctx)
 
apr_status_t h2_mplx_m_reprioritize (h2_mplx *m, h2_stream_pri_cmp *cmp, void *ctx)
 
int h2_mplx_m_has_master_events (h2_mplx *m)
 
apr_status_t h2_mplx_m_dispatch_master_events (h2_mplx *m, stream_ev_callback *on_resume, void *ctx)
 
int h2_mplx_m_awaits_data (h2_mplx *m)
 
apr_status_t h2_mplx_m_stream_do (h2_mplx *m, h2_mplx_stream_cb *cb, void *ctx)
 
apr_status_t h2_mplx_m_client_rst (h2_mplx *m, int stream_id)
 
apr_status_t h2_mplx_m_idle (h2_mplx *m)
 
apr_status_t h2_mplx_s_pop_task (h2_mplx *m, struct h2_task **ptask)
 
void h2_mplx_s_task_done (h2_mplx *m, struct h2_task *task, struct h2_task **ptask)
 
apr_status_t h2_mplx_t_out_open (h2_mplx *mplx, int stream_id, struct h2_bucket_beam *beam)
 
struct h2_streamh2_mplx_t_stream_get (h2_mplx *m, struct h2_task *task)
 

Typedef Documentation

typedef struct h2_mplx h2_mplx
typedef int h2_mplx_stream_cb(struct h2_stream *s, void *ctx)
typedef apr_status_t stream_ev_callback(void *ctx, struct h2_stream *stream)

Function Documentation

int h2_mplx_m_awaits_data ( h2_mplx m)
apr_status_t h2_mplx_m_child_init ( apr_pool_t pool,
server_rec s 
)
apr_status_t h2_mplx_m_client_rst ( h2_mplx m,
int  stream_id 
)
h2_mplx* h2_mplx_m_create ( conn_rec c,
server_rec s,
apr_pool_t master,
struct h2_workers workers 
)

Create the multiplexer for the given HTTP2 session. Implicitly has reference count 1.

apr_status_t h2_mplx_m_dispatch_master_events ( h2_mplx m,
stream_ev_callback on_resume,
void ctx 
)

Dispatch events for the master connection, such as ± 

Parameters
mthe multiplexer
on_resumenew output data has arrived for a suspended stream
ctxuser supplied argument to invocation.
int h2_mplx_m_has_master_events ( h2_mplx m)

Check if the multiplexer has events for the master connection pending.

Returns
!= 0 iff there are events pending
apr_status_t h2_mplx_m_idle ( h2_mplx m)

Master connection has entered idle mode.

Parameters
mthe mplx instance of the master connection
Returns
!= SUCCESS iff connection should be terminated
apr_status_t h2_mplx_m_keep_active ( h2_mplx m,
struct h2_stream stream 
)
apr_status_t h2_mplx_m_out_trywait ( h2_mplx m,
apr_interval_time_t  timeout,
struct apr_thread_cond_t iowait 
)

Waits on output data from any stream in this session to become available. Returns APR_TIMEUP if no data arrived in the given time.

apr_status_t h2_mplx_m_process ( h2_mplx m,
struct h2_stream stream,
h2_stream_pri_cmp cmp,
void ctx 
)

Process a stream request.

Parameters
mthe multiplexer
streamthe identifier of the stream
rthe request to be processed
cmpthe stream priority compare function
ctxcontext data for the compare function
void h2_mplx_m_release_and_join ( h2_mplx m,
struct apr_thread_cond_t wait 
)

Decreases the reference counter of this mplx and waits for it to reached 0, destroy the mplx afterwards. This is to be called from the thread that created the mplx in the first place.

Parameters
mthe mplx to be released and destroyed
waitcondition var to wait on for ref counter == 0
apr_status_t h2_mplx_m_reprioritize ( h2_mplx m,
h2_stream_pri_cmp cmp,
void ctx 
)

Stream priorities have changed, reschedule pending requests.

Parameters
mthe multiplexer
cmpthe stream priority compare function
ctxcontext data for the compare function
int h2_mplx_m_shutdown ( h2_mplx m)

Shut down the multiplexer gracefully. Will no longer schedule new streams but let the ongoing ones finish normally.

Returns
the highest stream id being/been processed
apr_status_t h2_mplx_m_stream_cleanup ( h2_mplx m,
struct h2_stream stream 
)

Notifies mplx that a stream has been completely handled on the main connection and is ready for cleanup.

Parameters
mthe mplx itself
streamthe stream ready for cleanup
apr_status_t h2_mplx_m_stream_do ( h2_mplx m,
h2_mplx_stream_cb cb,
void ctx 
)
apr_status_t h2_mplx_s_pop_task ( h2_mplx m,
struct h2_task **  ptask 
)
void h2_mplx_s_task_done ( h2_mplx m,
struct h2_task task,
struct h2_task **  ptask 
)
apr_status_t h2_mplx_t_out_open ( h2_mplx mplx,
int  stream_id,
struct h2_bucket_beam beam 
)

Opens the output for the given stream with the specified response.

struct h2_stream* h2_mplx_t_stream_get ( h2_mplx m,
struct h2_task task 
)

Get the stream that belongs to the given task.