They were superseded by ap_filter_should_yield() and ap_run_in/output_pending()
in r1706669 and had poor semantics since then (we can't maintain pending
semantics both by filter and for the whole connection).
Register ap_filter_input_pending() as the default input_pending hook (which
seems to have been forgotten in the first place).
On the MPM event side, we don't need to flush pending output data when the
connection has just been processed, ap_filter_should_yield() is lightweight and
enough to determine whether we should really enter write completion state or go
straight to reading. ap_run_output_pending() is used only when write completion
is in place and needs to be completed before more processing.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@
1836364 13f79535-47bb-0310-9956-
ffa450edef68
* 20180716.2 (2.5.1-dev) Add read_buf_size member to core_dir_config,
* flush_max_threshold and flush_max_pipelined to
* core_server_config, and ap_get_read_buf_size().
+ * 20180720.1 (2.5.1-dev) Axe data_in_{in,out}put_filter from conn_rec.
*/
#define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
-#define MODULE_MAGIC_NUMBER_MAJOR 20180716
+#define MODULE_MAGIC_NUMBER_MAJOR 20180720
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 2 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
struct apr_bucket_alloc_t *bucket_alloc;
/** The current state of this connection; may be NULL if not used by MPM */
conn_state_t *cs;
- /** Used internally to force ap_filter_input_pending() decision,
- * the public interface is ap_filter_should_yield(c->input_filters)
- * or ap_filter_input_pending().
- */
- int data_in_input_filters;
- /** Used internally to force ap_filter_output_pending() decision,
- * the public interface is ap_filter_should_yield(c->output_filters)
- * or ap_filter_output_pending().
- */
- int data_in_output_filters;
/** Are there any filters that clogg/buffer the input stream, breaking
* the event mpm.
apr_bucket_brigade *bb;
apr_bucket *b;
conn_rec *c = r->connection;
- apr_status_t rv;
ap_filter_t *f;
/* Send an EOR bucket through the output filter chain. When
* without flushing data, and hence possibly delay pending response(s)
* until the next/real request comes in or the keepalive timeout expires.
*/
- rv = ap_check_pipeline(c, bb, DEFAULT_LIMIT_BLANK_LINES);
- c->data_in_input_filters = (rv == APR_SUCCESS);
+ (void)ap_check_pipeline(c, bb, DEFAULT_LIMIT_BLANK_LINES);
apr_brigade_cleanup(bb);
if (c->cs) {
* to not try another useless/stressful one but to go straight to
* POLLOUT.
*/
- c->data_in_output_filters = ap_filter_should_yield(c->output_filters);
c->cs->state = CONN_STATE_WRITE_COMPLETION;
}
}
c->input_filters = NULL;
c->output_filters = NULL;
c->bucket_alloc = apr_bucket_alloc_create(pool);
- c->data_in_input_filters = 0;
- c->data_in_output_filters = 0;
/* prevent mpm_event from making wrong assumptions about this connection,
* like e.g. using its socket for an async read check. */
c->clogging_input_filters = 1;
ap_hook_open_htaccess(ap_open_htaccess, NULL, NULL, APR_HOOK_REALLY_LAST);
ap_hook_optional_fn_retrieve(core_optional_fn_retrieve, NULL, NULL,
APR_HOOK_MIDDLE);
+
+ ap_hook_input_pending(ap_filter_input_pending, NULL, NULL,
+ APR_HOOK_MIDDLE);
ap_hook_output_pending(ap_filter_output_pending, NULL, NULL,
- APR_HOOK_MIDDLE);
+ APR_HOOK_MIDDLE);
/* register the core's insert_filter hook and register core-provided
* filters
{
conn_rec *c;
long conn_id = ID_FROM_CHILD_THREAD(my_child_num, my_thread_num);
- int clogging = 0;
+ int clogging = 0, from_wc_q = 0;
apr_status_t rv;
int rc = OK;
rc = OK;
}
}
+ else if (cs->pub.state == CONN_STATE_WRITE_COMPLETION) {
+ from_wc_q = 1;
+ }
}
/*
* The process_connection hooks above should set the connection state
}
if (cs->pub.state == CONN_STATE_WRITE_COMPLETION) {
- int pending;
+ int pending = DECLINED;
ap_update_child_status(cs->sbh, SERVER_BUSY_WRITE, NULL);
- pending = ap_run_output_pending(c);
+ if (from_wc_q) {
+ from_wc_q = 0; /* one shot */
+ pending = ap_run_output_pending(c);
+ }
+ else if (ap_filter_should_yield(c->output_filters)) {
+ pending = OK;
+ }
if (pending == OK) {
/* Still in WRITE_COMPLETION_STATE:
* Set a write timeout for this connection, and let the
apr_bucket_brigade *bb;
ap_filter_t *f;
- if (c->data_in_output_filters) {
- return OK;
- }
-
if (!c->pending_filters) {
return DECLINED;
}
{
ap_filter_t *f;
- if (c->data_in_input_filters) {
- return OK;
- }
-
if (!c->pending_filters) {
return DECLINED;
}