Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
h2_session.h File Reference
#include "h2_conn_io.h"
#include "h2.h"
Include dependency graph for h2_session.h:

Go to the source code of this file.

Data Structures

struct  h2_session
 

Typedefs

typedef struct h2_session h2_session
 

Enumerations

enum  h2_session_event_t {
  H2_SESSION_EV_INIT, H2_SESSION_EV_LOCAL_GOAWAY, H2_SESSION_EV_REMOTE_GOAWAY, H2_SESSION_EV_CONN_ERROR,
  H2_SESSION_EV_PROTO_ERROR, H2_SESSION_EV_CONN_TIMEOUT, H2_SESSION_EV_NO_IO, H2_SESSION_EV_STREAM_READY,
  H2_SESSION_EV_DATA_READ, H2_SESSION_EV_NGH2_DONE, H2_SESSION_EV_MPM_STOPPING, H2_SESSION_EV_PRE_CLOSE,
  H2_SESSION_EV_STREAM_OPEN, H2_SESSION_EV_STREAM_DONE
}
 

Functions

h2_sessionh2_session_create (conn_rec *c, struct h2_ctx *ctx, struct h2_workers *workers)
 
h2_sessionh2_session_rcreate (request_rec *r, struct h2_ctx *ctx, struct h2_workers *workers)
 
apr_status_t h2_session_process (h2_session *session, int async)
 
apr_status_t h2_session_pre_close (h2_session *session, int async)
 
void h2_session_eoc_callback (h2_session *session)
 
void h2_session_abort (h2_session *session, apr_status_t reason)
 
void h2_session_close (h2_session *session)
 
struct h2_streamh2_session_open_stream (h2_session *session, int stream_id, int initiated_on, const h2_request *req)
 
int h2_session_push_enabled (h2_session *session)
 
apr_status_t h2_session_stream_done (h2_session *session, struct h2_stream *stream)
 
struct h2_streamh2_session_push (h2_session *session, struct h2_stream *is, struct h2_push *push)
 
apr_status_t h2_session_set_prio (h2_session *session, struct h2_stream *stream, const struct h2_priority *prio)
 

Typedef Documentation

typedef struct h2_session h2_session

Enumeration Type Documentation

Enumerator
H2_SESSION_EV_INIT 
H2_SESSION_EV_LOCAL_GOAWAY 
H2_SESSION_EV_REMOTE_GOAWAY 
H2_SESSION_EV_CONN_ERROR 
H2_SESSION_EV_PROTO_ERROR 
H2_SESSION_EV_CONN_TIMEOUT 
H2_SESSION_EV_NO_IO 
H2_SESSION_EV_STREAM_READY 
H2_SESSION_EV_DATA_READ 
H2_SESSION_EV_NGH2_DONE 
H2_SESSION_EV_MPM_STOPPING 
H2_SESSION_EV_PRE_CLOSE 
H2_SESSION_EV_STREAM_OPEN 
H2_SESSION_EV_STREAM_DONE 

Function Documentation

void h2_session_abort ( h2_session session,
apr_status_t  reason 
)

Called when a serious error occurred and the session needs to terminate without further connection io.

Parameters
sessionthe session to abort
reasonthe apache status that caused the abort
void h2_session_close ( h2_session session)

Close and deallocate the given session.

h2_session* h2_session_create ( conn_rec c,
struct h2_ctx ctx,
struct h2_workers workers 
)

Create a new h2_session for the given connection. The session will apply the configured parameter.

Parameters
cthe connection to work on
cfgthe module config to apply
workersthe worker pool to use
Returns
the created session
void h2_session_eoc_callback ( h2_session session)

Cleanup the session and all objects it still contains. This will not destroy h2_task instances that have not finished yet.

Parameters
sessionthe session to destroy
struct h2_stream* h2_session_open_stream ( h2_session session,
int  stream_id,
int  initiated_on,
const h2_request req 
)

Create and register a new stream under the given id.

Parameters
sessionthe session to register in
stream_idthe new stream identifier
initiated_onthe stream id this one is initiated on or 0
reqthe request for this stream or NULL if not known yet
Returns
the new stream
apr_status_t h2_session_pre_close ( h2_session session,
int  async 
)

Last chance to do anything before the connection is closed.

apr_status_t h2_session_process ( h2_session session,
int  async 
)

Process the given HTTP/2 session until it is ended or a fatal error occurred.

Parameters
sessionthe sessionm to process
struct h2_stream* h2_session_push ( h2_session session,
struct h2_stream is,
struct h2_push push 
)

Submit a push promise on the stream and schedule the new steam for processing..

Parameters
sessionthe session to work in
isthe stream initiating the push
pushthe push to promise
Returns
the new promised stream or NULL
int h2_session_push_enabled ( h2_session session)

Returns if client settings have push enabled.

Parameters
!=0 iff push is enabled in client settings
h2_session* h2_session_rcreate ( request_rec r,
struct h2_ctx ctx,
struct h2_workers workers 
)

Create a new h2_session for the given request. The session will apply the configured parameter.

Parameters
rthe request that was upgraded
cfgthe module config to apply
workersthe worker pool to use
Returns
the created session
apr_status_t h2_session_set_prio ( h2_session session,
struct h2_stream stream,
const struct h2_priority prio 
)
apr_status_t h2_session_stream_done ( h2_session session,
struct h2_stream stream 
)

Destroy the stream and release it everywhere. Reclaim all resources.

Parameters
sessionthe session to which the stream belongs
streamthe stream to destroy