| 356 | } while(0) |
| 357 | |
| 358 | AP_DECLARE(void) ap_process_request_after_handler(request_rec *r) |
| 359 | { |
| 360 | apr_bucket_brigade *bb; |
| 361 | apr_bucket *b; |
| 362 | conn_rec *c = r->connection; |
| 363 | apr_status_t rv; |
| 364 | |
| 365 | /* Send an EOR bucket through the output filter chain. When |
| 366 | * this bucket is destroyed, the request will be logged and |
| 367 | * its pool will be freed |
| 368 | */ |
| 369 | RETRIEVE_BRIGADE_FROM_POOL(bb, "ap_process_request_after_handler_brigade", |
| 370 | c->pool, c->bucket_alloc); |
| 371 | b = ap_bucket_eor_create(c->bucket_alloc, r); |
| 372 | APR_BRIGADE_INSERT_HEAD(bb, b); |
| 373 | |
| 374 | ap_pass_brigade(c->output_filters, bb); |
| 375 | |
| 376 | /* The EOR bucket has either been handled by an output filter (eg. |
| 377 | * deleted or moved to a buffered_bb => no more in bb), or an error |
| 378 | * occured before that (eg. c->aborted => still in bb) and we ought |
| 379 | * to destroy it now. So cleanup any remaining bucket along with |
| 380 | * the orphan request (if any). |
| 381 | */ |
| 382 | apr_brigade_cleanup(bb); |
| 383 | |
| 384 | /* From here onward, it is no longer safe to reference r |
| 385 | * or r->pool, because r->pool may have been destroyed |
| 386 | * already by the EOR bucket's cleanup function. |
| 387 | */ |
| 388 | |
| 389 | /* Check pipeline consuming blank lines, they must not be interpreted as |
| 390 | * the next pipelined request, otherwise we would block on the next read |
| 391 | * without flushing data, and hence possibly delay pending response(s) |
| 392 | * until the next/real request comes in or the keepalive timeout expires. |
| 393 | */ |
| 394 | rv = ap_check_pipeline(c, bb, DEFAULT_LIMIT_BLANK_LINES); |
| 395 | c->data_in_input_filters = (rv == APR_SUCCESS); |
| 396 | apr_brigade_cleanup(bb); |
| 397 | |
| 398 | if (c->cs) |
| 399 | c->cs->state = (c->aborted) ? CONN_STATE_LINGER |
| 400 | : CONN_STATE_WRITE_COMPLETION; |
| 401 | AP_PROCESS_REQUEST_RETURN((uintptr_t)r, r->uri, r->status); |
| 402 | if (ap_extended_status) { |
| 403 | ap_time_process_request(c->sbh, STOP_PREQUEST); |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | void ap_process_async_request(request_rec *r) |
| 408 | { |