[PHP-CVS] cvs: php-src(PHP_5_1) /sapi/cgi fastcgi.c fastcgi.h
dmitry Wed May 3 15:39:16 2006 UTC Modified files: (Branch: PHP_5_1) /php-src/sapi/cgi fastcgi.c fastcgi.h Log: Fixed bug #37205 (incompatibility with mod_fastcgi) http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/fastcgi.c?r1=1.4.2.11r2=1.4.2.12diff_format=u Index: php-src/sapi/cgi/fastcgi.c diff -u php-src/sapi/cgi/fastcgi.c:1.4.2.11 php-src/sapi/cgi/fastcgi.c:1.4.2.12 --- php-src/sapi/cgi/fastcgi.c:1.4.2.11 Wed May 3 13:19:57 2006 +++ php-src/sapi/cgi/fastcgi.c Wed May 3 15:39:16 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: fastcgi.c,v 1.4.2.11 2006/05/03 13:19:57 dmitry Exp $ */ +/* $Id: fastcgi.c,v 1.4.2.12 2006/05/03 15:39:16 dmitry Exp $ */ #include fastcgi.h #include php.h @@ -441,7 +441,6 @@ unsigned char buf[FCGI_MAX_LENGTH+8]; req-keep = 0; - req-has_in = 0; req-in_len = 0; req-out_hdr = NULL; req-out_pos = req-out_buf; @@ -510,19 +509,6 @@ len = (hdr.contentLengthB1 8) | hdr.contentLengthB0; padding = hdr.paddingLength; } -#ifdef _WIN32 - req-has_in = 1; -#else - if (safe_read(req, hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) || - hdr.version FCGI_VERSION_1 || - hdr.type != FCGI_STDIN) { - req-keep = 0; - return 0; - } - req-in_len = (hdr.contentLengthB1 8) | hdr.contentLengthB0; - req-in_pad = hdr.paddingLength; - req-has_in = (req-in_len != 0); -#endif } else if (hdr.type == FCGI_GET_VALUES) { int i, j; int name_len; @@ -565,9 +551,6 @@ fcgi_header hdr; unsigned char buf[8]; - if (!req-has_in) { - return 0; - } n = 0; rest = len; while (rest 0) { @@ -635,6 +618,10 @@ RevertToSelf(); } #else + char buf[8]; + + shutdown(req-fd, 1); + while (recv(req-fd, buf, sizeof(buf), 0) 0) {} close(req-fd); #endif req-fd = -1; http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/fastcgi.h?r1=1.2.2.3r2=1.2.2.4diff_format=u Index: php-src/sapi/cgi/fastcgi.h diff -u php-src/sapi/cgi/fastcgi.h:1.2.2.3 php-src/sapi/cgi/fastcgi.h:1.2.2.4 --- php-src/sapi/cgi/fastcgi.h:1.2.2.3 Thu Apr 27 11:39:32 2006 +++ php-src/sapi/cgi/fastcgi.h Wed May 3 15:39:16 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: fastcgi.h,v 1.2.2.3 2006/04/27 11:39:32 dmitry Exp $ */ +/* $Id: fastcgi.h,v 1.2.2.4 2006/05/03 15:39:16 dmitry Exp $ */ /* FastCGI protocol */ @@ -97,7 +97,6 @@ intid; intkeep; - inthas_in; intin_len; intin_pad; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_1) /sapi/cgi fastcgi.c fastcgi.h
Dmitry, So we need to re-tag with this patch? On 27-Apr-06, at 7:39 AM, Dmitry Stogov wrote: dmitry Thu Apr 27 11:39:32 2006 UTC Modified files: (Branch: PHP_5_1) /php-src/sapi/cgi fastcgi.c fastcgi.h Log: Proper fix for bug #37205 http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/fastcgi.c? r1=1.4.2.9r2=1.4.2.10diff_format=u Index: php-src/sapi/cgi/fastcgi.c diff -u php-src/sapi/cgi/fastcgi.c:1.4.2.9 php-src/sapi/cgi/ fastcgi.c:1.4.2.10 --- php-src/sapi/cgi/fastcgi.c:1.4.2.9 Wed Apr 26 17:48:27 2006 +++ php-src/sapi/cgi/fastcgi.c Thu Apr 27 11:39:32 2006 @@ -16,7 +16,7 @@ +- -+ */ -/* $Id: fastcgi.c,v 1.4.2.9 2006/04/26 17:48:27 dmitry Exp $ */ +/* $Id: fastcgi.c,v 1.4.2.10 2006/04/27 11:39:32 dmitry Exp $ */ #include fastcgi.h #include php.h @@ -441,6 +441,7 @@ unsigned char buf[FCGI_MAX_LENGTH+8]; req-keep = 0; + req-has_in = 0; req-in_len = 0; req-out_hdr = NULL; req-out_pos = req-out_buf; @@ -509,6 +510,15 @@ len = (hdr.contentLengthB1 8) | hdr.contentLengthB0; padding = hdr.paddingLength; } + if (safe_read(req, hdr, sizeof(fcgi_header)) != sizeof (fcgi_header) || + hdr.version FCGI_VERSION_1 || + hdr.type != FCGI_STDIN) { + req-keep = 0; + return 0; + } + req-in_len = (hdr.contentLengthB1 8) | hdr.contentLengthB0; + req-in_pad = hdr.paddingLength; + req-has_in = (req-in_len != 0); } else if (hdr.type == FCGI_GET_VALUES) { int i, j; int name_len; @@ -551,6 +561,9 @@ fcgi_header hdr; unsigned char buf[8]; + if (!req-has_in) { + return 0; + } n = 0; rest = len; while (rest 0) { http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/fastcgi.h? r1=1.2.2.2r2=1.2.2.3diff_format=u Index: php-src/sapi/cgi/fastcgi.h diff -u php-src/sapi/cgi/fastcgi.h:1.2.2.2 php-src/sapi/cgi/ fastcgi.h:1.2.2.3 --- php-src/sapi/cgi/fastcgi.h:1.2.2.2 Thu Feb 2 08:17:23 2006 +++ php-src/sapi/cgi/fastcgi.h Thu Apr 27 11:39:32 2006 @@ -16,7 +16,7 @@ +- -+ */ -/* $Id: fastcgi.h,v 1.2.2.2 2006/02/02 08:17:23 dmitry Exp $ */ +/* $Id: fastcgi.h,v 1.2.2.3 2006/04/27 11:39:32 dmitry Exp $ */ /* FastCGI protocol */ @@ -97,6 +97,7 @@ intid; intkeep; + inthas_in; intin_len; intin_pad; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Ilia Alshanetsky Advanced Internet Designs Inc. [EMAIL PROTECTED] -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-CVS] cvs: php-src(PHP_5_1) /sapi/cgi fastcgi.c fastcgi.h
YES. -Original Message- From: Ilia Alshanetsky [mailto:[EMAIL PROTECTED] On Behalf Of Ilia Alshanetsky Sent: Friday, April 28, 2006 5:41 PM To: Dmitry Stogov Cc: php-cvs@lists.php.net Subject: Re: [PHP-CVS] cvs: php-src(PHP_5_1) /sapi/cgi fastcgi.c fastcgi.h Dmitry, So we need to re-tag with this patch? On 27-Apr-06, at 7:39 AM, Dmitry Stogov wrote: dmitry Thu Apr 27 11:39:32 2006 UTC Modified files: (Branch: PHP_5_1) /php-src/sapi/cgi fastcgi.c fastcgi.h Log: Proper fix for bug #37205 http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/fastcgi.c? r1=1.4.2.9r2=1.4.2.10diff_format=u Index: php-src/sapi/cgi/fastcgi.c diff -u php-src/sapi/cgi/fastcgi.c:1.4.2.9 php-src/sapi/cgi/ fastcgi.c:1.4.2.10 --- php-src/sapi/cgi/fastcgi.c:1.4.2.9 Wed Apr 26 17:48:27 2006 +++ php-src/sapi/cgi/fastcgi.c Thu Apr 27 11:39:32 2006 @@ -16,7 +16,7 @@ +- -+ */ -/* $Id: fastcgi.c,v 1.4.2.9 2006/04/26 17:48:27 dmitry Exp $ */ +/* $Id: fastcgi.c,v 1.4.2.10 2006/04/27 11:39:32 dmitry Exp $ */ #include fastcgi.h #include php.h @@ -441,6 +441,7 @@ unsigned char buf[FCGI_MAX_LENGTH+8]; req-keep = 0; + req-has_in = 0; req-in_len = 0; req-out_hdr = NULL; req-out_pos = req-out_buf; @@ -509,6 +510,15 @@ len = (hdr.contentLengthB1 8) | hdr.contentLengthB0; padding = hdr.paddingLength; } + if (safe_read(req, hdr, sizeof(fcgi_header)) != sizeof (fcgi_header) || + hdr.version FCGI_VERSION_1 || + hdr.type != FCGI_STDIN) { + req-keep = 0; + return 0; + } + req-in_len = (hdr.contentLengthB1 8) | hdr.contentLengthB0; + req-in_pad = hdr.paddingLength; + req-has_in = (req-in_len != 0); } else if (hdr.type == FCGI_GET_VALUES) { int i, j; int name_len; @@ -551,6 +561,9 @@ fcgi_header hdr; unsigned char buf[8]; + if (!req-has_in) { + return 0; + } n = 0; rest = len; while (rest 0) { http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/fastcgi.h? r1=1.2.2.2r2=1.2.2.3diff_format=u Index: php-src/sapi/cgi/fastcgi.h diff -u php-src/sapi/cgi/fastcgi.h:1.2.2.2 php-src/sapi/cgi/ fastcgi.h:1.2.2.3 --- php-src/sapi/cgi/fastcgi.h:1.2.2.2 Thu Feb 2 08:17:23 2006 +++ php-src/sapi/cgi/fastcgi.h Thu Apr 27 11:39:32 2006 @@ -16,7 +16,7 @@ +- -+ */ -/* $Id: fastcgi.h,v 1.2.2.2 2006/02/02 08:17:23 dmitry Exp $ */ +/* $Id: fastcgi.h,v 1.2.2.3 2006/04/27 11:39:32 dmitry Exp $ */ /* FastCGI protocol */ @@ -97,6 +97,7 @@ intid; intkeep; + inthas_in; intin_len; intin_pad; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Ilia Alshanetsky Advanced Internet Designs Inc. [EMAIL PROTECTED] -- 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
[PHP-CVS] cvs: php-src(PHP_5_1) /sapi/cgi fastcgi.c fastcgi.h
dmitry Thu Apr 27 11:39:32 2006 UTC Modified files: (Branch: PHP_5_1) /php-src/sapi/cgi fastcgi.c fastcgi.h Log: Proper fix for bug #37205 http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/fastcgi.c?r1=1.4.2.9r2=1.4.2.10diff_format=u Index: php-src/sapi/cgi/fastcgi.c diff -u php-src/sapi/cgi/fastcgi.c:1.4.2.9 php-src/sapi/cgi/fastcgi.c:1.4.2.10 --- php-src/sapi/cgi/fastcgi.c:1.4.2.9 Wed Apr 26 17:48:27 2006 +++ php-src/sapi/cgi/fastcgi.c Thu Apr 27 11:39:32 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: fastcgi.c,v 1.4.2.9 2006/04/26 17:48:27 dmitry Exp $ */ +/* $Id: fastcgi.c,v 1.4.2.10 2006/04/27 11:39:32 dmitry Exp $ */ #include fastcgi.h #include php.h @@ -441,6 +441,7 @@ unsigned char buf[FCGI_MAX_LENGTH+8]; req-keep = 0; + req-has_in = 0; req-in_len = 0; req-out_hdr = NULL; req-out_pos = req-out_buf; @@ -509,6 +510,15 @@ len = (hdr.contentLengthB1 8) | hdr.contentLengthB0; padding = hdr.paddingLength; } + if (safe_read(req, hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) || + hdr.version FCGI_VERSION_1 || + hdr.type != FCGI_STDIN) { + req-keep = 0; + return 0; + } + req-in_len = (hdr.contentLengthB1 8) | hdr.contentLengthB0; + req-in_pad = hdr.paddingLength; + req-has_in = (req-in_len != 0); } else if (hdr.type == FCGI_GET_VALUES) { int i, j; int name_len; @@ -551,6 +561,9 @@ fcgi_header hdr; unsigned char buf[8]; + if (!req-has_in) { + return 0; + } n = 0; rest = len; while (rest 0) { http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/fastcgi.h?r1=1.2.2.2r2=1.2.2.3diff_format=u Index: php-src/sapi/cgi/fastcgi.h diff -u php-src/sapi/cgi/fastcgi.h:1.2.2.2 php-src/sapi/cgi/fastcgi.h:1.2.2.3 --- php-src/sapi/cgi/fastcgi.h:1.2.2.2 Thu Feb 2 08:17:23 2006 +++ php-src/sapi/cgi/fastcgi.h Thu Apr 27 11:39:32 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: fastcgi.h,v 1.2.2.2 2006/02/02 08:17:23 dmitry Exp $ */ +/* $Id: fastcgi.h,v 1.2.2.3 2006/04/27 11:39:32 dmitry Exp $ */ /* FastCGI protocol */ @@ -97,6 +97,7 @@ intid; intkeep; + inthas_in; intin_len; intin_pad; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php