Apache2
h2_mplx.h File Reference
#include <apr_queue.h>
#include "h2_workers.h"
Include dependency graph for h2_mplx.h:

Go to the source code of this file.

Data Structures

struct  h2_c2_transit
 
struct  h2_mplx
 

Macros

#define H2_MPLX_MSG(m, msg)    "h2_mplx(%d-%lu): "msg, m->child_num, (unsigned long)m->id
 

Typedefs

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

Functions

apr_status_t h2_mplx_c1_child_init (apr_pool_t *pool, server_rec *s)
 
h2_mplxh2_mplx_c1_create (int child_id, apr_uint32_t id, struct h2_stream *stream0, server_rec *s, apr_pool_t *master, struct h2_workers *workers)
 
void h2_mplx_c1_destroy (h2_mplx *m)
 
int h2_mplx_c1_shutdown (h2_mplx *m)
 
apr_status_t h2_mplx_c1_stream_cleanup (h2_mplx *m, struct h2_stream *stream, unsigned int *pstream_count)
 
int h2_mplx_c1_stream_is_running (h2_mplx *m, struct h2_stream *stream)
 
void h2_mplx_c1_process (h2_mplx *m, struct h2_iqueue *read_to_process, h2_stream_get_fn *get_stream, h2_stream_pri_cmp_fn *cmp, struct h2_session *session, unsigned int *pstream_count)
 
apr_status_t h2_mplx_c1_reprioritize (h2_mplx *m, h2_stream_pri_cmp_fn *cmp, struct h2_session *session)
 
apr_status_t h2_mplx_c1_poll (h2_mplx *m, apr_interval_time_t timeout, stream_ev_callback *on_stream_input, stream_ev_callback *on_stream_output, void *on_ctx)
 
void h2_mplx_c2_input_read (h2_mplx *m, conn_rec *c2)
 
void h2_mplx_c2_output_written (h2_mplx *m, conn_rec *c2)
 
apr_status_t h2_mplx_c1_streams_do (h2_mplx *m, h2_mplx_stream_cb *cb, void *ctx)
 
int h2_mplx_c1_all_streams_want_send_data (h2_mplx *m)
 
apr_status_t h2_mplx_c1_client_rst (h2_mplx *m, int stream_id, struct h2_stream *stream)
 
const struct h2_streamh2_mplx_c2_stream_get (h2_mplx *m, int stream_id)
 
apr_status_t h2_mplx_worker_pop_c2 (h2_mplx *m, conn_rec **out_c2)
 
void h2_mplx_c1_going_keepalive (h2_mplx *m)
 

Macro Definition Documentation

◆ H2_MPLX_MSG

#define H2_MPLX_MSG (   m,
  msg 
)     "h2_mplx(%d-%lu): "msg, m->child_num, (unsigned long)m->id

Typedef Documentation

◆ h2_c2_transit

typedef struct h2_c2_transit h2_c2_transit

◆ h2_mplx

typedef struct h2_mplx h2_mplx

◆ h2_mplx_stream_cb

typedef int h2_mplx_stream_cb(struct h2_stream *s, void *userdata)

◆ stream_ev_callback

typedef void stream_ev_callback(void *ctx, struct h2_stream *stream)

Function Documentation

◆ h2_mplx_c1_all_streams_want_send_data()

int h2_mplx_c1_all_streams_want_send_data ( h2_mplx m)

Return != 0 iff all open streams want to send data

◆ h2_mplx_c1_child_init()

apr_status_t h2_mplx_c1_child_init ( apr_pool_t pool,
server_rec s 
)

◆ h2_mplx_c1_client_rst()

apr_status_t h2_mplx_c1_client_rst ( h2_mplx m,
int  stream_id,
struct h2_stream stream 
)

A stream has been RST_STREAM by the client. Abort any processing going on and remove from processing queue.

◆ h2_mplx_c1_create()

h2_mplx* h2_mplx_c1_create ( int  child_id,
apr_uint32_t  id,
struct h2_stream stream0,
server_rec s,
apr_pool_t master,
struct h2_workers workers 
)

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

◆ h2_mplx_c1_destroy()

void h2_mplx_c1_destroy ( h2_mplx m)

Destroy the mplx, shutting down all ongoing processing.

Parameters
mthe mplx destroyed
waitcondition var to wait on for ref counter == 0

◆ h2_mplx_c1_going_keepalive()

void h2_mplx_c1_going_keepalive ( h2_mplx m)

Session processing is entering KEEPALIVE, e.g. giving control to the MPM for monitoring incoming socket events only. Last chance for maintenance work before losing control.

◆ h2_mplx_c1_poll()

apr_status_t h2_mplx_c1_poll ( h2_mplx m,
apr_interval_time_t  timeout,
stream_ev_callback on_stream_input,
stream_ev_callback on_stream_output,
void *  on_ctx 
)

Poll the primary connection for input and the active streams for output. Invoke the callback for any stream where an event happened.

◆ h2_mplx_c1_process()

void h2_mplx_c1_process ( h2_mplx m,
struct h2_iqueue read_to_process,
h2_stream_get_fn get_stream,
h2_stream_pri_cmp_fn cmp,
struct h2_session session,
unsigned int pstream_count 
)

Process a stream request.

Parameters
mthe multiplexer
read_to_process
input_pending
cmpthe stream priority compare function
pstream_counton return the number of streams active in mplx

◆ h2_mplx_c1_reprioritize()

apr_status_t h2_mplx_c1_reprioritize ( h2_mplx m,
h2_stream_pri_cmp_fn cmp,
struct h2_session session 
)

Stream priorities have changed, reschedule pending requests.

Parameters
mthe multiplexer
cmpthe stream priority compare function
ctxcontext data for the compare function

◆ h2_mplx_c1_shutdown()

int h2_mplx_c1_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

◆ h2_mplx_c1_stream_cleanup()

apr_status_t h2_mplx_c1_stream_cleanup ( h2_mplx m,
struct h2_stream stream,
unsigned int pstream_count 
)

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
pstream_countreturn the number of streams active

◆ h2_mplx_c1_stream_is_running()

int h2_mplx_c1_stream_is_running ( h2_mplx m,
struct h2_stream stream 
)

◆ h2_mplx_c1_streams_do()

apr_status_t h2_mplx_c1_streams_do ( h2_mplx m,
h2_mplx_stream_cb cb,
void *  ctx 
)

Iterate over all streams known to mplx from the primary connection.

Parameters
mthe mplx
cbthe callback to invoke on each stream
ctxuserdata passed to the callback

◆ h2_mplx_c2_input_read()

void h2_mplx_c2_input_read ( h2_mplx m,
conn_rec c2 
)

◆ h2_mplx_c2_output_written()

void h2_mplx_c2_output_written ( h2_mplx m,
conn_rec c2 
)

◆ h2_mplx_c2_stream_get()

const struct h2_stream* h2_mplx_c2_stream_get ( h2_mplx m,
int  stream_id 
)

Get readonly access to a stream for a secondary connection.

◆ h2_mplx_worker_pop_c2()

apr_status_t h2_mplx_worker_pop_c2 ( h2_mplx m,
conn_rec **  out_c2 
)

A h2 worker asks for a secondary connection to process.

Parameters
out_c2non-NULL, a pointer where to reveive the next secondary connection to process.