sniper          Tue Mar  4 09:12:40 2003 EDT

  Modified files:              
    /php4/main  main.c 
  Log:
  ws & CS
  
Index: php4/main/main.c
diff -u php4/main/main.c:1.533 php4/main/main.c:1.534
--- php4/main/main.c:1.533      Mon Mar  3 14:46:16 2003
+++ php4/main/main.c    Tue Mar  4 09:12:39 2003
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: main.c,v 1.533 2003/03/03 19:46:16 iliaa Exp $ */
+/* $Id: main.c,v 1.534 2003/03/04 14:12:39 sniper Exp $ */
 
 /* {{{ includes
  */
@@ -883,28 +883,28 @@
  */
 static int php_start_sapi(TSRMLS_D)
 {
-    int retval = SUCCESS;
+       int retval = SUCCESS;
+
+       if(!SG(sapi_started)) {
+               zend_try {
+                       PG(during_request_startup) = 1;
+
+                       /* initialize global variables */
+                       PG(modules_activated) = 0;
+                       PG(header_is_being_sent) = 0;
+                       PG(connection_status) = PHP_CONNECTION_NORMAL;
 
-    if(!SG(sapi_started)) {
-        zend_try {
-            PG(during_request_startup) = 1;
-
-            /* initialize global variables */
-            PG(modules_activated) = 0;
-            PG(header_is_being_sent) = 0;
-            PG(connection_status) = PHP_CONNECTION_NORMAL;
-
-            zend_activate(TSRMLS_C);
-            zend_set_timeout(EG(timeout_seconds));
-            zend_activate_modules(TSRMLS_C);
-            PG(modules_activated)=1;
-        } zend_catch {
-            retval = FAILURE;
-        } zend_end_try();
-
-        SG(sapi_started) = 1;
-    }
-    return retval;
+                       zend_activate(TSRMLS_C);
+                       zend_set_timeout(EG(timeout_seconds));
+                       zend_activate_modules(TSRMLS_C);
+                       PG(modules_activated)=1;
+               } zend_catch {
+                       retval = FAILURE;
+               } zend_end_try();
+
+               SG(sapi_started) = 1;
+       }
+       return retval;
 }
 
 /* }}} */
@@ -974,30 +974,31 @@
 # else
 int php_request_startup(TSRMLS_D)
 {   
-    int retval = SUCCESS;
+       int retval = SUCCESS;
 
 #if PHP_SIGCHILD
-    signal(SIGCHLD, sigchld_handler);
+       signal(SIGCHLD, sigchld_handler);
 #endif
 
-    if (php_start_sapi() == FAILURE)
-        return FAILURE;
+       if (php_start_sapi() == FAILURE) {
+               return FAILURE;
+       }
+       
+       php_output_activate(TSRMLS_C);
+       sapi_activate(TSRMLS_C);
+       php_hash_environment(TSRMLS_C);
 
-    php_output_activate(TSRMLS_C);
-    sapi_activate(TSRMLS_C);
-    php_hash_environment(TSRMLS_C);
-
-    zend_try {
-        PG(during_request_startup) = 1;
-        php_output_activate(TSRMLS_C);
-        if (PG(expose_php)) {
-            sapi_add_header(SAPI_PHP_VERSION_HEADER, 
sizeof(SAPI_PHP_VERSION_HEADER)-1, 1);
-        }
-    } zend_catch {
-        retval = FAILURE;
-    } zend_end_try();
+       zend_try {
+               PG(during_request_startup) = 1;
+               php_output_activate(TSRMLS_C);
+               if (PG(expose_php)) {
+                       sapi_add_header(SAPI_PHP_VERSION_HEADER, 
sizeof(SAPI_PHP_VERSION_HEADER)-1, 1);
+               }
+       } zend_catch {
+               retval = FAILURE;
+       } zend_end_try();
 
-    return retval;
+       return retval;
 }
 # endif
 /* }}} */
@@ -1006,20 +1007,21 @@
  */
 int php_request_startup_for_hook(TSRMLS_D)
 {
-    int retval = SUCCESS;
+       int retval = SUCCESS;
 
 #if PHP_SIGCHLD
-    signal(SIGCHLD, sigchld_handler);
+       signal(SIGCHLD, sigchld_handler);
 #endif
 
-    if (php_start_sapi(TSRMLS_C) == FAILURE)
-        return FAILURE;
-
-    php_output_activate(TSRMLS_C);
-    sapi_activate_headers_only(TSRMLS_C);
-    php_hash_environment(TSRMLS_C);
+       if (php_start_sapi(TSRMLS_C) == FAILURE) {
+               return FAILURE;
+       }
+       
+       php_output_activate(TSRMLS_C);
+       sapi_activate_headers_only(TSRMLS_C);
+       php_hash_environment(TSRMLS_C);
 
-    return retval;
+       return retval;
 }
 /* }}} */
 
