summaryrefslogtreecommitdiff
path: root/sapi/litespeed/lsapi_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/litespeed/lsapi_main.c')
-rw-r--r--sapi/litespeed/lsapi_main.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index d82e82556e..2ab2336aab 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -367,7 +367,7 @@ static int sapi_lsapi_send_headers_like_cgi(sapi_headers_struct *sapi_headers)
char buf[SAPI_LSAPI_MAX_HEADER_LENGTH];
sapi_header_struct *h;
zend_llist_position pos;
- zend_bool ignore_status = 0;
+ bool ignore_status = 0;
int response_status = SG(sapi_headers).http_response_code;
if (SG(request_info).no_headers == 1) {
@@ -378,7 +378,7 @@ static int sapi_lsapi_send_headers_like_cgi(sapi_headers_struct *sapi_headers)
if (SG(sapi_headers).http_response_code != 200)
{
int len;
- zend_bool has_status = 0;
+ bool has_status = 0;
char *s;
@@ -643,11 +643,13 @@ static void init_request_info( void )
php_handle_auth_data(pAuth);
}
-static int lsapi_execute_script( zend_file_handle * file_handle)
+static int lsapi_execute_script(void)
{
+ zend_file_handle file_handle;
char *p;
int len;
- zend_stream_init_filename(file_handle, SG(request_info).path_translated);
+ zend_stream_init_filename(&file_handle, SG(request_info).path_translated);
+ file_handle->primary_script = 1;
p = argv0;
*p++ = ':';
@@ -658,7 +660,8 @@ static int lsapi_execute_script( zend_file_handle * file_handle)
len = 0;
memccpy( p, SG(request_info).path_translated + len, 0, 46 );
- php_execute_script(file_handle);
+ php_execute_script(&file_handle);
+ zend_destroy_file_handle(&file_handle);
return 0;
}
@@ -740,8 +743,6 @@ static int lsapi_module_main(int show_source)
{
struct sigaction act;
int sa_rc;
- zend_file_handle file_handle;
- memset(&file_handle, 0, sizeof(file_handle));
if (php_request_startup() == FAILURE ) {
return -1;
}
@@ -767,7 +768,7 @@ static int lsapi_module_main(int show_source)
php_get_highlight_struct(&syntax_highlighter_ini);
highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini);
} else {
- lsapi_execute_script( &file_handle);
+ lsapi_execute_script();
}
zend_try {
php_request_shutdown(NULL);
@@ -1308,8 +1309,9 @@ static int cli_main( int argc, char * argv[] )
}
if ( ret == -1 ) {
if ( *p ) {
- zend_file_handle file_handle;
+ zend_file_handle file_handle;
zend_stream_init_fp(&file_handle, VCWD_FOPEN(*p, "rb"), NULL);
+ file_handle.primary_script = 1;
if ( file_handle.handle.fp ) {
script_filename = *p;
@@ -1329,8 +1331,7 @@ static int cli_main( int argc, char * argv[] )
php_get_highlight_struct(&syntax_highlighter_ini);
highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini);
} else if (source_highlight == 2) {
- file_handle.filename = *p;
- file_handle.free_filename = 0;
+ file_handle.filename = zend_string_init(*p, strlen(*p), 0);
file_handle.opened_path = NULL;
ret = php_lint_script(&file_handle);
if (ret==SUCCESS) {
@@ -1340,8 +1341,7 @@ static int cli_main( int argc, char * argv[] )
}
} else {
- file_handle.filename = *p;
- file_handle.free_filename = 0;
+ file_handle.filename = zend_string_init(*p, strlen(*p), 0);
file_handle.opened_path = NULL;
php_execute_script(&file_handle);