From bc42c37513a730b0b3ff9cf29e14e45e4ec50c71 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Tue, 31 Jul 2001 06:28:05 +0000 Subject: [PATCH] More TSRMLS_FETCH work. Got it under 400 now. --- ext/standard/basic_functions.c | 16 ++++++++-------- ext/standard/dir.c | 2 +- ext/standard/exec.c | 2 +- ext/standard/file.c | 4 ++-- ext/standard/filestat.c | 23 ++++++++++++++++------- ext/standard/head.c | 4 ++-- ext/standard/iptc.c | 3 ++- ext/standard/pageinfo.c | 2 +- ext/zlib/zlib.c | 4 ++-- main/SAPI.c | 18 +++++------------- main/SAPI.h | 12 ++++++------ main/fopen_wrappers.c | 28 +++++++++------------------- main/fopen_wrappers.h | 10 +++++----- main/main.c | 10 +++++----- main/output.c | 2 +- main/php_logos.c | 2 +- main/php_logos.h | 2 +- main/safe_mode.c | 2 +- sapi/pi3web/pi3web_sapi.c | 2 +- sapi/servlet/servlet.c | 4 +--- sapi/tux/php_tux.c | 2 +- 21 files changed, 72 insertions(+), 82 deletions(-) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 22e0e1bffb..8323bfb0f0 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -779,13 +779,13 @@ PHP_MINIT_FUNCTION(basic) #endif if(PG(allow_url_fopen)) { - if (FAILURE==php_register_url_wrapper("http", php_fopen_url_wrap_http)) { + if (FAILURE==php_register_url_wrapper("http", php_fopen_url_wrap_http TSRMLS_CC)) { return FAILURE; } - if (FAILURE==php_register_url_wrapper("ftp", php_fopen_url_wrap_ftp)) { + if (FAILURE==php_register_url_wrapper("ftp", php_fopen_url_wrap_ftp TSRMLS_CC)) { return FAILURE; } - if (FAILURE==php_register_url_wrapper("php", php_fopen_url_wrap_php)) { + if (FAILURE==php_register_url_wrapper("php", php_fopen_url_wrap_php TSRMLS_CC)) { return FAILURE; } } @@ -803,9 +803,9 @@ PHP_MSHUTDOWN_FUNCTION(basic) #endif if(PG(allow_url_fopen)) { - php_unregister_url_wrapper("http"); - php_unregister_url_wrapper("ftp"); - php_unregister_url_wrapper("php"); + php_unregister_url_wrapper("http" TSRMLS_CC); + php_unregister_url_wrapper("ftp" TSRMLS_CC); + php_unregister_url_wrapper("php" TSRMLS_CC); } UNREGISTER_INI_ENTRIES(); @@ -998,7 +998,7 @@ PHP_FUNCTION(getenv) } - ptr = sapi_getenv(Z_STRVAL_PP(str), Z_STRLEN_PP(str)); + ptr = sapi_getenv(Z_STRVAL_PP(str), Z_STRLEN_PP(str) TSRMLS_CC); if (!ptr) { ptr = getenv(Z_STRVAL_PP(str)); } @@ -1161,7 +1161,7 @@ PHP_FUNCTION(strval) Flush the output buffer */ PHP_FUNCTION(flush) { - sapi_flush(); + sapi_flush(TSRMLS_C); } /* }}} */ diff --git a/ext/standard/dir.c b/ext/standard/dir.c index f691e6e307..dfa215bad1 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -148,7 +148,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject) } convert_to_string_ex(arg); - if (php_check_open_basedir((*arg)->value.str.val)) { + if (php_check_open_basedir((*arg)->value.str.val TSRMLS_CC)) { RETURN_FALSE; } diff --git a/ext/standard/exec.c b/ext/standard/exec.c index ee2f41acdd..c094b62ee4 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -175,7 +175,7 @@ int php_Exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC) if (type == 1) { if (output) PUTS(buf); - sapi_flush(); + sapi_flush(TSRMLS_C); } else if (type == 2) { /* strip trailing whitespaces */ diff --git a/ext/standard/file.c b/ext/standard/file.c index 107bc67abf..99b94ed3b5 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1907,7 +1907,7 @@ PHP_FUNCTION(copy) RETURN_FALSE; } - if (php_check_open_basedir((*source)->value.str.val)) { + if (php_check_open_basedir((*source)->value.str.val TSRMLS_CC)) { RETURN_FALSE; } @@ -1915,7 +1915,7 @@ PHP_FUNCTION(copy) RETURN_FALSE; } - if (php_check_open_basedir((*target)->value.str.val)) { + if (php_check_open_basedir((*target)->value.str.val TSRMLS_CC)) { RETURN_FALSE; } diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 4cc224b81f..e01c814038 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -141,7 +141,9 @@ PHP_FUNCTION(disk_total_space) convert_to_string_ex(path); - if (php_check_open_basedir((*path)->value.str.val)) RETURN_FALSE; + if (php_check_open_basedir((*path)->value.str.val TSRMLS_CC)) { + RETURN_FALSE; + } #ifdef WINDOWS /* GetDiskFreeSpaceEx is only available in NT and Win95 post-OSR2, @@ -242,7 +244,9 @@ PHP_FUNCTION(disk_free_space) convert_to_string_ex(path); - if (php_check_open_basedir((*path)->value.str.val)) RETURN_FALSE; + if (php_check_open_basedir((*path)->value.str.val TSRMLS_CC)) { + RETURN_FALSE; + } #ifdef WINDOWS /* GetDiskFreeSpaceEx is only available in NT and Win95 post-OSR2, @@ -335,8 +339,9 @@ PHP_FUNCTION(chgrp) } /* Check the basedir */ - if (php_check_open_basedir((*filename)->value.str.val)) + if (php_check_open_basedir((*filename)->value.str.val TSRMLS_CC)) { RETURN_FALSE; + } ret = VCWD_CHOWN((*filename)->value.str.val, -1, gid); if (ret == -1) { @@ -382,8 +387,9 @@ PHP_FUNCTION(chown) } /* Check the basedir */ - if (php_check_open_basedir((*filename)->value.str.val)) + if (php_check_open_basedir((*filename)->value.str.val TSRMLS_CC)) { RETURN_FALSE; + } ret = VCWD_CHOWN((*filename)->value.str.val, uid, -1); if (ret == -1) { @@ -414,8 +420,9 @@ PHP_FUNCTION(chmod) } /* Check the basedir */ - if (php_check_open_basedir((*filename)->value.str.val)) + if (php_check_open_basedir((*filename)->value.str.val TSRMLS_CC)) { RETURN_FALSE; + } imode = (mode_t) (*mode)->value.lval; /* in safe mode, do not allow to setuid files. @@ -476,8 +483,10 @@ PHP_FUNCTION(touch) } /* Check the basedir */ - if (php_check_open_basedir((*filename)->value.str.val)) { - if (newtime) efree(newtime); + if (php_check_open_basedir((*filename)->value.str.val TSRMLS_CC)) { + if (newtime) { + efree(newtime); + } RETURN_FALSE; } diff --git a/ext/standard/head.c b/ext/standard/head.c index b4df2645ff..8a35627cfa 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -53,7 +53,7 @@ PHP_FUNCTION(header) case 1: convert_to_string_ex(arg1); } - sapi_add_header_ex(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1), 1, replace); + sapi_add_header_ex(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1), 1, replace TSRMLS_CC); } /* }}} */ @@ -61,7 +61,7 @@ PHPAPI int php_header() { TSRMLS_FETCH(); - if (sapi_send_headers()==FAILURE || SG(request_info).headers_only) { + if (sapi_send_headers(TSRMLS_C)==FAILURE || SG(request_info).headers_only) { return 0; /* don't allow output */ } else { return 1; /* allow output */ diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index 8fb51fb9a3..096d0de42c 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -210,8 +210,9 @@ PHP_FUNCTION(iptcembed) break; } - if (php_check_open_basedir((*jpeg_file)->value.str.val)) + if (php_check_open_basedir((*jpeg_file)->value.str.val TSRMLS_CC)) { RETURN_FALSE; + } if ((fp = VCWD_FOPEN((*jpeg_file)->value.str.val,"rb")) == 0) { php_error(E_WARNING, "Unable to open %s", (*jpeg_file)->value.str.val); diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c index 5c52d97762..cc5e8451e1 100644 --- a/ext/standard/pageinfo.c +++ b/ext/standard/pageinfo.c @@ -47,7 +47,7 @@ static void php_statpage(TSRMLS_D) { struct stat *pstat; - pstat = sapi_get_stat(); + pstat = sapi_get_stat(TSRMLS_C); if (BG(page_uid)==-1 || BG(page_gid)==-1) { if(pstat) { diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 112d745af9..e70d9fa49d 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -165,7 +165,7 @@ PHP_MINIT_FUNCTION(zlib) #if HAVE_FOPENCOOKIE if(PG(allow_url_fopen)) { - php_register_url_wrapper("zlib",zlib_fopen_wrapper); + php_register_url_wrapper("zlib",zlib_fopen_wrapper TSRMLS_CC); } #endif @@ -202,7 +202,7 @@ PHP_MSHUTDOWN_FUNCTION(zlib) { #if HAVE_FOPENCOOKIE if(PG(allow_url_fopen)) { - php_unregister_url_wrapper("zlib"); + php_unregister_url_wrapper("zlib" TSRMLS_CC); } #endif diff --git a/main/SAPI.c b/main/SAPI.c index 08fa6afcc5..b38fd1edb5 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -366,12 +366,11 @@ static int sapi_extract_response_code(const char *header_line) /* This function expects a *duplicated* string, that was previously emalloc()'d. * Pointers sent to this functions will be automatically freed by the framework. */ -SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace) +SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace TSRMLS_DC) { int retval, free_header = 0; sapi_header_struct sapi_header; char *colon_offset; - TSRMLS_FETCH(); if (SG(headers_sent) && !SG(request_info).no_headers) { char *output_start_filename = php_get_output_start_filename(); @@ -465,11 +464,10 @@ SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bo } -SAPI_API int sapi_send_headers() +SAPI_API int sapi_send_headers(TSRMLS_D) { int retval; int ret = FAILURE; - TSRMLS_FETCH(); if (SG(headers_sent) || SG(request_info).no_headers) { return SUCCESS; @@ -555,11 +553,9 @@ SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRML } -SAPI_API int sapi_flush() +SAPI_API int sapi_flush(TSRMLS_D) { if (sapi_module.flush) { - TSRMLS_FETCH(); - sapi_module.flush(SG(server_context)); return SUCCESS; } else { @@ -567,10 +563,8 @@ SAPI_API int sapi_flush() } } -SAPI_API struct stat *sapi_get_stat() +SAPI_API struct stat *sapi_get_stat(TSRMLS_D) { - TSRMLS_FETCH(); - if (sapi_module.get_stat) { return sapi_module.get_stat(TSRMLS_C); } else { @@ -582,11 +576,9 @@ SAPI_API struct stat *sapi_get_stat() } -SAPI_API char *sapi_getenv(char *name, size_t name_len) +SAPI_API char *sapi_getenv(char *name, size_t name_len TSRMLS_DC) { if (sapi_module.getenv) { - TSRMLS_FETCH(); - return sapi_module.getenv(name, name_len TSRMLS_CC); } else { return NULL; diff --git a/main/SAPI.h b/main/SAPI.h index 95015a7f81..def26a08f3 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -130,10 +130,10 @@ SAPI_API void sapi_activate(TSRMLS_D); SAPI_API void sapi_deactivate(TSRMLS_D); SAPI_API void sapi_initialize_empty_request(TSRMLS_D); -SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace); +SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate, zend_bool replace TSRMLS_DC); #define sapi_add_header(header_line, header_line_len, duplicate) \ - sapi_add_header_ex((header_line), (header_line_len), (duplicate), 1) -SAPI_API int sapi_send_headers(void); + sapi_add_header_ex((header_line), (header_line_len), (duplicate), 1 TSRMLS_CC) +SAPI_API int sapi_send_headers(TSRMLS_D); SAPI_API void sapi_free_header(sapi_header_struct *sapi_header); SAPI_API void sapi_handle_post(void *arg TSRMLS_DC); @@ -142,9 +142,9 @@ SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry); SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry); SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRMLS_D)); -SAPI_API int sapi_flush(void); -SAPI_API struct stat *sapi_get_stat(void); -SAPI_API char *sapi_getenv(char *name, size_t name_len); +SAPI_API int sapi_flush(TSRMLS_D); +SAPI_API struct stat *sapi_get_stat(TSRMLS_D); +SAPI_API char *sapi_getenv(char *name, size_t name_len TSRMLS_DC); SAPI_API char *sapi_get_default_content_type(TSRMLS_D); SAPI_API void sapi_get_default_content_type_header(sapi_header_struct *default_header TSRMLS_DC); diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index df72859581..b3ecfcbfa3 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -90,10 +90,8 @@ HashTable fopen_url_wrappers_hash; /* {{{ php_register_url_wrapper */ -PHPAPI int php_register_url_wrapper(char *protocol, FILE * (*wrapper)(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path)) +PHPAPI int php_register_url_wrapper(char *protocol, FILE * (*wrapper)(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path) TSRMLS_DC) { - TSRMLS_FETCH(); - if(PG(allow_url_fopen)) { return zend_hash_add(&fopen_url_wrappers_hash, protocol, strlen(protocol), &wrapper, sizeof(wrapper), NULL); } else { @@ -104,10 +102,8 @@ PHPAPI int php_register_url_wrapper(char *protocol, FILE * (*wrapper)(char *path /* {{{ php_unregister_url_wrapper */ -PHPAPI int php_unregister_url_wrapper(char *protocol) +PHPAPI int php_unregister_url_wrapper(char *protocol TSRMLS_DC) { - TSRMLS_FETCH(); - if(PG(allow_url_fopen)) { return zend_hash_del(&fopen_url_wrappers_hash, protocol, strlen(protocol)); } else { @@ -118,27 +114,22 @@ PHPAPI int php_unregister_url_wrapper(char *protocol) /* {{{ php_init_fopen_wrappers */ -int php_init_fopen_wrappers(void) +int php_init_fopen_wrappers(TSRMLS_D) { - TSRMLS_FETCH(); - - if(PG(allow_url_fopen)) + if(PG(allow_url_fopen)) { return zend_hash_init(&fopen_url_wrappers_hash, 0, NULL, NULL, 1); - + } return SUCCESS; } /* }}} */ /* {{{ php_shutdown_fopen_wrappers */ -int php_shutdown_fopen_wrappers(void) +int php_shutdown_fopen_wrappers(TSRMLS_D) { - TSRMLS_FETCH(); - if(PG(allow_url_fopen)) { zend_hash_destroy(&fopen_url_wrappers_hash); } - return SUCCESS; } /* }}} */ @@ -196,10 +187,8 @@ PHPAPI int php_check_specific_open_basedir(char *basedir, char *path TSRMLS_DC) /* {{{ php_check_open_basedir */ -PHPAPI int php_check_open_basedir(char *path) +PHPAPI int php_check_open_basedir(char *path TSRMLS_DC) { - TSRMLS_FETCH(); - /* Only check when open_basedir is available */ if (PG(open_basedir) && *PG(open_basedir)) { char *pathbuf; @@ -240,8 +229,9 @@ PHPAPI int php_check_open_basedir(char *path) static FILE *php_fopen_and_set_opened_path(const char *path, char *mode, char **opened_path) { FILE *fp; + TSRMLS_FETCH(); - if (php_check_open_basedir((char *)path)) { + if (php_check_open_basedir((char *)path TSRMLS_CC)) { return NULL; } fp = VCWD_FOPEN(path, mode); diff --git a/main/fopen_wrappers.h b/main/fopen_wrappers.h index 18a8610c03..040dae6cb6 100644 --- a/main/fopen_wrappers.h +++ b/main/fopen_wrappers.h @@ -69,7 +69,7 @@ PHPAPI FILE *php_fopen_wrapper(char *filename, char *mode, int options, int *iss PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle); PHPAPI char *expand_filepath(const char *filepath, char *real_path); -PHPAPI int php_check_open_basedir(char *path); +PHPAPI int php_check_open_basedir(char *path TSRMLS_DC); PHPAPI int php_check_specific_open_basedir(char *basedir, char *path TSRMLS_DC); PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path); @@ -78,10 +78,10 @@ PHPAPI int php_is_url(char *path); PHPAPI char *php_strip_url_passwd(char *path); -int php_init_fopen_wrappers(void); -int php_shutdown_fopen_wrappers(void); -PHPAPI int php_register_url_wrapper(char *protocol, FILE * (*wrapper)(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path)); -PHPAPI int php_unregister_url_wrapper(char *protocol); +int php_init_fopen_wrappers(TSRMLS_D); +int php_shutdown_fopen_wrappers(TSRMLS_D); +PHPAPI int php_register_url_wrapper(char *protocol, FILE * (*wrapper)(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path) TSRMLS_DC); +PHPAPI int php_unregister_url_wrapper(char *protocol TSRMLS_DC); #endif /* diff --git a/main/main.c b/main/main.c index 8e9c1c0dc2..87bf427aad 100644 --- a/main/main.c +++ b/main/main.c @@ -686,7 +686,7 @@ void php_request_shutdown(void *dummy) } zend_end_try(); zend_try { - sapi_send_headers(); + sapi_send_headers(TSRMLS_C); } zend_end_try(); if (PG(modules_activated)) zend_try { @@ -860,7 +860,7 @@ int php_module_startup(sapi_module_struct *sf) /* initialize fopen wrappers registry (this uses configuration parameters from php.ini) */ - if (php_init_fopen_wrappers() == FAILURE) { + if (php_init_fopen_wrappers(TSRMLS_C) == FAILURE) { php_printf("PHP: Unable to initialize fopen url wrappers.\n"); return FAILURE; } @@ -959,10 +959,10 @@ void php_module_shutdown() #endif php_shutdown_ticks(TSRMLS_C); - sapi_flush(); + sapi_flush(TSRMLS_C); zend_shutdown(TSRMLS_C); - php_shutdown_fopen_wrappers(); + php_shutdown_fopen_wrappers(TSRMLS_C); php_shutdown_info_logos(); UNREGISTER_INI_ENTRIES(); #ifndef ZTS @@ -1177,7 +1177,7 @@ PHPAPI int php_handle_special_queries(TSRMLS_D) { if (SG(request_info).query_string && SG(request_info).query_string[0]=='=' && PG(expose_php)) { - if (php_info_logos(SG(request_info).query_string+1)) { + if (php_info_logos(SG(request_info).query_string+1 TSRMLS_CC)) { return 1; } else if (!strcmp(SG(request_info).query_string+1, PHP_CREDITS_GUID)) { php_print_credits(PHP_CREDITS_ALL); diff --git a/main/output.c b/main/output.c index cf5272acdd..4e52d458f4 100644 --- a/main/output.c +++ b/main/output.c @@ -470,7 +470,7 @@ static int php_ub_body_write_no_header(const char *str, uint str_length) result = OG(php_header_write)(str, str_length); if (OG(implicit_flush)) { - sapi_flush(); + sapi_flush(TSRMLS_C); } return result; diff --git a/main/php_logos.c b/main/php_logos.c index c9eb588911..eb3c523492 100644 --- a/main/php_logos.c +++ b/main/php_logos.c @@ -67,7 +67,7 @@ int php_shutdown_info_logos(void) } #define CONTENT_TYPE_HEADER "Content-Type: " -int php_info_logos(const char *logo_string) +int php_info_logos(const char *logo_string TSRMLS_DC) { php_info_logo *logo_image; char *content_header; diff --git a/main/php_logos.h b/main/php_logos.h index 42df0a87ae..e6e2028bae 100644 --- a/main/php_logos.h +++ b/main/php_logos.h @@ -5,6 +5,6 @@ PHPAPI int php_register_info_logo(char *logo_string, char *mimetype, unsigned ch PHPAPI int php_unregister_info_logo(char *logo_string); int php_init_info_logos(void); int php_shutdown_info_logos(void); -int php_info_logos(const char *logo_string); +int php_info_logos(const char *logo_string TSRMLS_DC); #endif /* _PHP_LOGOS_H */ diff --git a/main/safe_mode.c b/main/safe_mode.c index fdf6f161de..675a3d7ab4 100644 --- a/main/safe_mode.c +++ b/main/safe_mode.c @@ -166,7 +166,7 @@ PHPAPI char *php_get_current_user() USE_SAPI is defined, because cgi will also be interfaced in USE_SAPI */ - pstat = sapi_get_stat(); + pstat = sapi_get_stat(TSRMLS_C); if (!pstat) { return empty_string; diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c index 66c5be1783..3a52e14cd2 100644 --- a/sapi/pi3web/pi3web_sapi.c +++ b/sapi/pi3web/pi3web_sapi.c @@ -413,7 +413,7 @@ DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB) break; case PHP_MODE_INDENT: header_line = (char *)estrdup("Content-Type: text/plain"); - sapi_add_header_ex(header_line, strlen(header_line), 1, 1); + sapi_add_header_ex(header_line, strlen(header_line), 1, 1 TSRMLS_CC); if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS ) { zend_indent(); diff --git a/sapi/servlet/servlet.c b/sapi/servlet/servlet.c index 364d0c51b2..a8ecd3a8d9 100644 --- a/sapi/servlet/servlet.c +++ b/sapi/servlet/servlet.c @@ -318,8 +318,6 @@ JNIEXPORT void JNICALL Java_net_php_servlet_send char cwd[MAXPATHLEN]; #endif TSRMLS_FETCH(); - TSRMLS_FETCH(); - TSRMLS_FETCH(); zend_try { SG(server_context) = emalloc(sizeof(servlet_request)); @@ -379,7 +377,7 @@ JNIEXPORT void JNICALL Java_net_php_servlet_send if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) { php_get_highlight_struct(&syntax_highlighter_ini); - sapi_send_headers(); + sapi_send_headers(TSRMLS_C); zend_highlight(&syntax_highlighter_ini TSRMLS_CC); } } else { diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c index 215e4d5cbe..482e5be6df 100644 --- a/sapi/tux/php_tux.c +++ b/sapi/tux/php_tux.c @@ -186,7 +186,7 @@ static void sapi_tux_register_variables(zval *track_vars_array TSRMLS_DC) sprintf(buf, "Server: %s", TUXAPI_version); - sapi_add_header_ex(buf, strlen(buf), 1, 0); + sapi_add_header_ex(buf, strlen(buf), 1, 0 TSRMLS_CC); php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array TSRMLS_FETCH()CC TSRMLS_FETCH()CC); php_register_variable("SERVER_SOFTWARE", TUXAPI_version, track_vars_array TSRMLS_FETCH()CC TSRMLS_FETCH()CC); php_register_variable("GATEWAY_INTERFACE", "CGI/1.1", track_vars_array TSRMLS_FETCH()CC TSRMLS_FETCH()CC); -- 2.50.1