85 int err,
const char *msg)
122 session->
monitor, initiated_on);
207 APLOGNO(03062)
"h2_session: send error");
225 "recv invalid FRAME[%s], frames=%ld/%ld (r/s)"),
251 "on_data_chunk for unknown stream"));
274 "closing with err=%d %s"),
316 "on_header unknown stream"));
355 "recv FRAME[%s], frames=%ld/%ld (r/s)"),
362 "recv FRAME[%s], frames=%ld/%ld (r/s)"),
369 switch (
frame->hd.type) {
383 "DATA, len=%ld, flags=%d"),
393 " weight=%d, dependsOn=%d, exclusive=%d"),
394 frame->priority.pri_spec.weight,
395 frame->priority.pri_spec.stream_id,
396 frame->priority.pri_spec.exclusive);
401 "WINDOW_UPDATE incr=%d"),
402 frame->window_update.window_size_increment);
407 "RST_STREAM by client, error=%d"),
408 (
int)
frame->rst_stream.error_code);
427 if (
frame->goaway.error_code == 0
428 &&
frame->goaway.last_stream_id == ((1u << 31) - 1)) {
465 H2_SSSN_MSG(session,
"session has %ld idle frames"),
500 int stream_id = (
int)
frame->hd.stream_id;
539 H2_STRM_MSG(stream,
"send_data_cb, reading stream"));
545 H2_STRM_MSG(stream,
"send_data_cb, wanted %ld bytes, "
546 "got %ld from stream"), (
long)
length, (
long)
len);
564 H2_STRM_MSG(stream,
"sent data length=%ld, total=%ld"),
581 int stream_id =
frame->hd.stream_id;
584 switch (
frame->hd.type) {
587 stream_id =
frame->push_promise.promised_stream_id;
601 "sent FRAME[%s], frames=%ld/%ld (r/s)"),
608 "sent FRAME[%s], frames=%ld/%ld (r/s)"),
621#ifdef H2_NG2_INVALID_HEADER_CB
633 "invalid header '%.*s: %.*s'"),
666 "select padding from [%d, %d]: %d (frame length: 0x%04x, write size: %d)",
671 return frame->hd.length;
674#define NGH2_SET_CALLBACK(callbacks, name, fn)\
675nghttp2_session_callbacks_set_##name##_callback(callbacks, fn)
682 APLOGNO(02926)
"nghttp2_session_callbacks_new: %s",
696#ifdef H2_NG2_INVALID_HEADER_CB
704 const char *msg,
const h2_stream *stream)
714 ": stream %d, %s %s",
725 session->
c1, session->
s);
762 msg =
"remote close";
796 "sent GOAWAY, err=%d, msg=%s"),
error, msg? msg :
"");
820 "connection disappeared without proper "
821 "goodbye, clients will be confused, should not happen"));
828 "cleanup, resetting %d streams in ready-to-process"),
866 "session cleanup triggered by pool cleanup. "
867 "this should have happened earlier already."));
905#if AP_MODULE_MAGIC_AT_LEAST(20211221, 8)
936 stream0->
c2 = session->
c1;
939 if (!session->
mplx) {
955 "nghttp2: error in init_callbacks");
963 APLOGNO(02928)
"nghttp2_option_new: %s",
972#ifdef H2_NG2_NO_CLOSED_STREAMS
978#ifdef H2_NG2_RFC9113_STRICTNESS
992 APLOGNO(02929)
"nghttp2_session_server_new: %s",
1004 "created, max_streams=%d, stream_mem=%d, "
1005 "workers_limit=%d, workers_max=%d, "
1006 "push_diary(type=%d,N=%d), "
1007 "max_data_frame_len=%d"),
1043 "HTTP2-Settings header missing in request");
1053 "upgrading h2c session with HTTP2-Settings: %s -> %s (%d)",
1061 APLOGNO(02932)
"nghttp2_session_upgrade: %s",
1071 APLOGNO(02933)
"open stream 1: %s",
1092#if H2_USE_WEBSOCKETS
1102 "start, INITIAL_WINDOW_SIZE=%ld, MAX_CONCURRENT_STREAMS=%d"),
1128 "nghttp2_submit_window_update: %s"),
1165 "failed to create stream obj %d"),
nid);
1197 H2_STRM_MSG(stream,
"lookup of nghttp2_stream failed"));
1206 const char *ptype =
"AFTER";
1227 ptype =
"INTERLEAVED";
1247 "PUSH BEFORE, weight=%d, depends=%d, returned=%d"),
1248 ps.weight,
ps.stream_id, rv);
1269 "PUSH %s, weight=%d, depends=%d, returned=%d"),
1270 ptype,
ps.weight,
ps.stream_id, rv);
1294 int ngrv, pending = 0;
1300 "nghttp2_session_send: %d", (
int)
ngrv);
1339 if (stream->
id == 0) {
1358 if (stream->
id != 0) {
1391 "transit [%s] -- %s --> [%s]"),
1501 "conn error -> shutdown"));
1512 "proto error -> shutdown"));
1545#if !AP_MODULE_MAGIC_AT_LEAST(20120211, 110)
1639 switch (stream->
state) {
1787 "started on %s:%d"),
1789 c->local_addr->port);
1876 "returning to mpm c1 monitoring"));
1932 0,
"streams really done");
Apache Multi-Processing Module library.
const char apr_size_t len
APR-UTIL Base64 Encoding.
APR Condition Variable Routines.
apr_uint32_t apr_atomic_inc32(volatile apr_uint32_t *mem)
const char server_rec server_rec ** ps
#define APR_STATUS_IS_ECONNABORTED(s)
#define APR_STATUS_IS_ECONNRESET(s)
#define APR_STATUS_IS_TIMEUP(s)
#define APR_STATUS_IS_EAGAIN(s)
#define APR_STATUS_IS_EPIPE(s)
#define APR_STATUS_IS_EOF(s)
#define APR_BRIGADE_INSERT_TAIL(b, e)
apr_brigade_flush void * ctx
apr_pool_t const char apr_dbd_t const char ** error
const char apr_ssize_t int flags
const char apr_ssize_t slen
apr_uint32_t ap_random_pick(apr_uint32_t min, apr_uint32_t max)
const char int apr_pool_t * pool
void const char apr_status_t(* cleanup)(void *))
apr_vformatter_buff_t * c
apr_sockaddr_t apr_sockaddr_t apr_sockaddr_t * source
#define apr_pool_create(newpool, parent)
#define apr_pcalloc(p, size)
apr_int32_t apr_int32_t apr_int32_t err
#define apr_time_from_msec(msec)
#define apr_time_sec(time)
apr_status_t ap_mpm_query(int query_code, int *result)
#define AP_MPMQ_MPM_STATE
@ H2_DEPENDANT_INTERLEAVED
#define H2_INITIAL_WINDOW_SIZE
#define H2_STREAM_CLIENT_INITIATED(id)
#define H2_HTTP_STATUS_UNSET
apr_bucket * h2_bucket_eos_create(apr_bucket_alloc_t *list, h2_stream *stream)
static struct h2_workers * workers
int h2_c1_io_pending(h2_c1_io *io)
apr_status_t h2_c1_io_pass(h2_c1_io *io)
apr_status_t h2_c1_io_append(h2_c1_io *io, apr_bucket_brigade *bb)
apr_status_t h2_c1_io_add_data(h2_c1_io *io, const char *data, size_t length)
apr_status_t h2_c1_io_init(h2_c1_io *io, h2_session *session)
apr_status_t h2_c1_io_assure_flushed(h2_c1_io *io)
apr_status_t h2_c1_read(h2_session *session)
int h2_c1_io_needs_flush(h2_c1_io *io)
int h2_config_sgeti(server_rec *s, h2_config_var_t var)
@ H2_CONF_MAX_DATA_FRAME_LEN
@ H2_CONF_PUSH_DIARY_SIZE
void h2_conn_ctx_detach(conn_rec *c)
#define h2_conn_ctx_get(c)
int h2_mplx_c1_stream_is_running(h2_mplx *m, h2_stream *stream)
apr_status_t h2_mplx_c1_stream_cleanup(h2_mplx *m, h2_stream *stream, unsigned int *pstream_count)
apr_status_t h2_mplx_c1_client_rst(h2_mplx *m, int stream_id, h2_stream *stream)
apr_status_t h2_mplx_c1_reprioritize(h2_mplx *m, h2_stream_pri_cmp_fn *cmp, h2_session *session)
void h2_mplx_c1_going_keepalive(h2_mplx *m)
int h2_mplx_c1_shutdown(h2_mplx *m)
void h2_mplx_c1_destroy(h2_mplx *m)
h2_mplx * h2_mplx_c1_create(int child_num, apr_uint32_t id, h2_stream *stream0, server_rec *s, apr_pool_t *parent, h2_workers *workers)
int h2_mplx_c1_all_streams_want_send_data(h2_mplx *m)
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)
apr_status_t h2_mplx_c1_streams_do(h2_mplx *m, h2_mplx_stream_cb *cb, void *ctx)
void h2_mplx_c1_process(h2_mplx *m, h2_iqueue *ready_to_process, h2_stream_get_fn *get_stream, h2_stream_pri_cmp_fn *stream_pri_cmp, h2_session *session, unsigned int *pstream_count)
int h2_protocol_is_acceptable_c1(conn_rec *c, request_rec *r, int require_all)
const char * h2_protocol_err_description(unsigned int h2_error)
static int on_stream_close(nghttp2_session *ngh2, int32_t stream_id, uint32_t error_code, void *user_data)
static int on_header(nghttp2_session *ngh2, const nghttp2_frame *frame, const uint8_t *namearg, size_t nlen, const uint8_t *valuearg, size_t vlen, uint8_t flags, void *user_data)
static int on_frame_recv(nghttp2_session *ngh2, const nghttp2_frame *frame, void *user_data)
h2_push_diary * h2_push_diary_create(apr_pool_t *p, int N)
static void on_stream_event(void *ctx, h2_stream *stream, h2_stream_event_t ev)
static void h2_session_ev_ngh2_done(h2_session *session, int arg, const char *msg)
static void cleanup_unprocessed_streams(h2_session *session)
static apr_status_t init_callbacks(conn_rec *c, nghttp2_session_callbacks **pcb)
static int on_frame_send_cb(nghttp2_session *ngh2, const nghttp2_frame *frame, void *user_data)
static void on_stream_output(void *ctx, h2_stream *stream)
int h2_session_push_enabled(h2_session *session)
static apr_status_t h2_session_shutdown_notice(h2_session *session)
static void unblock_c1_out(h2_session *session)
static void on_stream_input(void *ctx, h2_stream *stream)
static apr_uint32_t next_id
static void on_stream_state_event(void *ctx, h2_stream *stream, h2_stream_event_t ev)
static void h2_session_ev_input_exhausted(h2_session *session, int arg, const char *msg)
static apr_status_t session_pool_cleanup(void *data)
void h2_session_event(h2_session *session, h2_session_event_t ev, int err, const char *msg)
static void h2_session_ev_remote_goaway(h2_session *session, int arg, const char *msg)
apr_status_t h2_session_pre_close(h2_session *session, int async)
static apr_status_t h2_session_send(h2_session *session)
static void h2_session_ev_no_more_streams(h2_session *session)
static h2_stream * h2_session_open_stream(h2_session *session, int stream_id, int initiated_on)
static apr_status_t session_cleanup(h2_session *session, const char *trigger)
const char * h2_session_state_str(h2_session_state state)
static int on_send_data_cb(nghttp2_session *ngh2, nghttp2_frame *frame, const uint8_t *framehd, size_t length, nghttp2_data_source *source, void *userp)
static int h2_session_want_send(h2_session *session)
static int on_stream_close_cb(nghttp2_session *ngh2, int32_t stream_id, uint32_t error_code, void *userp)
apr_status_t h2_session_set_prio(h2_session *session, h2_stream *stream, const h2_priority *prio)
static int rst_unprocessed_stream(h2_stream *stream, void *ctx)
static void h2_session_ev_local_goaway(h2_session *session, int arg, const char *msg)
static int on_frame_recv_cb(nghttp2_session *ng2s, const nghttp2_frame *frame, void *userp)
apr_status_t h2_session_process(h2_session *session, int async)
static void update_child_status(h2_session *session, int status, const char *msg, const h2_stream *stream)
static void ev_stream_closed(h2_session *session, h2_stream *stream)
static void h2_session_ev_conn_error(h2_session *session, int arg, const char *msg)
static void h2_session_ev_pre_close(h2_session *session, int arg, const char *msg)
static void transit(h2_session *session, const char *action, h2_session_state nstate)
static int stream_pri_cmp(int sid1, int sid2, void *ctx)
static int h2_session_status_from_apr_status(apr_status_t rv)
static int on_data_chunk_recv_cb(nghttp2_session *ngh2, uint8_t flags, int32_t stream_id, const uint8_t *data, size_t len, void *userp)
static void ev_stream_created(h2_session *session, h2_stream *stream)
static int on_begin_headers_cb(nghttp2_session *ngh2, const nghttp2_frame *frame, void *userp)
apr_status_t h2_session_create(h2_session **psession, conn_rec *c, request_rec *r, server_rec *s, h2_workers *workers)
static const char * StateNames[]
static void h2_session_ev_init(h2_session *session, int arg, const char *msg)
void h2_session_dispatch_event(h2_session *session, h2_session_event_t ev, apr_status_t arg, const char *msg)
static void h2_session_ev_proto_error(h2_session *session, int arg, const char *msg)
static apr_status_t h2_session_shutdown(h2_session *session, int error, const char *msg, int force_close)
static ssize_t select_padding_cb(nghttp2_session *ngh2, const nghttp2_frame *frame, size_t max_payloadlen, void *user_data)
static void on_stream_state_enter(void *ctx, h2_stream *stream)
static void ev_stream_open(h2_session *session, h2_stream *stream)
static h2_stream * get_stream(h2_session *session, int stream_id)
static apr_status_t h2_session_start(h2_session *session, int *rv)
static int spri_cmp(int sid1, nghttp2_stream *s1, int sid2, nghttp2_stream *s2, h2_session *session)
static int valid_weight(float f)
static void h2_session_ev_conn_timeout(h2_session *session, int arg, const char *msg)
static void h2_session_ev_mpm_stopping(h2_session *session, int arg, const char *msg)
static ssize_t send_cb(nghttp2_session *ngh2, const uint8_t *data, size_t length, int flags, void *userp)
static int on_invalid_frame_recv_cb(nghttp2_session *ngh2, const nghttp2_frame *frame, int error, void *userp)
#define NGH2_SET_CALLBACK(callbacks, name, fn)
struct h2_stream * h2_session_push(h2_session *session, h2_stream *is, h2_push *push)
static void h2_session_ev_input_pending(h2_session *session, int arg, const char *msg)
static char immortal_zeros[256]
static int on_header_cb(nghttp2_session *ngh2, const nghttp2_frame *frame, const uint8_t *name, size_t namelen, const uint8_t *value, size_t valuelen, uint8_t flags, void *userp)
#define H2_SSSN_LOG(aplogno, s, msg)
@ H2_SESSION_EV_PRE_CLOSE
@ H2_SESSION_EV_NGH2_DONE
@ H2_SESSION_EV_PROTO_ERROR
@ H2_SESSION_EV_INPUT_EXHAUSTED
@ H2_SESSION_EV_INPUT_PENDING
@ H2_SESSION_EV_MPM_STOPPING
@ H2_SESSION_EV_CONN_TIMEOUT
@ H2_SESSION_EV_LOCAL_GOAWAY
@ H2_SESSION_EV_CONN_ERROR
@ H2_SESSION_EV_NO_MORE_STREAMS
@ H2_SESSION_EV_REMOTE_GOAWAY
#define H2_SSSN_MSG(s, msg)
#define H2_SSSN_STRM_MSG(s, stream_id, msg)
apr_status_t h2_stream_add_header(h2_stream *stream, const char *name, size_t nlen, const char *value, size_t vlen)
apr_status_t h2_stream_set_request_rec(h2_stream *stream, request_rec *r, int eos)
void h2_stream_set_request(h2_stream *stream, const h2_request *r)
h2_stream * h2_stream_create(int id, apr_pool_t *pool, h2_session *session, h2_stream_monitor *monitor, int initiated_on)
apr_status_t h2_stream_recv_DATA(h2_stream *stream, uint8_t flags, const uint8_t *data, size_t len)
apr_status_t h2_stream_send_frame(h2_stream *stream, int ftype, int flags, size_t frame_len)
void h2_stream_on_output_change(h2_stream *stream)
void h2_stream_rst(h2_stream *stream, int error_code)
int h2_stream_is_at_or_past(const h2_stream *stream, h2_stream_state_t state)
void h2_stream_on_input_change(h2_stream *stream)
static int on_frame_send(h2_stream_state_t state, int frame_type)
apr_status_t h2_stream_read_to(h2_stream *stream, apr_bucket_brigade *bb, apr_off_t *plen, int *peos)
apr_status_t h2_stream_recv_frame(h2_stream *stream, int ftype, int flags, size_t frame_len)
#define H2_STRM_MSG(s, msg)
#define H2_STRM_LOG(aplogno, s, msg)
size_t h2_util_hex_dump(char *buffer, size_t maxlen, const char *data, size_t datalen)
h2_iqueue * h2_iq_create(apr_pool_t *pool, int capacity)
int h2_iq_empty(h2_iqueue *q)
int h2_iq_append(h2_iqueue *q, int sid)
int h2_util_frame_print(const nghttp2_frame *frame, char *buffer, size_t maxlen)
apr_status_t h2_req_create_ngheader(h2_ngheader **ph, apr_pool_t *p, const struct h2_request *req)
apr_size_t h2_util_base64url_decode(const char **decoded, const char *encoded, apr_pool_t *pool)
int h2_iq_shift(h2_iqueue *q)
int h2_iq_count(h2_iqueue *q)
static const char * trace
static apr_status_t send_data(proxy_conn_rec *conn, struct iovec *vec, int nvec, apr_size_t *len)
Multi-Processing Modules functions.
Apache scoreboard library.
#define SERVER_BUSY_WRITE
int ap_update_child_status_from_server(ap_sb_handle_t *sbh, int status, conn_rec *c, server_rec *s)
int ap_update_child_status_descr(ap_sb_handle_t *sbh, int status, const char *descr)
Structure to store things which are per connection.
struct apr_bucket_alloc_t * bucket_alloc
apr_uint32_t processing_limit
apr_uint32_t processing_max
h2_push_digest_type dtype
apr_bucket_brigade * bbtmp
unsigned int pushes_submitted
struct h2_workers * workers
struct h2_push_diary * push_diary
unsigned int reprioritize
struct h2_iqueue * out_c1_blocked
apr_size_t frames_received
unsigned int streams_done
apr_size_t max_data_frame_len
apr_size_t max_stream_count
unsigned int pushes_promised
unsigned int open_streams
struct h2_stream_monitor * monitor
const char * last_status_msg
struct h2_iqueue * ready_to_process
apr_size_t max_stream_mem
unsigned int pushes_reset
apr_interval_time_t idle_delay
struct nghttp2_session * ngh2
unsigned int streams_reset
h2_stream_state_cb * on_state_enter
h2_stream_event_cb * on_state_event
h2_stream_event_cb * on_event
int request_headers_failed
apr_off_t out_data_octets
apr_off_t out_data_frames
const struct h2_request * request
struct h2_session * session
A structure that represents the current request.
A structure to store information for each virtual server.
apr_interval_time_t timeout
apr_interval_time_t keep_alive_timeout
typedef int(WSAAPI *apr_winapi_fpt_WSAPoll)(IN OUT LPWSAPOLLFD fdArray