]> granicus.if.org Git - php/commitdiff
Fixed bug #46782 (fastcgi.c parse error)
authorMatt Wilmas <mattwil@php.net>
Sun, 7 Dec 2008 10:54:16 +0000 (10:54 +0000)
committerMatt Wilmas <mattwil@php.net>
Sun, 7 Dec 2008 10:54:16 +0000 (10:54 +0000)
sapi/cgi/fastcgi.c

index 58d06ea0d70e8f0a2831ea9a922905626c9eea94..0ef1c70cd437f4452e0932dcfb99f63d47e36d56 100644 (file)
@@ -191,8 +191,14 @@ void fcgi_shutdown(void)
 int fcgi_init(void)
 {
        if (!is_initialized) {
+#ifndef _WIN32
+               sa_t sa;
+               socklen_t len = sizeof(sa);
+#endif
                zend_hash_init(&fcgi_mgmt_vars, 0, NULL, fcgi_free_mgmt_var_cb, 1);
                fcgi_set_mgmt_var("FCGI_MPXS_CONNS", sizeof("FCGI_MPXS_CONNS")-1, "0", sizeof("0")-1);
+
+               is_initialized = 1;
 #ifdef _WIN32
 # if 0
                /* TODO: Support for TCP sockets */
@@ -203,8 +209,6 @@ int fcgi_init(void)
                        return 0;
                }
 # endif
-               is_initialized = 1;
-
                if ((GetStdHandle(STD_OUTPUT_HANDLE) == INVALID_HANDLE_VALUE) &&
                    (GetStdHandle(STD_ERROR_HANDLE)  == INVALID_HANDLE_VALUE) &&
                    (GetStdHandle(STD_INPUT_HANDLE)  != INVALID_HANDLE_VALUE)) {
@@ -231,10 +235,6 @@ int fcgi_init(void)
                        return is_fastcgi = 0;
                }
 #else
-               sa_t sa;
-               socklen_t len = sizeof(sa);
-
-               is_initialized = 1;
                errno = 0;
                if (getpeername(0, (struct sockaddr *)&sa, &len) != 0 && errno == ENOTCONN) {
                        fcgi_setup_signals();