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
 

Macros

#define H2_SSSN_MSG(s, msg)
 
#define H2_SSSN_LOG(aplogno, s, msg)   aplogno H2_SSSN_MSG(s, msg)
 

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_DATA_READ,
  H2_SESSION_EV_NGH2_DONE, H2_SESSION_EV_MPM_STOPPING, H2_SESSION_EV_PRE_CLOSE
}
 

Functions

const char * h2_session_state_str (h2_session_state state)
 
apr_status_t h2_session_create (h2_session **psession, conn_rec *c, struct h2_ctx *ctx, struct h2_workers *workers)
 
apr_status_t h2_session_rcreate (h2_session **psession, request_rec *r, struct h2_ctx *ctx, struct h2_workers *workers)
 
void h2_session_event (h2_session *session, h2_session_event_t ev, int err, const char *msg)
 
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_abort (h2_session *session, apr_status_t reason)
 
void h2_session_close (h2_session *session)
 
int h2_session_push_enabled (h2_session *session)
 
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)
 

Macro Definition Documentation

#define H2_SSSN_LOG (   aplogno,
  s,
  msg 
)    aplogno H2_SSSN_MSG(s, msg)
#define H2_SSSN_MSG (   s,
  msg 
)
Value:
"h2_session(%ld,%s,%d): "msg, s->id, h2_session_state_str(s->state), \
s->open_streams
const char * h2_session_state_str(h2_session_state state)

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_DATA_READ 
H2_SESSION_EV_NGH2_DONE 
H2_SESSION_EV_MPM_STOPPING 
H2_SESSION_EV_PRE_CLOSE 

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.

apr_status_t h2_session_create ( h2_session **  psession,
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
psessionpointer receiving the created session on success or NULL
cthe connection to work on
cfgthe module config to apply
workersthe worker pool to use
Returns
the created session
void h2_session_event ( h2_session session,
h2_session_event_t  ev,
int  err,
const char *  msg 
)
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
apr_status_t h2_session_rcreate ( h2_session **  psession,
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
psessionpointer receiving the created session on success or NULL
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 
)
const char* h2_session_state_str ( h2_session_state  state)