del php-src: sapi/litespeed/lsapi_main.c sapi/litespeed/l sapidef.h sapi/litespeed/lsapilib.c sapi/litespeed/lsap ilib.h
| From: | Ferenc Kovacs | Date: | Wed, 30 Jul 2014 08:53:22 +0000 |
| Subject: | del php-src: sapi/litespeed/lsapi_main.c sapi/litespeed/l sapidef.h sapi/litespeed/lsapilib.c sapi/litespeed/lsap ilib.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-79657@lists.php.net to get a copy of this message | ||
Branch: PHP-5.6.0
Deleted commits count: 5
User: Ferenc Kovacs <tyrael@php.net> Wed, 30 Jul 2014 08:53:22 +0000
Changed paths:
M sapi/litespeed/lsapi_main.c
M sapi/litespeed/lsapidef.h
M sapi/litespeed/lsapilib.c
M sapi/litespeed/lsapilib.h
diff --git b/sapi/litespeed/lsapi_main.c a/sapi/litespeed/lsapi_main.c index 3413a42..34ae751 100644 --- b/sapi/litespeed/lsapi_main.c +++ a/sapi/litespeed/lsapi_main.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2007 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,6 +16,8 @@ +----------------------------------------------------------------------+ */ +/* $Id: lsapi_main.c,v 1.57 2013/08/23 14:50:25 gwang Exp $ */ + #include "php.h" #include "SAPI.h" #include "php_main.h" @@ -370,7 +372,7 @@ static void sapi_lsapi_log_message(char *message TSRMLS_DC) static sapi_module_struct lsapi_sapi_module = { "litespeed", - "LiteSpeed V6.6", + "LiteSpeed V6.4", php_lsapi_startup, /* startup */ php_module_shutdown_wrapper, /* shutdown */ @@ -735,9 +737,9 @@ static int cli_main( int argc, char * argv[] ) case 'v': if (php_request_startup(TSRMLS_C) != FAILURE) { #if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif #ifdef PHP_OUTPUT_NEWAPI php_output_end_all(TSRMLS_C); diff --git b/sapi/litespeed/lsapidef.h a/sapi/litespeed/lsapidef.h index fb75d01..5d5b4c1 100644 --- b/sapi/litespeed/lsapidef.h +++ a/sapi/litespeed/lsapidef.h @@ -1,23 +1,5 @@ /* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: George Wang <gwang@litespeedtech.com> | - +----------------------------------------------------------------------+ -*/ - -/* -Copyright (c) 2002-2014, Lite Speed Technologies Inc. +Copyright (c) 2005, Lite Speed Technologies Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -48,6 +30,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/*************************************************************************** + $Id: lsapidef.h,v 1.17 2012/12/01 19:23:31 gwang Exp $ + ------------------- + begin : Thu Feb 10 2005 + author : George Wang + email : gwang@litespeedtech.com + ***************************************************************************/ #ifndef _LSAPIDEF_H_ #define _LSAPIDEF_H_ diff --git b/sapi/litespeed/lsapilib.c a/sapi/litespeed/lsapilib.c index 786a3bd..4a9affc 100644 --- b/sapi/litespeed/lsapilib.c +++ a/sapi/litespeed/lsapilib.c @@ -1,23 +1,5 @@ /* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: George Wang <gwang@litespeedtech.com> | - +----------------------------------------------------------------------+ -*/ - -/* -Copyright (c) 2002-2014, Lite Speed Technologies Inc. +Copyright (c) 2013, Lite Speed Technologies Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -48,6 +30,14 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/*************************************************************************** + lsapilib.c - description + ------------------- + begin : Mon Feb 21 2005 + copyright : (C) 2005 by George Wang + email : gwang@litespeedtech.com + ***************************************************************************/ + #include <ctype.h> #include <dlfcn.h> @@ -1221,7 +1211,6 @@ int LSAPI_IsRunning(void) int LSAPI_InitRequest( LSAPI_Request * pReq, int fd ) { - int newfd; if ( !pReq ) return -1; memset( pReq, 0, sizeof( LSAPI_Request ) ); @@ -1235,14 +1224,7 @@ int LSAPI_InitRequest( LSAPI_Request * pReq, int fd ) pReq->m_respPktHeaderEnd = &pReq->m_respPktHeader[5]; if ( allocateRespHeaderBuf( pReq, LSAPI_INIT_RESP_HEADER_LEN ) == -1 ) return -1; - - if ( fd == STDIN_FILENO ) - { - fd = dup( fd ); - newfd = open( "/dev/null", O_RDWR ); - dup2( newfd, STDIN_FILENO ); - } - + if ( isPipe( fd ) ) { pReq->m_fdListen = -1; @@ -1945,7 +1927,6 @@ int LSAPI_ForeachOrgHeader_r( LSAPI_Request * pReq, { pKey = pReq->m_pHttpHeader + pCur->nameOff; keyLen = pCur->nameLen; - *(pKey + keyLen ) = 0; pValue = pReq->m_pHttpHeader + pCur->valueOff; *(pValue + pCur->valueLen ) = 0; @@ -2405,8 +2386,6 @@ typedef struct _lsapi_prefork_server int m_iAvoidFork; lsapi_child_status * m_pChildrenStatus; - lsapi_child_status * m_pChildrenStatusCur; - lsapi_child_status * m_pChildrenStatusEnd; }lsapi_prefork_server; @@ -2495,15 +2474,11 @@ static void lsapi_cleanup(int signal) static lsapi_child_status * find_child_status( int pid ) { lsapi_child_status * pStatus = g_prefork_server->m_pChildrenStatus; - lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatusEnd; + lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatus + g_prefork_server->m_iMaxChildren * 2; while( pStatus < pEnd ) { if ( pStatus->m_pid == pid ) - { - if ( pStatus + 1 > g_prefork_server->m_pChildrenStatusCur ) - g_prefork_server->m_pChildrenStatusCur = pStatus + 1; return pStatus; - } ++pStatus; } return NULL; @@ -2538,12 +2513,8 @@ static void lsapi_sigchild( int signal ) { child_status->m_pid = 0; --g_prefork_server->m_iCurChildren; - } } - while(( g_prefork_server->m_pChildrenStatusCur > g_prefork_server->m_pChildrenStatus ) - &&( g_prefork_server->m_pChildrenStatusCur[-1].m_pid == 0 )) - --g_prefork_server->m_pChildrenStatusCur; } @@ -2552,7 +2523,7 @@ static int lsapi_init_children_status() int size = 4096; char * pBuf; - size = (g_prefork_server->m_iMaxChildren + g_prefork_server->m_iExtraChildren ) * sizeof( lsapi_child_status ) * 2; + size = g_prefork_server->m_iMaxChildren * sizeof( lsapi_child_status ) * 2; size = (size + 4095 ) / 4096 * 4096; pBuf =( char*) mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0 ); @@ -2562,9 +2533,7 @@ static int lsapi_init_children_status() return -1; } memset( pBuf, 0, size ); - g_prefork_server->m_pChildrenStatus = (lsapi_child_status *)pBuf; - g_prefork_server->m_pChildrenStatusCur = (lsapi_child_status *)pBuf; - g_prefork_server->m_pChildrenStatusEnd = (lsapi_child_status *)pBuf + size / sizeof( lsapi_child_status ); + g_prefork_server->m_pChildrenStatus = (lsapi_child_status *)pBuf; return 0; } @@ -2594,7 +2563,7 @@ static void lsapi_check_child_status( long tmCur ) int dying = 0; int count = 0; lsapi_child_status * pStatus = g_prefork_server->m_pChildrenStatus; - lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatusCur; + lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatus + g_prefork_server->m_iMaxChildren * 2; while( pStatus < pEnd ) { tobekilled = 0; @@ -2607,15 +2576,13 @@ static void lsapi_check_child_status( long tmCur ) if (( g_prefork_server->m_iCurChildren - dying > g_prefork_server->m_iMaxChildren)|| ( idle > g_prefork_server->m_iMaxIdleChildren )) { - ++pStatus->m_iKillSent; - //tobekilled = SIGUSR1; + tobekilled = SIGUSR1; } else { if (( s_max_idle_secs> 0)&&(tmCur - pStatus->m_tmWaitBegin > s_max_idle_secs + 5 )) { - ++pStatus->m_iKillSent; - //tobekilled = SIGUSR1; + tobekilled = SIGUSR1; } } if ( !tobekilled ) @@ -2749,8 +2716,6 @@ static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer, LSAPI_Re if ( pServer->m_iCurChildren >= (pServer->m_iMaxChildren + pServer->m_iExtraChildren ) ) { - fprintf( stderr, "Reached max children process limit: %d, extra: %d, current: %d, please increase LSAPI_CHILDREN.\n", - pServer->m_iMaxChildren, pServer->m_iExtraChildren, pServer->m_iCurChildren ); usleep( 100000 ); continue; } @@ -2857,8 +2822,8 @@ static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer, LSAPI_Re } } sigaction( SIGUSR1, &old_usr1, 0 ); - //kill( -getpgrp(), SIGUSR1 ); - //lsapi_all_children_must_die(); /* Sorry, children ;-) */ + kill( -getpgrp(), SIGUSR1 ); + lsapi_all_children_must_die(); /* Sorry, children ;-) */ return -1; } @@ -2911,7 +2876,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq ) { if ( !g_running ) return -1; - if ((s_req_processed)&&( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) + if (( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) return -1; FD_ZERO( &readfds ); FD_SET( fd, &readfds ); @@ -2939,7 +2904,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq ) } else if ( ret >= 1 ) { - if (s_req_processed && ( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) + if (( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) return -1; if ( fd == pReq->m_fdListen ) { @@ -3101,8 +3066,6 @@ static int lsapi_initSuEXEC() { if ( g_prefork_server->m_iMaxChildren < 100 ) g_prefork_server->m_iMaxChildren = 100; - if ( g_prefork_server->m_iExtraChildren < 1000 ) - g_prefork_server->m_iExtraChildren = 1000; } } if ( !s_defaultUid || !s_defaultGid ) diff --git b/sapi/litespeed/lsapilib.h a/sapi/litespeed/lsapilib.h index cae1863..b0638fd 100644 --- b/sapi/litespeed/lsapilib.h +++ a/sapi/litespeed/lsapilib.h @@ -1,23 +1,5 @@ /* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: George Wang <gwang@litespeedtech.com> | - +----------------------------------------------------------------------+ -*/ - -/* -Copyright (c) 2002-2014, Lite Speed Technologies Inc. +Copyright (c) 2013, Lite Speed Technologies Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -48,6 +30,14 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/*************************************************************************** + lsapilib.h - description + ------------------- + begin : Mon Feb 21 2005 + copyright : (C) 2005 by George Wang + email : gwang@litespeedtech.com + ***************************************************************************/ + #ifndef _LSAPILIB_H_ #define _LSAPILIB_H_
diff --git b/sapi/litespeed/lsapi_main.c a/sapi/litespeed/lsapi_main.c index 3413a42..34ae751 100644 --- b/sapi/litespeed/lsapi_main.c +++ a/sapi/litespeed/lsapi_main.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2007 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,6 +16,8 @@ +----------------------------------------------------------------------+ */ +/* $Id: lsapi_main.c,v 1.57 2013/08/23 14:50:25 gwang Exp $ */ + #include "php.h" #include "SAPI.h" #include "php_main.h" @@ -370,7 +372,7 @@ static void sapi_lsapi_log_message(char *message TSRMLS_DC) static sapi_module_struct lsapi_sapi_module = { "litespeed", - "LiteSpeed V6.6", + "LiteSpeed V6.4", php_lsapi_startup, /* startup */ php_module_shutdown_wrapper, /* shutdown */ @@ -735,9 +737,9 @@ static int cli_main( int argc, char * argv[] ) case 'v': if (php_request_startup(TSRMLS_C) != FAILURE) { #if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif #ifdef PHP_OUTPUT_NEWAPI php_output_end_all(TSRMLS_C); diff --git b/sapi/litespeed/lsapidef.h a/sapi/litespeed/lsapidef.h index fb75d01..5d5b4c1 100644 --- b/sapi/litespeed/lsapidef.h +++ a/sapi/litespeed/lsapidef.h @@ -1,23 +1,5 @@ /* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: George Wang <gwang@litespeedtech.com> | - +----------------------------------------------------------------------+ -*/ - -/* -Copyright (c) 2002-2014, Lite Speed Technologies Inc. +Copyright (c) 2005, Lite Speed Technologies Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -48,6 +30,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/*************************************************************************** + $Id: lsapidef.h,v 1.17 2012/12/01 19:23:31 gwang Exp $ + ------------------- + begin : Thu Feb 10 2005 + author : George Wang + email : gwang@litespeedtech.com + ***************************************************************************/ #ifndef _LSAPIDEF_H_ #define _LSAPIDEF_H_ diff --git b/sapi/litespeed/lsapilib.c a/sapi/litespeed/lsapilib.c index 786a3bd..4a9affc 100644 --- b/sapi/litespeed/lsapilib.c +++ a/sapi/litespeed/lsapilib.c @@ -1,23 +1,5 @@ /* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: George Wang <gwang@litespeedtech.com> | - +----------------------------------------------------------------------+ -*/ - -/* -Copyright (c) 2002-2014, Lite Speed Technologies Inc. +Copyright (c) 2013, Lite Speed Technologies Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -48,6 +30,14 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/*************************************************************************** + lsapilib.c - description + ------------------- + begin : Mon Feb 21 2005 + copyright : (C) 2005 by George Wang + email : gwang@litespeedtech.com + ***************************************************************************/ + #include <ctype.h> #include <dlfcn.h> @@ -1221,7 +1211,6 @@ int LSAPI_IsRunning(void) int LSAPI_InitRequest( LSAPI_Request * pReq, int fd ) { - int newfd; if ( !pReq ) return -1; memset( pReq, 0, sizeof( LSAPI_Request ) ); @@ -1235,14 +1224,7 @@ int LSAPI_InitRequest( LSAPI_Request * pReq, int fd ) pReq->m_respPktHeaderEnd = &pReq->m_respPktHeader[5]; if ( allocateRespHeaderBuf( pReq, LSAPI_INIT_RESP_HEADER_LEN ) == -1 ) return -1; - - if ( fd == STDIN_FILENO ) - { - fd = dup( fd ); - newfd = open( "/dev/null", O_RDWR ); - dup2( newfd, STDIN_FILENO ); - } - + if ( isPipe( fd ) ) { pReq->m_fdListen = -1; @@ -1945,7 +1927,6 @@ int LSAPI_ForeachOrgHeader_r( LSAPI_Request * pReq, { pKey = pReq->m_pHttpHeader + pCur->nameOff; keyLen = pCur->nameLen; - *(pKey + keyLen ) = 0; pValue = pReq->m_pHttpHeader + pCur->valueOff; *(pValue + pCur->valueLen ) = 0; @@ -2405,8 +2386,6 @@ typedef struct _lsapi_prefork_server int m_iAvoidFork; lsapi_child_status * m_pChildrenStatus; - lsapi_child_status * m_pChildrenStatusCur; - lsapi_child_status * m_pChildrenStatusEnd; }lsapi_prefork_server; @@ -2495,15 +2474,11 @@ static void lsapi_cleanup(int signal) static lsapi_child_status * find_child_status( int pid ) { lsapi_child_status * pStatus = g_prefork_server->m_pChildrenStatus; - lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatusEnd; + lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatus + g_prefork_server->m_iMaxChildren * 2; while( pStatus < pEnd ) { if ( pStatus->m_pid == pid ) - { - if ( pStatus + 1 > g_prefork_server->m_pChildrenStatusCur ) - g_prefork_server->m_pChildrenStatusCur = pStatus + 1; return pStatus; - } ++pStatus; } return NULL; @@ -2538,12 +2513,8 @@ static void lsapi_sigchild( int signal ) { child_status->m_pid = 0; --g_prefork_server->m_iCurChildren; - } } - while(( g_prefork_server->m_pChildrenStatusCur > g_prefork_server->m_pChildrenStatus ) - &&( g_prefork_server->m_pChildrenStatusCur[-1].m_pid == 0 )) - --g_prefork_server->m_pChildrenStatusCur; } @@ -2552,7 +2523,7 @@ static int lsapi_init_children_status() int size = 4096; char * pBuf; - size = (g_prefork_server->m_iMaxChildren + g_prefork_server->m_iExtraChildren ) * sizeof( lsapi_child_status ) * 2; + size = g_prefork_server->m_iMaxChildren * sizeof( lsapi_child_status ) * 2; size = (size + 4095 ) / 4096 * 4096; pBuf =( char*) mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0 ); @@ -2562,9 +2533,7 @@ static int lsapi_init_children_status() return -1; } memset( pBuf, 0, size ); - g_prefork_server->m_pChildrenStatus = (lsapi_child_status *)pBuf; - g_prefork_server->m_pChildrenStatusCur = (lsapi_child_status *)pBuf; - g_prefork_server->m_pChildrenStatusEnd = (lsapi_child_status *)pBuf + size / sizeof( lsapi_child_status ); + g_prefork_server->m_pChildrenStatus = (lsapi_child_status *)pBuf; return 0; } @@ -2594,7 +2563,7 @@ static void lsapi_check_child_status( long tmCur ) int dying = 0; int count = 0; lsapi_child_status * pStatus = g_prefork_server->m_pChildrenStatus; - lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatusCur; + lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatus + g_prefork_server->m_iMaxChildren * 2; while( pStatus < pEnd ) { tobekilled = 0; @@ -2607,15 +2576,13 @@ static void lsapi_check_child_status( long tmCur ) if (( g_prefork_server->m_iCurChildren - dying > g_prefork_server->m_iMaxChildren)|| ( idle > g_prefork_server->m_iMaxIdleChildren )) { - ++pStatus->m_iKillSent; - //tobekilled = SIGUSR1; + tobekilled = SIGUSR1; } else { if (( s_max_idle_secs> 0)&&(tmCur - pStatus->m_tmWaitBegin > s_max_idle_secs + 5 )) { - ++pStatus->m_iKillSent; - //tobekilled = SIGUSR1; + tobekilled = SIGUSR1; } } if ( !tobekilled ) @@ -2749,8 +2716,6 @@ static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer, LSAPI_Re if ( pServer->m_iCurChildren >= (pServer->m_iMaxChildren + pServer->m_iExtraChildren ) ) { - fprintf( stderr, "Reached max children process limit: %d, extra: %d, current: %d, please increase LSAPI_CHILDREN.\n", - pServer->m_iMaxChildren, pServer->m_iExtraChildren, pServer->m_iCurChildren ); usleep( 100000 ); continue; } @@ -2857,8 +2822,8 @@ static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer, LSAPI_Re } } sigaction( SIGUSR1, &old_usr1, 0 ); - //kill( -getpgrp(), SIGUSR1 ); - //lsapi_all_children_must_die(); /* Sorry, children ;-) */ + kill( -getpgrp(), SIGUSR1 ); + lsapi_all_children_must_die(); /* Sorry, children ;-) */ return -1; } @@ -2911,7 +2876,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq ) { if ( !g_running ) return -1; - if ((s_req_processed)&&( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) + if (( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) return -1; FD_ZERO( &readfds ); FD_SET( fd, &readfds ); @@ -2939,7 +2904,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq ) } else if ( ret >= 1 ) { - if (s_req_processed && ( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) + if (( s_pChildStatus )&&( s_pChildStatus->m_iKillSent )) return -1; if ( fd == pReq->m_fdListen ) { @@ -3101,8 +3066,6 @@ static int lsapi_initSuEXEC() { if ( g_prefork_server->m_iMaxChildren < 100 ) g_prefork_server->m_iMaxChildren = 100; - if ( g_prefork_server->m_iExtraChildren < 1000 ) - g_prefork_server->m_iExtraChildren = 1000; } } if ( !s_defaultUid || !s_defaultGid ) diff --git b/sapi/litespeed/lsapilib.h a/sapi/litespeed/lsapilib.h index cae1863..b0638fd 100644 --- b/sapi/litespeed/lsapilib.h +++ a/sapi/litespeed/lsapilib.h @@ -1,23 +1,5 @@ /* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: George Wang <gwang@litespeedtech.com> | - +----------------------------------------------------------------------+ -*/ - -/* -Copyright (c) 2002-2014, Lite Speed Technologies Inc. +Copyright (c) 2013, Lite Speed Technologies Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -48,6 +30,14 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/*************************************************************************** + lsapilib.h - description + ------------------- + begin : Mon Feb 21 2005 + copyright : (C) 2005 by George Wang + email : gwang@litespeedtech.com + ***************************************************************************/ + #ifndef _LSAPILIB_H_ #define _LSAPILIB_H_