dmitry          Fri Aug 31 12:17:52 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src    NEWS 
    /php-src/sapi/cgi   cgi_main.c 
  Log:
  Fixed bug #42453 (CGI SAPI does not shut down cleanly with -i/-m/-v cmdline 
options)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.920&r2=1.2027.2.547.2.921&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.920 php-src/NEWS:1.2027.2.547.2.921
--- php-src/NEWS:1.2027.2.547.2.920     Fri Aug 31 10:48:45 2007
+++ php-src/NEWS        Fri Aug 31 12:17:52 2007
@@ -5,6 +5,8 @@
 
 - Fixed bug #42462 (Segmentation when trying to set an attribute in a 
   DOMElement). (Rob)
+- Fixed bug #42453 (CGI SAPI does not shut down cleanly with -i/-m/-v cmdline
+  options). (Dmitry)
 - Fixed bug #42452 (PDO classes do not expose Reflection API information).
   (Hannes)
 - Fixed bug #42359 (xsd:list type not parsed). (Dmitry)
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.46&r2=1.267.2.15.2.47&diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.46 
php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.47
--- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.46 Wed Aug  8 23:51:57 2007
+++ php-src/sapi/cgi/cgi_main.c Fri Aug 31 12:17:52 2007
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: cgi_main.c,v 1.267.2.15.2.46 2007/08/08 23:51:57 stas Exp $ */
+/* $Id: cgi_main.c,v 1.267.2.15.2.47 2007/08/31 12:17:52 dmitry Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -1471,8 +1471,8 @@
                                        SG(headers_sent) = 1;
                                        php_cgi_usage(argv[0]);
                                        php_end_ob_buffers(1 TSRMLS_CC);
-                                       exit(1);
-                                       break;
+                                       exit_status = 0;
+                                       goto out;
                        }
                }
                php_optind = orig_optind;
@@ -1511,7 +1511,8 @@
                                SG(headers_sent) = 1;
                                php_printf("You cannot use both -n and -c 
switch. Use -h for help.\n");
                                php_end_ob_buffers(1 TSRMLS_CC);
-                               exit(1);
+                               exit_status = 1;
+                               goto out;
                        }
 
                        while ((c = php_getopt(argc, argv, OPTIONS, 
&php_optarg, &php_optind, 0)) != -1) {
@@ -1552,9 +1553,9 @@
                                                        
SG(request_info).no_headers = 1;
                                                }
                                                php_print_info(0xFFFFFFFF 
TSRMLS_CC);
-                                               php_end_ob_buffers(1 TSRMLS_CC);
-                                               exit(0);
-                                               break;
+                                               php_request_shutdown((void *) 
0);
+                                               exit_status = 0;
+                                               goto out;
 
                                case 'l': /* syntax check mode */
                                                no_headers = 1;
@@ -1571,8 +1572,8 @@
                                        print_extensions(TSRMLS_C);
                                        php_printf("\n");
                                        php_end_ob_buffers(1 TSRMLS_CC);
-                                       exit(0);
-                                       break;
+                                       exit_status = 0;
+                                       goto out;
 
 #if 0 /* not yet operational, see also below ... */
                                case '': /* generate indented source mode*/
@@ -1600,9 +1601,9 @@
 #else
                                                php_printf("PHP %s (%s) (built: 
%s %s)\nCopyright (c) 1997-2007 The PHP Group\n%s", PHP_VERSION, 
sapi_module.name, __DATE__, __TIME__, get_zend_version());
 #endif
-                                               php_end_ob_buffers(1 TSRMLS_CC);
-                                               exit(0);
-                                               break;
+                                               php_request_shutdown((void *) 
0);
+                                               exit_status = 0;
+                                               goto out;
 
                                case 'w':
                                                behavior = PHP_MODE_STRIP;
@@ -1890,6 +1891,7 @@
                exit_status = 255;
        } zend_end_try();
 
+out:
        SG(server_context) = NULL;
        php_module_shutdown(TSRMLS_C);
        sapi_shutdown();

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to