shane Sun Jun 29 16:09:56 2003 EDT
Modified files: (Branch: PHP_4_3)
/php-src/sapi/cgi cgi_main.c
Log:
MFH
fix bug http://bugs.php.net/bug.php?id=24009
also do not use APPL_PHYSICAL_PATH as DOCUMENT_ROOT under IIS, it's
different depending on IIS configuration. Code works fine without it, that
was just an attempt at a shortcut.
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.190.2.38 php-src/sapi/cgi/cgi_main.c:1.190.2.39
--- php-src/sapi/cgi/cgi_main.c:1.190.2.38 Tue Jun 3 06:08:17 2003
+++ php-src/sapi/cgi/cgi_main.c Sun Jun 29 16:09:56 2003
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: cgi_main.c,v 1.190.2.38 2003/06/03 10:08:17 edink Exp $ */
+/* $Id: cgi_main.c,v 1.190.2.39 2003/06/29 20:09:56 shane Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -684,8 +684,6 @@
_sapi_cgibin_putenv("ORIG_SCRIPT_FILENAME",env_script_filename TSRMLS_CC);
}
if (!env_document_root) {
- /* IIS version of DOCUMENT_ROOT, not avail in cgi, but
is in fastcgi */
- env_document_root =
sapi_cgibin_getenv("APPL_PHYSICAL_PATH",0 TSRMLS_CC);
/* ini version of document root */
if (!env_document_root) {
env_document_root = PG(doc_root);
@@ -1459,6 +1457,11 @@
/* request startup only after we've done all we can to
get path_translated */
if (php_request_startup(TSRMLS_C)==FAILURE) {
+#if PHP_FASTCGI
+ if (fastcgi) {
+ FCGX_Finish_r(&request);
+ }
+#endif
php_module_shutdown(TSRMLS_C);
return FAILURE;
}
@@ -1486,6 +1489,14 @@
if (retval == FAILURE && file_handle.handle.fp == NULL) {
SG(sapi_headers).http_response_code = 404;
PUTS("No input file specified.\n");
+#if PHP_FASTCGI
+ /* we want to serve more requests if this is fastcgi
+ so cleanup and continue, request shutdown is
+ handled later */
+ if (fastcgi) {
+ goto fastcgi_request_done;
+ }
+#endif
php_request_shutdown((void *) 0);
php_module_shutdown(TSRMLS_C);
return FAILURE;
@@ -1555,6 +1566,9 @@
#endif
}
+#if PHP_FASTCGI
+fastcgi_request_done:
+#endif
{
char *path_translated;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php