/* Licensed to the Apache Software Foundation (ASF) under one or more *contributorlicenseagreements.SeetheNOTICEfiledistributedwith *thisworkforadditionalinformationregardingcopyrightownership. *TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0 *(the"License");youmaynotusethisfileexceptincompliancewith *theLicense.YoumayobtainacopyoftheLicenseat * *http://www.apache.org/licenses/LICENSE-2.0 * *Unlessrequiredbyapplicablelaworagreedtoinwriting,software *distributedundertheLicenseisdistributedonan"ASIS"BASIS, *WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied. *SeetheLicenseforthespecificlanguagegoverningpermissionsand *limitationsundertheLicense.
*/
if (ap_mpm_query(AP_MPMQ_IS_ASYNC, &async_mpm)) { /* some MPMs do not implemnent this */
async_mpm = 0;
} #ifdef AP_MPMQ_CAN_WAITIO if (!async_mpm || ap_mpm_query(AP_MPMQ_CAN_WAITIO, &mpm_can_waitio)) {
mpm_can_waitio = 0;
} #endif
ctx = h2_conn_ctx_get(c);
ap_assert(ctx);
h2_conn_ctx_assign_session(ctx, session); /* remove the input filter of mod_reqtimeout, now that the connection *isestablishedandwehaveswitchedtoh2.reqtimeouthassupervised *possiblyconfiguredhandshaketimeoutsandneedstogetoutoftheway
* now since the rest of its state handling assumes http/1.x to take place. */
ap_remove_input_filter_byhandle(c->input_filters, "reqtimeout");
cleanup: return rv;
}
int h2_c1_run(conn_rec *c)
{
apr_status_t status; int mpm_state = 0, keepalive = 0;
h2_conn_ctx_t *conn_ctx = h2_conn_ctx_get(c);
ap_assert(conn_ctx);
ap_assert(conn_ctx->session);
c->clogging_input_filters = 0; do { if (c->cs) {
c->cs->state = CONN_STATE_HANDLER;
}
if (ap_mpm_query(AP_MPMQ_MPM_STATE, &mpm_state)) { break;
}
} while (!async_mpm
&& c->keepalive == AP_CONN_KEEPALIVE
&& mpm_state != AP_MPMQ_STOPPING);
if (c->cs) { switch (conn_ctx->session->state) { case H2_SESSION_ST_INIT: case H2_SESSION_ST_IDLE: case H2_SESSION_ST_BUSY: case H2_SESSION_ST_WAIT: if (keepalive) { /* Flush then keep-alive */
c->cs->sense = CONN_SENSE_DEFAULT;
c->cs->state = CONN_STATE_WRITE_COMPLETION;
} else { /* Let the MPM know that we are not done and want to wait *forreadusingTimeoutinsteadofKeepAliveTimeout. *SeePR63534.
*/
c->cs->sense = CONN_SENSE_WANT_READ; #ifdef AP_MPMQ_CAN_WAITIO if (mpm_can_waitio) { /* This tells the MPM to wait for the connection to be *readable(CONN_SENSE_WANT_READ)withintheconfigured *Timeoutandthencomebacktotheprocess_connection() *hooksagainwhenready.
*/
c->cs->state = CONN_STATE_ASYNC_WAITIO;
} else #endif
{ /* This is a compat workaround to do the same using the *CONN_STATE_WRITE_COMPLETIONstatebutwithboth *CONN_SENSE_WANT_READtowaitforreadabilityrather *thanwritingandc->clogging_input_filterstoforce *reenteringtheprocess_connection()hooksfromany *statewhenready.ThissomehowwilluseTimeouttoo.
*/
c->cs->state = CONN_STATE_WRITE_COMPLETION;
c->clogging_input_filters = 1;
}
} break;
case H2_SESSION_ST_CLEANUP: case H2_SESSION_ST_DONE: default:
c->cs->state = CONN_STATE_LINGER; break;
}
}
/* secondary connection? */ if (c->master) { return DECLINED;
}
ctx = h2_conn_ctx_get(c); if (ctx) { /* If the session has been closed correctly already, we will not *findah2_conn_ctx_there.Thepresenceindicatesthatthesession
* is still ongoing. */ return h2_c1_pre_close(ctx, c);
} return DECLINED;
}
void h2_c1_register_hooks(void)
{ /* Our main processing needs to run quite late. Definitely after mod_ssl, *asweneeditsconnectionfilters,butalsobeforereqtimeoutasits *methodoftimeoutsisspecifictoHTTP/1.1(asofnow). *ThecoreHTTP/1processingrunasREALLY_LAST,sowewillhave *achancetotakeoverbeforeit.
*/
ap_hook_process_connection(h2_c1_hook_process_connection,
mod_reqtimeout, NULL, APR_HOOK_LAST);
/* One last chance to properly say goodbye if we have not done so
* already. */
ap_hook_pre_close_connection(h2_c1_hook_pre_close, NULL, mod_ssl, APR_HOOK_LAST);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-09-27)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.