summaryrefslogtreecommitdiff
path: root/sapi/apache2handler/sapi_apache2.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-02-09 23:27:43 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-02-09 23:27:43 +0000
commit67dd730546618dd99ebd48ebf2f10da493a90756 (patch)
treed78cf68475a04255668ad32132fe22783da70d3f /sapi/apache2handler/sapi_apache2.c
parent1b6b63c3f954bfbc296a982bad14cd47dc1261ab (diff)
downloadphp-git-67dd730546618dd99ebd48ebf2f10da493a90756.tar.gz
Fixed bug #27196 (Missing content_length initialization in apache 2 sapis).
Diffstat (limited to 'sapi/apache2handler/sapi_apache2.c')
-rw-r--r--sapi/apache2handler/sapi_apache2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index e00687f9cb..e6faeb20b5 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -409,6 +409,7 @@ static apr_status_t php_server_context_cleanup(void *data_)
static void php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
{
char *content_type;
+ char *content_length;
const char *auth;
SG(sapi_headers).http_response_code = !r->status ? HTTP_OK : r->status;
@@ -423,6 +424,9 @@ static void php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
ap_set_content_type(r, apr_pstrdup(r->pool, content_type));
efree(content_type);
+ content_length = (char *) apr_table_get(f->r->headers_in, "Content-Length");
+ SG(request_info).content_length = (content_length ? atoi(content_length) : 0);
+
apr_table_unset(r->headers_out, "Content-Length");
apr_table_unset(r->headers_out, "Last-Modified");
apr_table_unset(r->headers_out, "Expires");