From 2556aa7b2aa91eca439bfe2e704251a42b778101 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 2 Aug 2003 18:30:22 +0000 Subject: [PATCH] MFH: Fixed bug #24177 (Status not set correctly after flush() in Apache 2) --- NEWS | 1 + sapi/apache2filter/sapi_apache2.c | 4 +++- sapi/apache2handler/sapi_apache2.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 8ded101e50..e10117d94d 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP 4 NEWS ?? Aug 2003, Version 4.3.3RC3 - Fixed bug #24883 (variables_order and gpc_order being ignored). (Ilia) - Fixed bug #24871 (methods misidentified as constructors). (Ilia) +- Fixed bug #24177 (Status not set correctly after flush() in Apache 2). (Ilia) - Fixed bug #23509 (exit code lost when exit() called from register_shutdown_function()). (Ilia) - Fixed bug #22154 (Possible crash when memory_limit is reached and diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c index 66fd5700bc..0df31c78b9 100644 --- a/sapi/apache2filter/sapi_apache2.c +++ b/sapi/apache2filter/sapi_apache2.c @@ -236,7 +236,9 @@ php_apache_sapi_flush(void *server_context) * then don't bother flushing. */ if (!server_context) return; - + + ctx->r->status = SG(sapi_headers).http_response_code; + f = ctx->f; /* Send a flush bucket down the filter chain. The current default diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 1494a2f407..28ff1e3be6 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -260,6 +260,8 @@ php_apache_sapi_flush(void *server_context) r = ctx->r; brigade = ctx->brigade; + r->status = SG(sapi_headers).http_response_code; + /* Send a flush bucket down the filter chain. */ bucket = apr_bucket_flush_create(r->connection->bucket_alloc); APR_BRIGADE_INSERT_TAIL(brigade, bucket); -- 2.40.0