iliaa           Mon Feb  9 18:27:44 2004 EDT

  Modified files:              
    /php-src/sapi/apache2handler        sapi_apache2.c 
    /php-src/sapi/apache2filter sapi_apache2.c 
  Log:
  Fixed bug #27196 (Missing content_length initialization in apache 2 sapis).
  
  
http://cvs.php.net/diff.php/php-src/sapi/apache2handler/sapi_apache2.c?r1=1.34&r2=1.35&ty=u
Index: php-src/sapi/apache2handler/sapi_apache2.c
diff -u php-src/sapi/apache2handler/sapi_apache2.c:1.34 
php-src/sapi/apache2handler/sapi_apache2.c:1.35
--- php-src/sapi/apache2handler/sapi_apache2.c:1.34     Thu Jan 29 10:18:26 2004
+++ php-src/sapi/apache2handler/sapi_apache2.c  Mon Feb  9 18:27:42 2004
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: sapi_apache2.c,v 1.34 2004/01/29 15:18:26 iliaa Exp $ */
+/* $Id: sapi_apache2.c,v 1.35 2004/02/09 23:27:42 iliaa Exp $ */
 
 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
@@ -409,6 +409,7 @@
 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 @@
        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");
http://cvs.php.net/diff.php/php-src/sapi/apache2filter/sapi_apache2.c?r1=1.122&r2=1.123&ty=u
Index: php-src/sapi/apache2filter/sapi_apache2.c
diff -u php-src/sapi/apache2filter/sapi_apache2.c:1.122 
php-src/sapi/apache2filter/sapi_apache2.c:1.123
--- php-src/sapi/apache2filter/sapi_apache2.c:1.122     Thu Jan 29 10:18:25 2004
+++ php-src/sapi/apache2filter/sapi_apache2.c   Mon Feb  9 18:27:43 2004
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: sapi_apache2.c,v 1.122 2004/01/29 15:18:25 iliaa Exp $ */
+/* $Id: sapi_apache2.c,v 1.123 2004/02/09 23:27:43 iliaa Exp $ */
 
 #include <fcntl.h>
 
@@ -376,6 +376,7 @@
 static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC)
 {
        char *content_type;
+       char *content_length;
        const char *auth;
 
        PG(during_request_startup) = 0;
@@ -394,6 +395,10 @@
        SG(request_info).post_data_length = ctx->post_len;
 
        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(f->r->headers_out, "Content-Length");
        apr_table_unset(f->r->headers_out, "Last-Modified");
        apr_table_unset(f->r->headers_out, "Expires");

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to