Re: cvs: php4 / configure.in /sapi/cgi README.FastCGI cgi_main.c config9.m4 /sapi/cgi/libfcgi fcgiapp.c os_unix.c /sapi/cgi/libfcgi/include
fcgi_config.h fcgi_config_win32.h fcgios.h
| From: | (Marcus Börger) | Date: | Tue, 26 Nov 2002 06:20:28 +0000 |
| Subject: | Re: cvs: php4 / configure.in /sapi/cgi README.FastCGI cgi_main.c config9.m4 /sapi/cgi/libfcgi fcgiapp.c os_unix.c /sapi/cgi/libfcgi/include fcgi_config.h fcgi_config_win32.h fcgios.h |
||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-16654@lists.php.net to get a copy of this message | ||
You have to check the test files. Some of them check for sapi name cgi.
Now we have another name "cgi-fcgi". But you will have to verify that all
those tests can be done by cgi-fgi as well.
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 EDTAdded files:/php4/sapi/cgi/libfcgi/include fcgi_config_win32.hModified 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.hLog: 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