summaryrefslogtreecommitdiff
path: root/sapi/litespeed
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-08-02 18:18:23 +0200
committerNikita Popov <nikita.ppv@gmail.com>2017-08-02 18:18:23 +0200
commit042ff13ca94b71a7b72bd0d082f47d5b90c2eb26 (patch)
tree07b22ad1835af605f9f6e6719e615d9fcff81929 /sapi/litespeed
parent91240073ea75d0e0d495572e85fbd31d704fab14 (diff)
parent9871555090a661744505b549d4f808b5e4366e37 (diff)
downloadphp-git-042ff13ca94b71a7b72bd0d082f47d5b90c2eb26.tar.gz
Merge branch 'PHP-7.1' into PHP-7.2
Diffstat (limited to 'sapi/litespeed')
-rw-r--r--sapi/litespeed/lsapi_main.c73
-rw-r--r--sapi/litespeed/lsapilib.h2
2 files changed, 11 insertions, 64 deletions
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index bbd55eaa40..b3471ca02d 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -23,7 +23,8 @@
#include "php_variables.h"
#include "zend_highlight.h"
#include "zend.h"
-
+#include "ext/standard/basic_functions.h"
+#include "ext/standard/info.h"
#include "lsapilib.h"
#include <stdio.h>
@@ -130,10 +131,10 @@ static int php_lsapi_startup(sapi_module_struct *sapi_module)
static void sapi_lsapi_ini_defaults(HashTable *configuration_hash)
{
- zval *tmp, *entry;
-
#if PHP_MAJOR_VERSION > 4
/*
+ zval *tmp, *entry;
+
MAKE_STD_ZVAL(tmp);
INI_DEFAULT("register_long_arrays", "0");
@@ -469,62 +470,6 @@ static void init_request_info( void )
php_handle_auth_data(pAuth);
}
-static char s_cur_chdir[4096] = "";
-
-static int lsapi_chdir_primary_script( zend_file_handle * file_handle )
-{
-#if PHP_MAJOR_VERSION > 4
- char * p;
- char ch;
-
- SG(options) |= SAPI_OPTION_NO_CHDIR;
- getcwd( s_cur_chdir, sizeof( s_cur_chdir ) );
-
- p = strrchr( file_handle->filename, '/' );
- if ( *p )
- {
- *p = 0;
- if ( strcmp( file_handle->filename, s_cur_chdir ) != 0 ) {
- chdir( file_handle->filename );
- }
- *p++ = '/';
- ch = *p;
- *p = 0;
- if ( !CWDG(cwd).cwd ||
- ( strcmp( file_handle->filename, CWDG(cwd).cwd ) != 0 ) ) {
- CWDG(cwd).cwd_length = p - file_handle->filename;
- CWDG(cwd).cwd = (char *) realloc(CWDG(cwd).cwd, CWDG(cwd).cwd_length+1);
- memmove( CWDG(cwd).cwd, file_handle->filename, CWDG(cwd).cwd_length+1 );
- }
- *p = ch;
- }
- /* virtual_file_ex(&CWDG(cwd), file_handle->filename, NULL, CWD_REALPATH); */
-#else
- VCWD_CHDIR_FILE( file_handle->filename );
-#endif
- return 0;
-}
-
-static int lsapi_fopen_primary_script( zend_file_handle * file_handle )
-{
- FILE * fp;
- char * p;
- fp = fopen( SG(request_info).path_translated, "rb" );
- if ( !fp )
- {
- return -1;
- }
- file_handle->type = ZEND_HANDLE_FP;
- file_handle->handle.fp = fp;
- file_handle->filename = SG(request_info).path_translated;
- file_handle->free_filename = 0;
- file_handle->opened_path = NULL;
-
- lsapi_chdir_primary_script( file_handle );
-
- return 0;
-}
-
static int lsapi_execute_script( zend_file_handle * file_handle)
{
char *p;
@@ -551,8 +496,8 @@ static int lsapi_execute_script( zend_file_handle * file_handle)
static int lsapi_module_main(int show_source)
{
- zend_file_handle file_handle = {0};
-
+ zend_file_handle file_handle;
+ memset(&file_handle, 0, sizeof(file_handle));
if (php_request_startup() == FAILURE ) {
return -1;
}
@@ -822,7 +767,7 @@ static int lsapi_activate_user_ini_walk_down_the_path(_lsapi_activate_user_ini_c
void* next)
{
time_t request_time = sapi_get_request_time();
- uint32_t path_len, docroot_len;
+ uint32_t docroot_len;
int rc = SUCCESS;
fn_activate_user_ini_chain_t *fn_next = next;
@@ -1121,8 +1066,8 @@ static int cli_main( int argc, char * argv[] )
}
if ( ret == -1 ) {
if ( *p ) {
- zend_file_handle file_handle = {0};
-
+ zend_file_handle file_handle;
+ memset(&file_handle, 0, sizeof(file_handle));
file_handle.type = ZEND_HANDLE_FP;
file_handle.handle.fp = VCWD_FOPEN(*p, "rb");
diff --git a/sapi/litespeed/lsapilib.h b/sapi/litespeed/lsapilib.h
index 7b8d8669c8..7cc2b9809b 100644
--- a/sapi/litespeed/lsapilib.h
+++ b/sapi/litespeed/lsapilib.h
@@ -361,6 +361,8 @@ void LSAPI_Set_Server_fd( int fd );
int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq );
+void LSAPI_No_Check_ppid(void);
+
void LSAPI_Set_Max_Reqs( int reqs );
void LSAPI_Set_Max_Idle( int secs );