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;
- /** No longer used, replaced with ap_filter_input_pending() */
+ /** Is there data pending in the input filters or connection? */
int data_in_input_filters;
/** No longer used, replaced with ap_filter_should_yield() */
int data_in_output_filters;
apr_size_t cr = 0;
char buf[2];
+ c->data_in_input_filters = 0;
while (c->keepalive != AP_CONN_CLOSE && !c->aborted) {
apr_size_t len = cr + 1;
* where this possible failure comes from (metadata,
* morphed EOF socket => empty bucket? debug only here).
*/
+ c->data_in_input_filters = 1;
log_level = APLOG_DEBUG;
}
ap_log_cerror(APLOG_MARK, log_level, rv, c, APLOGNO(02968)
num_blank_lines--;
}
else {
+ c->data_in_input_filters = 1;
break;
}
}
cr = 1;
}
else {
+ c->data_in_input_filters = 1;
break;
}
}
ap_process_async_request(r);
- if (ap_run_input_pending(c) != OK) {
+ if (!c->data_in_input_filters || ap_run_input_pending(c) != OK) {
bb = apr_brigade_create(c->pool, c->bucket_alloc);
b = apr_bucket_flush_create(c->bucket_alloc);
APR_BRIGADE_INSERT_HEAD(bb, b);
listener_may_exit) {
cs->pub.state = CONN_STATE_LINGER;
}
- else if (ap_run_input_pending(c) == OK) {
+ else if (c->data_in_input_filters || ap_run_input_pending(c) == OK) {
cs->pub.state = CONN_STATE_READ_REQUEST_LINE;
goto read_request;
}
else if (c->keepalive != AP_CONN_KEEPALIVE || c->aborted) {
scon->cs.state = CONN_STATE_LINGER;
}
- else if (ap_run_input_pending(c) == OK) {
+ else if (c->data_in_input_filters || ap_run_input_pending(c) == OK) {
scon->cs.state = CONN_STATE_READ_REQUEST_LINE;
goto read_request;
}
else if (c->keepalive != AP_CONN_KEEPALIVE || c->aborted) {
scon->cs.state = CONN_STATE_LINGER;
}
- else if (ap_run_input_pending(c) == OK) {
+ else if (c->data_in_input_filters || ap_run_input_pending(c) == OK) {
scon->cs.state = CONN_STATE_READ_REQUEST_LINE;
}
else {
pool = f->r ? f->r->pool : f->c->pool;
- key = apr_palloc(pool, sizeof(ap_filter_t **));
- *key = f;
- apr_hash_set(f->c->filters, key, sizeof(ap_filter_t **), f);
+ key = apr_pmemdup(pool, &f, sizeof f);
+ apr_hash_set(f->c->filters, key, sizeof key, f);
f->bb = apr_brigade_create(pool, f->c->bucket_alloc);