diff options
| author | Shane Caraveo <shane@php.net> | 2002-10-13 05:55:03 +0000 |
|---|---|---|
| committer | Shane Caraveo <shane@php.net> | 2002-10-13 05:55:03 +0000 |
| commit | bfd3efcbd3ed95b90d2d3798f753a331463f4cfc (patch) | |
| tree | 0368af55585c41a6ee377ee66371e0d4dbc32ee8 /sapi/cgi/libfcgi | |
| parent | 6edd9d2f725978289a4676008c830a8f3abcf8b2 (diff) | |
| download | php-git-bfd3efcbd3ed95b90d2d3798f753a331463f4cfc.tar.gz | |
fix invalid handle issue that shutdown php fastcgi prematurly
fix checking os name for impersonation
Diffstat (limited to 'sapi/cgi/libfcgi')
| -rw-r--r-- | sapi/cgi/libfcgi/os_win32.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sapi/cgi/libfcgi/os_win32.c b/sapi/cgi/libfcgi/os_win32.c index 2415e03bb1..7083749c4e 100644 --- a/sapi/cgi/libfcgi/os_win32.c +++ b/sapi/cgi/libfcgi/os_win32.c @@ -295,7 +295,7 @@ int OS_SetImpersonate(void) { char *os_name = NULL; os_name = getenv("OS"); - if (stricmp(os_name, "Windows_NT") == 0) { + if (os_name && stricmp(os_name, "Windows_NT") == 0) { bImpersonate = TRUE; return 1; } @@ -524,7 +524,6 @@ int OS_LibInit(int stdioFds[3]) stdioHandles[STDOUT_FILENO] = GetStdHandle(STD_OUTPUT_HANDLE); if(!SetHandleInformation(stdioHandles[STDOUT_FILENO], HANDLE_FLAG_INHERIT, FALSE)) { - DebugBreak(); //exit(99); return -1; } @@ -543,7 +542,6 @@ int OS_LibInit(int stdioFds[3]) stdioHandles[STDERR_FILENO] = GetStdHandle(STD_ERROR_HANDLE); if(!SetHandleInformation(stdioHandles[STDERR_FILENO], HANDLE_FLAG_INHERIT, FALSE)) { - DebugBreak(); //exit(99); return -1; } @@ -788,11 +786,6 @@ int OS_CreateLocalIpcFd(const char *bindPath, int backlog, int bCreateMutex) HANDLE mutex = INVALID_HANDLE_VALUE; char mutexEnvString[100]; - if (mutex == NULL) - { - return -2; - } - if (bCreateMutex) { mutex = CreateMutex(NULL, FALSE, NULL); if (! SetHandleInformation(mutex, HANDLE_FLAG_INHERIT, TRUE)) @@ -983,7 +976,7 @@ int OS_FcgiConnect(char *bindPath) if (p) { int len = p - bindPath + 1; - host = malloc(len); + host = (char *)malloc(len); if (!host) { fprintf(stderr, "Unable to allocate memory\n"); return -1; @@ -1543,8 +1536,12 @@ int OS_Close(int fd) /* * CloseHandle returns: TRUE success, 0 failure */ + /* + XXX don't close here, fcgi apps fail if we do so + need to examine resource leaks if any might exist if (CloseHandle(fdTable[fd].fid.fileHandle) == FALSE) ret = -1; + */ break; case FD_SOCKET_SYNC: case FD_SOCKET_ASYNC: |