@@ -1039,38 +1041,38 @@
  */
 void php_request_shutdown_for_hook(void *dummy)
 {
-    TSRMLS_FETCH();
-    if (PG(modules_activated)) zend_try {
-        php_call_shutdown_functions();
-    } zend_end_try();
-
-    if (PG(modules_activated)) {
-        zend_deactivate_modules(TSRMLS_C);
-    }
+       TSRMLS_FETCH();
+       if (PG(modules_activated)) zend_try {
+               php_call_shutdown_functions();
+       } zend_end_try();
+
+       if (PG(modules_activated)) {
+               zend_deactivate_modules(TSRMLS_C);
+       }
 
-    zend_try {
-        int i;
+       zend_try {
+               int i;
 
-        for (i = 0; i < NUM_TRACK_VARS; i++) {
+               for (i = 0; i < NUM_TRACK_VARS; i++) {
                        if (PG(http_globals)[i]) {
-                   zval_ptr_dtor(&PG(http_globals)[i]);
+                               zval_ptr_dtor(&PG(http_globals)[i]);
                        }
-        }
-    } zend_end_try();
+               }
+       } zend_end_try();
 
-    zend_deactivate(TSRMLS_C);
+       zend_deactivate(TSRMLS_C);
 
-    zend_try {
-        sapi_deactivate(TSRMLS_C);
-    } zend_end_try();
+       zend_try {
+               sapi_deactivate(TSRMLS_C);
+       } zend_end_try();
 
-    zend_try {
-        shutdown_memory_manager(CG(unclean_shutdown), 0 TSRMLS_CC);
-    } zend_end_try();
+       zend_try {
+               shutdown_memory_manager(CG(unclean_shutdown), 0 TSRMLS_CC);
+       } zend_end_try();
 
-    zend_try {
-        zend_unset_timeout(TSRMLS_C);
-    } zend_end_try();
+       zend_try {
+               zend_unset_timeout(TSRMLS_C);
+       } zend_end_try();
 }
 
 /* }}} */
@@ -1579,34 +1581,33 @@
  */
 PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval **ret 
TSRMLS_DC)
 {
-    char *old_cwd;
+       char *old_cwd;
 
-    EG(exit_status) = 0;
+       EG(exit_status) = 0;
 #define OLD_CWD_SIZE 4096
-    old_cwd = do_alloca(OLD_CWD_SIZE);
-    old_cwd[0] = '\0';
-    
-    zend_try {
+       old_cwd = do_alloca(OLD_CWD_SIZE);
+       old_cwd[0] = '\0';
+       
+       zend_try {
 #ifdef PHP_WIN32
-        UpdateIniFromRegistry(primary_file->filename TSRMLS_CC);
+               UpdateIniFromRegistry(primary_file->filename TSRMLS_CC);
 #endif
 
-        PG(during_request_startup) = 0;
+               PG(during_request_startup) = 0;
 
-        if (primary_file->type == ZEND_HANDLE_FILENAME
-                && primary_file->filename) {
-            VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1);
-            VCWD_CHDIR_FILE(primary_file->filename);
-        }
-        zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, ret, 1, primary_file);
-    } zend_end_try();
-    
-    if (old_cwd[0] != '\0') {
-        VCWD_CHDIR(old_cwd);
-    }
+               if (primary_file->type == ZEND_HANDLE_FILENAME && 
primary_file->filename) {
+                       VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1);
+                       VCWD_CHDIR_FILE(primary_file->filename);
+               }
+               zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, ret, 1, primary_file);
+       } zend_end_try();
+       
+       if (old_cwd[0] != '\0') {
+               VCWD_CHDIR(old_cwd);
+       }
 
-    free_alloca(old_cwd);
-    return EG(exit_status);
+       free_alloca(old_cwd);
+       return EG(exit_status);
 }
 /* }}} */
 
@@ -1631,8 +1632,7 @@
 {
        int ret = -1;
 
-       if (auth && auth[0] != '\0'
-                       && strncmp(auth, "Basic ", 6) == 0) {
+       if (auth && auth[0] != '\0' && strncmp(auth, "Basic ", 6) == 0) {
                char *pass;
                char *user;
 
@@ -1650,9 +1650,10 @@
                }
        }
 
-       if (ret == -1)
+       if (ret == -1) {
                SG(request_info).auth_user = SG(request_info).auth_password = NULL;
-
+       }
+       
        return ret;
 }
 /* }}} */



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

Reply via email to