Shane
Another thing i saw in cgi:
len = snprintf(buf, SAPI_CGI_MAX_HEADER_LENGTH,
"%s\r\n",
SG(sapi_headers).http_status_line);
if (len > SAPI_CGI_MAX_HEADER_LENGTH) {
len = SAPI_CGI_MAX_HEADER_LENGTH;
}
The problem here is that the headers could be cut of so that "\r\n" is
lost.
As this is needed i suggest the following patch. Please check it since i am
not sure if it is really correct (the question is length calculation/and
sorry
for not having the time to check myself).
cvs -z3 -q diff cgi_main.c (in directory S:\php4-HEAD\sapi\cgi)
Index: cgi_main.c
===================================================================
RCS file: /repository/php4/sapi/cgi/cgi_main.c,v
retrieving revision 1.198
diff -u -r1.198 cgi_main.c
--- cgi_main.c 26 Nov 2002 05:57:03 -0000 1.198
+++ cgi_main.c 26 Nov 2002 06:12:54 -0000
@@ -238,11 +238,9 @@
}
}
-#define SAPI_CGI_MAX_HEADER_LENGTH 1024
-
static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers
TSRMLS_DC)
{
- char buf[SAPI_CGI_MAX_HEADER_LENGTH];
+ char *buf;
sapi_header_struct *h;
zend_llist_position pos;
long rfc2616_headers = 0;
@@ -260,18 +258,15 @@
int len;
if (rfc2616_headers) {
- len = snprintf(buf, SAPI_CGI_MAX_HEADER_LENGTH,
+ len = spprintf(&buf, 0,
"%s\r\n",
SG(sapi_headers).http_status_line);
- if (len > SAPI_CGI_MAX_HEADER_LENGTH) {
- len = SAPI_CGI_MAX_HEADER_LENGTH;
- }
-
} else {
- len = sprintf(buf, "Status: %d\r\n",
SG(sapi_headers).http_response_code);
+ len = spprintf(&buf, 0, "Status: %d\r\n",
SG(sapi_headers).http_response_code);
}
PHPWRITE_H(buf, len);
+ efree(buf);
}
if (SG(sapi_headers).send_default_content_type) {
*****CVS exited normally with code 1*****
At 06:51 26.11.2002, Shane Caraveo wrote:
> shane Tue Nov 26 00:51:16 2002 EDT
>
> Added files:
> /php4/sapi/cgi/libfcgi/include fcgi_config_win32.h
>
> Modified files:
> /php4 configure.in
> /php4/sapi/cgi README.FastCGI cgi_main.c config9.m4
> /php4/sapi/cgi/libfcgi fcgiapp.c os_unix.c
> /php4/sapi/cgi/libfcgi/include fcgi_config.h fcgios.h
> Log:
> configure now supports building the cgi-fcgi module
> configure --enable-fastcgi
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php