cvs: php-src(PHP_4_3) / NEWS /sapi/isapi php4isapi.c
| From: | Jani Taskinen | Date: | Sun, 17 Apr 2005 03:39:40 +0000 |
| Subject: | cvs: php-src(PHP_4_3) / NEWS /sapi/isapi php4isapi.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-31437@lists.php.net to get a copy of this message | ||
sniper Sat Apr 16 23:39:40 2005 EDT
Modified files: (Branch: PHP_4_3)
/php-src NEWS
/php-src/sapi/isapi php4isapi.c
Log:
MFH: - Fixed bug #31887 (ISAPI: Custom 5xx error does not return correct HTTP response message)
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.879&r2=1.1247.2.880&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.879 php-src/NEWS:1.1247.2.880
--- php-src/NEWS:1.1247.2.879 Sat Apr 16 08:25:36 2005
+++ php-src/NEWS Sat Apr 16 23:39:38 2005
@@ -23,6 +23,8 @@
(Uwe Schindler)
- Fixed bug #32311 (mb_encode_mimeheader() does not properly escape characters).
(Moriyoshi)
+- Fixed bug #31887 (ISAPI: Custom 5xx error does not return correct HTTP
+ response message). (Jani)
- Fixed bug #31583 (php_std_date() uses short day names in non-y2k_compliance mode).
(mike at php dot net)
http://cvs.php.net/diff.php/php-src/sapi/isapi/php4isapi.c?r1=1.92.2.12&r2=1.92.2.13&ty=u
Index: php-src/sapi/isapi/php4isapi.c
diff -u php-src/sapi/isapi/php4isapi.c:1.92.2.12 php-src/sapi/isapi/php4isapi.c:1.92.2.13
--- php-src/sapi/isapi/php4isapi.c:1.92.2.12 Fri Dec 17 22:56:11 2004
+++ php-src/sapi/isapi/php4isapi.c Sat Apr 16 23:39:39 2005
@@ -16,7 +16,7 @@
| Ben Mansell <ben@zeus.com> (Zeus Support) |
+----------------------------------------------------------------------+
*/
-/* $Id: php4isapi.c,v 1.92.2.12 2004/12/18 03:56:11 sniper Exp $ */
+/* $Id: php4isapi.c,v 1.92.2.13 2005/04/17 03:39:39 sniper Exp $ */
#ifdef PHP_WIN32
# include <windows.h>
@@ -57,7 +57,7 @@
#endif
*/
-#define MAX_STATUS_LENGTH sizeof("xxxx LONGEST STATUS DESCRIPTION")
+#define MAX_STATUS_LENGTH sizeof("xxxx LONGEST POSSIBLE STATUS DESCRIPTION")
#define ISAPI_SERVER_VAR_BUF_SIZE 1024
#define ISAPI_POST_DATA_BUF 1024
@@ -245,8 +245,8 @@
char *combined_headers, *combined_headers_ptr;
LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context);
HSE_SEND_HEADER_EX_INFO header_info;
- char status_buf[MAX_STATUS_LENGTH];
sapi_header_struct default_content_type;
+ char *status_buf = NULL;
/* Obtain headers length */
if (SG(sapi_headers).send_default_content_type) {
@@ -277,10 +277,21 @@
case 401:
header_info.pszStatus = "401 Authorization Required";
break;
- default:
- snprintf(status_buf, MAX_STATUS_LENGTH, "%d Undescribed",
SG(sapi_headers).http_response_code);
+ default: {
+ const char *sline = SG(sapi_headers).http_status_line;
+
+ status_buf = emalloc(MAX_STATUS_LENGTH + 1);
+
+ /* 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] == ' ') {
+ status_buf = estrndup(sline + 9, MAX_STATUS_LENGTH);
+ } else {
+ snprintf(status_buf, MAX_STATUS_LENGTH, "%d Undescribed",
SG(sapi_headers).http_response_code);
+ }
header_info.pszStatus = status_buf;
break;
+ }
}
header_info.cchStatus = strlen(header_info.pszStatus);
header_info.pszHeader = combined_headers;
@@ -291,6 +302,9 @@
lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX,
&header_info, NULL, NULL);
efree(combined_headers);
+ if (status_buf) {
+ efree(status_buf);
+ }
return SAPI_HEADER_SENT_SUCCESSFULLY;
}
@@ -306,7 +320,6 @@
}
-
static int sapi_isapi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
{
LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context);