cvs: php-src(PHP_4_3) /sapi/apache2handler sapi_apache2.c

From: Date: Mon, 17 Jan 2005 12:36:44 +0000
Subject: cvs: php-src(PHP_4_3) /sapi/apache2handler sapi_apache2.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-29919@lists.php.net to get a copy of this message
jorton Mon Jan 17 07:36:44 2005 EDT Modified files: (Branch: PHP_4_3) /php-src/sapi/apache2handler sapi_apache2.c Log: MFH - Fixed bug #31519: Set r->status_line to SAPI-provided status-line. http://cvs.php.net/diff.php/php-src/sapi/apache2handler/sapi_apache2.c?r1=1.1.2.37&r2=1.1.2.38&ty=u Index: php-src/sapi/apache2handler/sapi_apache2.c diff -u php-src/sapi/apache2handler/sapi_apache2.c:1.1.2.37 php-src/sapi/apache2handler/sapi_apache2.c:1.1.2.38 --- php-src/sapi/apache2handler/sapi_apache2.c:1.1.2.37 Thu Dec 16 07:36:43 2004 +++ php-src/sapi/apache2handler/sapi_apache2.c Mon Jan 17 07:36:44 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sapi_apache2.c,v 1.1.2.37 2004/12/16 12:36:43 sniper Exp $ */ +/* $Id: sapi_apache2.c,v 1.1.2.38 2005/01/17 12:36:44 jorton Exp $ */ #include <fcntl.h> @@ -119,9 +119,17 @@ php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) { php_struct *ctx = SG(server_context); + const char *sline = SG(sapi_headers).http_status_line; ctx->r->status = SG(sapi_headers).http_response_code; + /* httpd requires that r->status_line is set to the first digit of + * the status-code: */ + if (sline && strlen(sline) > 12 && strncmp(sline, "HTTP/1.", 7) == 0 + && sline[8] == ' ') { + ctx->r->status_line = apr_pstrdup(ctx->r->pool, sline + 9); + } + return SAPI_HEADER_SENT_SUCCESSFULLY; }

« previous php.cvs (#29919) next »