*) event: Add support for non blocking behaviour in the
CONN_STATE_READ_REQUEST_LINE phase, in addition to the existing
- CONN_STATE_WRITE_COMPLETION phase. Update mod_ssl to perform non blocking
- TLS handshakes. [Graham Leggett]
+ CONN_STATE_WRITE_COMPLETION phase. Add AP_MPM_CAN_AGAIN and AGAIN to
+ signal to the MPM that non blocking behaviour is requested. Update
+ mod_ssl to perform non blocking TLS handshakes. [Graham Leggett]
*) http: Enforce that fully qualified uri-paths not to be forward-proxied
have an http(s) scheme, and that the ones to be forward proxied have a
* 20211221.0 (2.5.1-dev) Bump PROXY_WORKER_MAX_NAME_SIZE from 256 to 384,
* add PROXY_WORKER_UDS_PATH_SIZE.
* 20211221.1 (2.5.1-dev) Add read_line to scoreboard.
+ * 20211221.2 (2.5.1-dev) Add AGAIN, AP_MPMQ_CAN_AGAIN.
*
*/
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20211221
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 2 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
#define AP_MPMQ_CAN_SUSPEND 17
/** MPM supports additional pollfds */
#define AP_MPMQ_CAN_POLL 18
+/** MPM reacts to AGAIN response */
+#define AP_MPMQ_CAN_AGAIN 19
/** @} */
/**
*/
#define SUSPENDED -3 /**< Module will handle the remainder of the request.
* The core will never invoke the request again, */
+#define AGAIN -4 /**< Module wants to be called again when
+ * more data is availble.
+ */
/** Returned by the bottom-most filter if no data was written.
* @see ap_pass_brigade(). */
*/
apr_bucket_brigade* temp;
- int async_mpm = 0;
+ int again_mpm = 0;
temp = apr_brigade_create(c->pool, c->bucket_alloc);
- if (ap_mpm_query(AP_MPMQ_IS_ASYNC, &async_mpm) != APR_SUCCESS) {
- async_mpm = 0;
+ if (ap_mpm_query(AP_MPMQ_CAN_AGAIN, &again_mpm) != APR_SUCCESS) {
+ again_mpm = 0;
}
- if (async_mpm) {
+ if (again_mpm) {
/* Take advantage of an async MPM. If we see an EAGAIN,
* loop round and don't block.
ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, c, APLOGNO(10371)
"SSL handshake in progress, continuing");
- status = OK;
+ status = AGAIN;
}
else if (rv == AP_FILTER_ERROR) {
/* handshake error, but mod_ssl handled it */
case AP_MPMQ_CAN_POLL:
*result = 1;
break;
+ case AP_MPMQ_CAN_AGAIN:
+ *result = 1;
+ break;
default:
*rv = APR_ENOTIMPL;
break;
/*
* The process_connection hooks above should set the connection state
* appropriately upon return, for event MPM to either:
+ * - call the hooks again after waiting for a read or write, or react to an
+ * overridden CONN_SENSE_WANT_READ / CONN_SENSE_WANT_WRITE.
* - do lingering close (CONN_STATE_LINGER),
* - wait for readability of the next request with respect to the keepalive
* timeout (state CONN_STATE_CHECK_REQUEST_LINE_READABLE),
* while this was expected to do lingering close unconditionally with
* worker or prefork MPMs for instance.
*/
- if (rc != OK || (cs->pub.state >= CONN_STATE_NUM)
+ if (rc != AGAIN && (
+ rc != OK || (cs->pub.state >= CONN_STATE_NUM)
|| (cs->pub.state < CONN_STATE_LINGER
- && cs->pub.state != CONN_STATE_READ_REQUEST_LINE
&& cs->pub.state != CONN_STATE_WRITE_COMPLETION
&& cs->pub.state != CONN_STATE_CHECK_REQUEST_LINE_READABLE
- && cs->pub.state != CONN_STATE_SUSPENDED)) {
+ && cs->pub.state != CONN_STATE_SUSPENDED))) {
ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, c, APLOGNO(10111)
"process_socket: connection processing %s: closing",
rc ? apr_psprintf(c->pool, "returned error %i", rc)