cvs: php4 /ext/ircg ircg.c /ext/standard basic_functions.c dir.c exec.c file.c filestat.c head.c iptc.c pageinfo.c /ext/zlib zlib.c /main SAPI.c
SAPI.h fopen_wrappers.c fopen_wrappers.h main.c output.c php_logos.c php_logos.h safe_mode.c /sapi/pi3web pi3web_sapi.c /sapi/servlet servlet.c
/sapi/tux php_tux.c
| From: | Zeev Suraski | Date: | Tue, 31 Jul 2001 06:28:06 +0000 |
| Subject: | cvs: php4 /ext/ircg ircg.c /ext/standard basic_functions.c dir.c exec.c file.c filestat.c head.c iptc.c pageinfo.c /ext/zlib zlib.c /main SAPI.c SAPI.h fopen_wrappers.c fopen_wrappers.h main.c output.c php_logos.c php_logos.h safe_mode.c /sapi/pi3web pi3web_sapi.c /sapi/servlet servlet.c /sapi/tux php_tux.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6438@lists.php.net to get a copy of this message | ||
zeev Tue Jul 31 02:28:06 2001 EDT
Modified files:
/php4/ext/ircg ircg.c
/php4/ext/standard basic_functions.c dir.c exec.c file.c filestat.c
head.c iptc.c pageinfo.c
/php4/ext/zlib zlib.c
/php4/main SAPI.c SAPI.h fopen_wrappers.c fopen_wrappers.h main.c
output.c php_logos.c php_logos.h safe_mode.c
/php4/sapi/pi3web pi3web_sapi.c
/php4/sapi/servlet servlet.c
/php4/sapi/tux php_tux.c
Log:
More TSRMLS_FETCH work. Got it under 400 now.
Index: php4/ext/ircg/ircg.c diff -u php4/ext/ircg/ircg.c:1.93 php4/ext/ircg/ircg.c:1.94 --- php4/ext/ircg/ircg.c:1.93 Mon Jul 30 13:04:53 2001 +++ php4/ext/ircg/ircg.c Tue Jul 31 02:28:03 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ircg.c,v 1.93 2001/07/30 17:04:53 sas Exp $ */ +/* $Id: ircg.c,v 1.94 2001/07/31 06:28:03 zeev Exp $ */ #include <time.h> @@ -538,10 +538,10 @@ #define ADD_HEADER(a) sapi_add_header(a, sizeof(a) - 1, 1) -static void msg_http_start(php_irconn_t *conn) +static void msg_http_start(php_irconn_t *conn TSRMLS_DC) { ADD_HEADER("Pragma: no-cache"); - sapi_send_headers(); + sapi_send_headers(TSRMLS_C); } static void http_closed_connection(int fd); @@ -1005,7 +1005,7 @@ } zend_hash_index_update(&h_fd2irconn, conn->fd, &Z_LVAL_PP(p1), sizeof(int), NULL); irc_write_buf_add(&conn->wb, conn->fd); - msg_http_start(conn); + msg_http_start(conn TSRMLS_CC); msg_replay_buffer(conn); irc_write_buf_flush(&conn->wb); Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.369 php4/ext/standard/basic_functions.c:1.370 --- php4/ext/standard/basic_functions.c:1.369 Tue Jul 31 00:53:49 2001 +++ php4/ext/standard/basic_functions.c Tue Jul 31 02:28:03 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.369 2001/07/31 04:53:49 zeev Exp $ */ +/* $Id: basic_functions.c,v 1.370 2001/07/31 06:28:03 zeev Exp $ */ #include "php.h" #include "php_main.h" @@ -779,13 +779,13 @@ #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 @@ #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 @@ } - 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 @@ Flush the output buffer */ PHP_FUNCTION(flush) { - sapi_flush(); + sapi_flush(TSRMLS_C); } /* }}} */ Index: php4/ext/standard/dir.c diff -u php4/ext/standard/dir.c:1.75 php4/ext/standard/dir.c:1.76 --- php4/ext/standard/dir.c:1.75 Tue Jul 31 01:44:06 2001 +++ php4/ext/standard/dir.c Tue Jul 31 02:28:03 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dir.c,v 1.75 2001/07/31 05:44:06 zeev Exp $ */ +/* $Id: dir.c,v 1.76 2001/07/31 06:28:03 zeev Exp $ */ /* {{{ includes/startup/misc */ @@ -148,7 +148,7 @@ } 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; } Index: php4/ext/standard/exec.c diff -u php4/ext/standard/exec.c:1.60 php4/ext/standard/exec.c:1.61 --- php4/ext/standard/exec.c:1.60 Mon Jul 30 05:16:44 2001 +++ php4/ext/standard/exec.c Tue Jul 31 02:28:03 2001 @@ -15,7 +15,7 @@ | Author: Rasmus Lerdorf | +----------------------------------------------------------------------+ */ -/* $Id: exec.c,v 1.60 2001/07/30 09:16:44 zeev Exp $ */ +/* $Id: exec.c,v 1.61 2001/07/31 06:28:03 zeev Exp $ */ #include <stdio.h> #include "php.h" @@ -175,7 +175,7 @@ if (type == 1) { if (output) PUTS(buf); - sapi_flush(); + sapi_flush(TSRMLS_C); } else if (type == 2) { /* strip trailing whitespaces */ Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.174 php4/ext/standard/file.c:1.175 --- php4/ext/standard/file.c:1.174 Tue Jul 31 01:44:06 2001 +++ php4/ext/standard/file.c Tue Jul 31 02:28:03 2001 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.174 2001/07/31 05:44:06 zeev Exp $ */ +/* $Id: file.c,v 1.175 2001/07/31 06:28:03 zeev Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -1907,7 +1907,7 @@ 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 @@ RETURN_FALSE; } - if (php_check_open_basedir((*target)->value.str.val)) { + if (php_check_open_basedir((*target)->value.str.val TSRMLS_CC)) { RETURN_FALSE; } Index: php4/ext/standard/filestat.c diff -u php4/ext/standard/filestat.c:1.73 php4/ext/standard/filestat.c:1.74 --- php4/ext/standard/filestat.c:1.73 Mon Jul 30 02:18:06 2001 +++ php4/ext/standard/filestat.c Tue Jul 31 02:28:03 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filestat.c,v 1.73 2001/07/30 06:18:06 zeev Exp $ */ +/* $Id: filestat.c,v 1.74 2001/07/31 06:28:03 zeev Exp $ */ #include "php.h" #include "safe_mode.h" @@ -141,7 +141,9 @@ 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 @@ 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 @@ } /* 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 @@ } /* 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 @@ } /* 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 @@ } /* 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; } Index: php4/ext/standard/head.c diff -u php4/ext/standard/head.c:1.46 php4/ext/standard/head.c:1.47 --- php4/ext/standard/head.c:1.46 Sat Jul 28 07:36:17 2001 +++ php4/ext/standard/head.c Tue Jul 31 02:28:03 2001 @@ -15,7 +15,7 @@ | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: head.c,v 1.46 2001/07/28 11:36:17 zeev Exp $ */ +/* $Id: head.c,v 1.47 2001/07/31 06:28:03 zeev Exp $ */ #include <stdio.h> #include "php.h" @@ -53,7 +53,7 @@ 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 @@ { 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 */ Index: php4/ext/standard/iptc.c diff -u php4/ext/standard/iptc.c:1.30 php4/ext/standard/iptc.c:1.31 --- php4/ext/standard/iptc.c:1.30 Fri Jul 13 10:35:05 2001 +++ php4/ext/standard/iptc.c Tue Jul 31 02:28:03 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: iptc.c,v 1.30 2001/07/13 14:35:05 thies Exp $ */ +/* $Id: iptc.c,v 1.31 2001/07/31 06:28:03 zeev Exp $ */ /* * Functions to parse & compse IPTC data. @@ -210,8 +210,9 @@ 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); Index: php4/ext/standard/pageinfo.c diff -u php4/ext/standard/pageinfo.c:1.25 php4/ext/standard/pageinfo.c:1.26 --- php4/ext/standard/pageinfo.c:1.25 Sat Jul 28 07:36:17 2001 +++ php4/ext/standard/pageinfo.c Tue Jul 31 02:28:03 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pageinfo.c,v 1.25 2001/07/28 11:36:17 zeev Exp $ */ +/* $Id: pageinfo.c,v 1.26 2001/07/31 06:28:03 zeev Exp $ */ #include "php.h" #include "pageinfo.h" @@ -47,7 +47,7 @@ { struct stat *pstat; - pstat = sapi_get_stat(); + pstat = sapi_get_stat(TSRMLS_C); if (BG(page_uid)==-1 || BG(page_gid)==-1) { if(pstat) { Index: php4/ext/zlib/zlib.c diff -u php4/ext/zlib/zlib.c:1.89 php4/ext/zlib/zlib.c:1.90 --- php4/ext/zlib/zlib.c:1.89 Tue Jul 31 01:44:10 2001 +++ php4/ext/zlib/zlib.c Tue Jul 31 02:28:03 2001 @@ -16,7 +16,7 @@ | Stefan Röhrich <sr@linux.de> | +----------------------------------------------------------------------+ */ -/* $Id: zlib.c,v 1.89 2001/07/31 05:44:10 zeev Exp $ */ +/* $Id: zlib.c,v 1.90 2001/07/31 06:28:03 zeev Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -165,7 +165,7 @@ #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 @@ { #if HAVE_FOPENCOOKIE if(PG(allow_url_fopen)) { - php_unregister_url_wrapper("zlib"); + php_unregister_url_wrapper("zlib" TSRMLS_CC); } #endif Index: php4/main/SAPI.c diff -u php4/main/SAPI.c:1.111 php4/main/SAPI.c:1.112 --- php4/main/SAPI.c:1.111 Tue Jul 31 00:53:51 2001 +++ php4/main/SAPI.c Tue Jul 31 02:28:03 2001 @@ -366,12 +366,11 @@ /* 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_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_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 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 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; Index: php4/main/SAPI.h diff -u php4/main/SAPI.h:1.72 php4/main/SAPI.h:1.73 --- php4/main/SAPI.h:1.72 Tue Jul 31 00:53:51 2001 +++ php4/main/SAPI.h Tue Jul 31 02:28:03 2001 @@ -130,10 +130,10 @@ 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 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); Index: php4/main/fopen_wrappers.c diff -u php4/main/fopen_wrappers.c:1.130 php4/main/fopen_wrappers.c:1.131 --- php4/main/fopen_wrappers.c:1.130 Mon Jul 30 04:24:39 2001 +++ php4/main/fopen_wrappers.c Tue Jul 31 02:28:04 2001 @@ -16,7 +16,7 @@ | Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: fopen_wrappers.c,v 1.130 2001/07/30 08:24:39 zeev Exp $ */ +/* $Id: fopen_wrappers.c,v 1.131 2001/07/31 06:28:04 zeev Exp $ */ /* {{{ includes */ @@ -90,10 +90,8 @@ /* {{{ 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 @@ /* {{{ 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 @@ /* {{{ 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 @@ /* {{{ 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 @@ 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); Index: php4/main/fopen_wrappers.h diff -u php4/main/fopen_wrappers.h:1.26 php4/main/fopen_wrappers.h:1.27 --- php4/main/fopen_wrappers.h:1.26 Sat Jul 28 07:36:27 2001 +++ php4/main/fopen_wrappers.h Tue Jul 31 02:28:04 2001 @@ -15,7 +15,7 @@ | Authors: Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: fopen_wrappers.h,v 1.26 2001/07/28 11:36:27 zeev Exp $ */ +/* $Id: fopen_wrappers.h,v 1.27 2001/07/31 06:28:04 zeev Exp $ */ #ifndef FOPEN_WRAPPERS_H #define FOPEN_WRAPPERS_H @@ -69,7 +69,7 @@ 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 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 /* Index: php4/main/main.c diff -u php4/main/main.c:1.391 php4/main/main.c:1.392 --- php4/main/main.c:1.391 Tue Jul 31 00:53:52 2001 +++ php4/main/main.c Tue Jul 31 02:28:04 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.391 2001/07/31 04:53:52 zeev Exp $ */ +/* $Id: main.c,v 1.392 2001/07/31 06:28:04 zeev Exp $ */ /* {{{ includes */ @@ -686,7 +686,7 @@ } 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 @@ /* 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 @@ #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 @@ { 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); Index: php4/main/output.c diff -u php4/main/output.c:1.68 php4/main/output.c:1.69 --- php4/main/output.c:1.68 Mon Jul 30 04:24:40 2001 +++ php4/main/output.c Tue Jul 31 02:28:04 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: output.c,v 1.68 2001/07/30 08:24:40 zeev Exp $ */ +/* $Id: output.c,v 1.69 2001/07/31 06:28:04 zeev Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -470,7 +470,7 @@ result = OG(php_header_write)(str, str_length); if (OG(implicit_flush)) { - sapi_flush(); + sapi_flush(TSRMLS_C); } return result; Index: php4/main/php_logos.c diff -u php4/main/php_logos.c:1.8 php4/main/php_logos.c:1.9 --- php4/main/php_logos.c:1.8 Wed Jun 6 09:05:53 2001 +++ php4/main/php_logos.c Tue Jul 31 02:28:04 2001 @@ -67,7 +67,7 @@ } #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; Index: php4/main/php_logos.h diff -u php4/main/php_logos.h:1.3 php4/main/php_logos.h:1.4 --- php4/main/php_logos.h:1.3 Mon May 21 13:48:49 2001 +++ php4/main/php_logos.h Tue Jul 31 02:28:04 2001 @@ -5,6 +5,6 @@ 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 */ Index: php4/main/safe_mode.c diff -u php4/main/safe_mode.c:1.35 php4/main/safe_mode.c:1.36 --- php4/main/safe_mode.c:1.35 Sat Jul 28 07:36:28 2001 +++ php4/main/safe_mode.c Tue Jul 31 02:28:04 2001 @@ -15,7 +15,7 @@ | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: safe_mode.c,v 1.35 2001/07/28 11:36:28 zeev Exp $ */ +/* $Id: safe_mode.c,v 1.36 2001/07/31 06:28:04 zeev Exp $ */ #include "php.h" @@ -166,7 +166,7 @@ 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; Index: php4/sapi/pi3web/pi3web_sapi.c diff -u php4/sapi/pi3web/pi3web_sapi.c:1.26 php4/sapi/pi3web/pi3web_sapi.c:1.27 --- php4/sapi/pi3web/pi3web_sapi.c:1.26 Tue Jul 31 00:53:53 2001 +++ php4/sapi/pi3web/pi3web_sapi.c Tue Jul 31 02:28:04 2001 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pi3web_sapi.c,v 1.26 2001/07/31 04:53:53 zeev Exp $ */ +/* $Id: pi3web_sapi.c,v 1.27 2001/07/31 06:28:04 zeev Exp $ */ #include "pi3web_sapi.h" #include "php.h" @@ -78,7 +78,7 @@ PUTS("<table border=0 cellpadding=3 cellspacing=1 width=600 align=center>\n"); PUTS("<tr><th colspan=2 bgcolor=\"" PHP_HEADER_COLOR "\">Pi3Web Server Information</th></tr>\n"); php_info_print_table_header(2, "Information Field", "Value"); - php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id: pi3web_sapi.c,v 1.26 2001/07/31 04:53:53 zeev Exp $"); + php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id: pi3web_sapi.c,v 1.27 2001/07/31 06:28:04 zeev Exp $"); php_info_print_table_row(2, "Server Name Stamp", HTTPCore_getServerStamp()); snprintf(variable_buf, 511, "%d", HTTPCore_debugEnabled()); php_info_print_table_row(2, "Debug Enabled", variable_buf); @@ -413,7 +413,7 @@ 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(); Index: php4/sapi/servlet/servlet.c diff -u php4/sapi/servlet/servlet.c:1.53 php4/sapi/servlet/servlet.c:1.54 --- php4/sapi/servlet/servlet.c:1.53 Tue Jul 31 00:53:54 2001 +++ php4/sapi/servlet/servlet.c Tue Jul 31 02:28:05 2001 @@ -318,8 +318,6 @@ char cwd[MAXPATHLEN]; #endif TSRMLS_FETCH(); - TSRMLS_FETCH(); - TSRMLS_FETCH(); zend_try { SG(server_context) = emalloc(sizeof(servlet_request)); @@ -379,7 +377,7 @@ 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 { Index: php4/sapi/tux/php_tux.c diff -u php4/sapi/tux/php_tux.c:1.4 php4/sapi/tux/php_tux.c:1.5 --- php4/sapi/tux/php_tux.c:1.4 Sat Jul 28 07:36:37 2001 +++ php4/sapi/tux/php_tux.c Tue Jul 31 02:28:05 2001 @@ -186,7 +186,7 @@ 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);
Index: php4/ext/ircg/ircg.c diff -u php4/ext/ircg/ircg.c:1.93 php4/ext/ircg/ircg.c:1.94 --- php4/ext/ircg/ircg.c:1.93 Mon Jul 30 13:04:53 2001 +++ php4/ext/ircg/ircg.c Tue Jul 31 02:28:03 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ircg.c,v 1.93 2001/07/30 17:04:53 sas Exp $ */ +/* $Id: ircg.c,v 1.94 2001/07/31 06:28:03 zeev Exp $ */ #include <time.h> @@ -538,10 +538,10 @@ #define ADD_HEADER(a) sapi_add_header(a, sizeof(a) - 1, 1) -static void msg_http_start(php_irconn_t *conn) +static void msg_http_start(php_irconn_t *conn TSRMLS_DC) { ADD_HEADER("Pragma: no-cache"); - sapi_send_headers(); + sapi_send_headers(TSRMLS_C); } static void http_closed_connection(int fd); @@ -1005,7 +1005,7 @@ } zend_hash_index_update(&h_fd2irconn, conn->fd, &Z_LVAL_PP(p1), sizeof(int), NULL); irc_write_buf_add(&conn->wb, conn->fd); - msg_http_start(conn); + msg_http_start(conn TSRMLS_CC); msg_replay_buffer(conn); irc_write_buf_flush(&conn->wb); Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.369 php4/ext/standard/basic_functions.c:1.370 --- php4/ext/standard/basic_functions.c:1.369 Tue Jul 31 00:53:49 2001 +++ php4/ext/standard/basic_functions.c Tue Jul 31 02:28:03 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.369 2001/07/31 04:53:49 zeev Exp $ */ +/* $Id: basic_functions.c,v 1.370 2001/07/31 06:28:03 zeev Exp $ */ #include "php.h" #include "php_main.h" @@ -779,13 +779,13 @@ #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 @@ #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 @@ } - 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 @@ Flush the output buffer */ PHP_FUNCTION(flush) { - sapi_flush(); + sapi_flush(TSRMLS_C); } /* }}} */ Index: php4/ext/standard/dir.c diff -u php4/ext/standard/dir.c:1.75 php4/ext/standard/dir.c:1.76 --- php4/ext/standard/dir.c:1.75 Tue Jul 31 01:44:06 2001 +++ php4/ext/standard/dir.c Tue Jul 31 02:28:03 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dir.c,v 1.75 2001/07/31 05:44:06 zeev Exp $ */ +/* $Id: dir.c,v 1.76 2001/07/31 06:28:03 zeev Exp $ */ /* {{{ includes/startup/misc */ @@ -148,7 +148,7 @@ } 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; } Index: php4/ext/standard/exec.c diff -u php4/ext/standard/exec.c:1.60 php4/ext/standard/exec.c:1.61 --- php4/ext/standard/exec.c:1.60 Mon Jul 30 05:16:44 2001 +++ php4/ext/standard/exec.c Tue Jul 31 02:28:03 2001 @@ -15,7 +15,7 @@ | Author: Rasmus Lerdorf | +----------------------------------------------------------------------+ */ -/* $Id: exec.c,v 1.60 2001/07/30 09:16:44 zeev Exp $ */ +/* $Id: exec.c,v 1.61 2001/07/31 06:28:03 zeev Exp $ */ #include <stdio.h> #include "php.h" @@ -175,7 +175,7 @@ if (type == 1) { if (output) PUTS(buf); - sapi_flush(); + sapi_flush(TSRMLS_C); } else if (type == 2) { /* strip trailing whitespaces */ Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.174 php4/ext/standard/file.c:1.175 --- php4/ext/standard/file.c:1.174 Tue Jul 31 01:44:06 2001 +++ php4/ext/standard/file.c Tue Jul 31 02:28:03 2001 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.174 2001/07/31 05:44:06 zeev Exp $ */ +/* $Id: file.c,v 1.175 2001/07/31 06:28:03 zeev Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -1907,7 +1907,7 @@ 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 @@ RETURN_FALSE; } - if (php_check_open_basedir((*target)->value.str.val)) { + if (php_check_open_basedir((*target)->value.str.val TSRMLS_CC)) { RETURN_FALSE; } Index: php4/ext/standard/filestat.c diff -u php4/ext/standard/filestat.c:1.73 php4/ext/standard/filestat.c:1.74 --- php4/ext/standard/filestat.c:1.73 Mon Jul 30 02:18:06 2001 +++ php4/ext/standard/filestat.c Tue Jul 31 02:28:03 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filestat.c,v 1.73 2001/07/30 06:18:06 zeev Exp $ */ +/* $Id: filestat.c,v 1.74 2001/07/31 06:28:03 zeev Exp $ */ #include "php.h" #include "safe_mode.h" @@ -141,7 +141,9 @@ 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 @@ 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 @@ } /* 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 @@ } /* 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 @@ } /* 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 @@ } /* 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; } Index: php4/ext/standard/head.c diff -u php4/ext/standard/head.c:1.46 php4/ext/standard/head.c:1.47 --- php4/ext/standard/head.c:1.46 Sat Jul 28 07:36:17 2001 +++ php4/ext/standard/head.c Tue Jul 31 02:28:03 2001 @@ -15,7 +15,7 @@ | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: head.c,v 1.46 2001/07/28 11:36:17 zeev Exp $ */ +/* $Id: head.c,v 1.47 2001/07/31 06:28:03 zeev Exp $ */ #include <stdio.h> #include "php.h" @@ -53,7 +53,7 @@ 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 @@ { 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 */ Index: php4/ext/standard/iptc.c diff -u php4/ext/standard/iptc.c:1.30 php4/ext/standard/iptc.c:1.31 --- php4/ext/standard/iptc.c:1.30 Fri Jul 13 10:35:05 2001 +++ php4/ext/standard/iptc.c Tue Jul 31 02:28:03 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: iptc.c,v 1.30 2001/07/13 14:35:05 thies Exp $ */ +/* $Id: iptc.c,v 1.31 2001/07/31 06:28:03 zeev Exp $ */ /* * Functions to parse & compse IPTC data. @@ -210,8 +210,9 @@ 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); Index: php4/ext/standard/pageinfo.c diff -u php4/ext/standard/pageinfo.c:1.25 php4/ext/standard/pageinfo.c:1.26 --- php4/ext/standard/pageinfo.c:1.25 Sat Jul 28 07:36:17 2001 +++ php4/ext/standard/pageinfo.c Tue Jul 31 02:28:03 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pageinfo.c,v 1.25 2001/07/28 11:36:17 zeev Exp $ */ +/* $Id: pageinfo.c,v 1.26 2001/07/31 06:28:03 zeev Exp $ */ #include "php.h" #include "pageinfo.h" @@ -47,7 +47,7 @@ { struct stat *pstat; - pstat = sapi_get_stat(); + pstat = sapi_get_stat(TSRMLS_C); if (BG(page_uid)==-1 || BG(page_gid)==-1) { if(pstat) { Index: php4/ext/zlib/zlib.c diff -u php4/ext/zlib/zlib.c:1.89 php4/ext/zlib/zlib.c:1.90 --- php4/ext/zlib/zlib.c:1.89 Tue Jul 31 01:44:10 2001 +++ php4/ext/zlib/zlib.c Tue Jul 31 02:28:03 2001 @@ -16,7 +16,7 @@ | Stefan Röhrich <sr@linux.de> | +----------------------------------------------------------------------+ */ -/* $Id: zlib.c,v 1.89 2001/07/31 05:44:10 zeev Exp $ */ +/* $Id: zlib.c,v 1.90 2001/07/31 06:28:03 zeev Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -165,7 +165,7 @@ #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 @@ { #if HAVE_FOPENCOOKIE if(PG(allow_url_fopen)) { - php_unregister_url_wrapper("zlib"); + php_unregister_url_wrapper("zlib" TSRMLS_CC); } #endif Index: php4/main/SAPI.c diff -u php4/main/SAPI.c:1.111 php4/main/SAPI.c:1.112 --- php4/main/SAPI.c:1.111 Tue Jul 31 00:53:51 2001 +++ php4/main/SAPI.c Tue Jul 31 02:28:03 2001 @@ -366,12 +366,11 @@ /* 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_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_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 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 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; Index: php4/main/SAPI.h diff -u php4/main/SAPI.h:1.72 php4/main/SAPI.h:1.73 --- php4/main/SAPI.h:1.72 Tue Jul 31 00:53:51 2001 +++ php4/main/SAPI.h Tue Jul 31 02:28:03 2001 @@ -130,10 +130,10 @@ 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 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); Index: php4/main/fopen_wrappers.c diff -u php4/main/fopen_wrappers.c:1.130 php4/main/fopen_wrappers.c:1.131 --- php4/main/fopen_wrappers.c:1.130 Mon Jul 30 04:24:39 2001 +++ php4/main/fopen_wrappers.c Tue Jul 31 02:28:04 2001 @@ -16,7 +16,7 @@ | Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: fopen_wrappers.c,v 1.130 2001/07/30 08:24:39 zeev Exp $ */ +/* $Id: fopen_wrappers.c,v 1.131 2001/07/31 06:28:04 zeev Exp $ */ /* {{{ includes */ @@ -90,10 +90,8 @@ /* {{{ 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 @@ /* {{{ 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 @@ /* {{{ 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 @@ /* {{{ 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 @@ 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); Index: php4/main/fopen_wrappers.h diff -u php4/main/fopen_wrappers.h:1.26 php4/main/fopen_wrappers.h:1.27 --- php4/main/fopen_wrappers.h:1.26 Sat Jul 28 07:36:27 2001 +++ php4/main/fopen_wrappers.h Tue Jul 31 02:28:04 2001 @@ -15,7 +15,7 @@ | Authors: Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: fopen_wrappers.h,v 1.26 2001/07/28 11:36:27 zeev Exp $ */ +/* $Id: fopen_wrappers.h,v 1.27 2001/07/31 06:28:04 zeev Exp $ */ #ifndef FOPEN_WRAPPERS_H #define FOPEN_WRAPPERS_H @@ -69,7 +69,7 @@ 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 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 /* Index: php4/main/main.c diff -u php4/main/main.c:1.391 php4/main/main.c:1.392 --- php4/main/main.c:1.391 Tue Jul 31 00:53:52 2001 +++ php4/main/main.c Tue Jul 31 02:28:04 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.391 2001/07/31 04:53:52 zeev Exp $ */ +/* $Id: main.c,v 1.392 2001/07/31 06:28:04 zeev Exp $ */ /* {{{ includes */ @@ -686,7 +686,7 @@ } 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 @@ /* 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 @@ #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 @@ { 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); Index: php4/main/output.c diff -u php4/main/output.c:1.68 php4/main/output.c:1.69 --- php4/main/output.c:1.68 Mon Jul 30 04:24:40 2001 +++ php4/main/output.c Tue Jul 31 02:28:04 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: output.c,v 1.68 2001/07/30 08:24:40 zeev Exp $ */ +/* $Id: output.c,v 1.69 2001/07/31 06:28:04 zeev Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -470,7 +470,7 @@ result = OG(php_header_write)(str, str_length); if (OG(implicit_flush)) { - sapi_flush(); + sapi_flush(TSRMLS_C); } return result; Index: php4/main/php_logos.c diff -u php4/main/php_logos.c:1.8 php4/main/php_logos.c:1.9 --- php4/main/php_logos.c:1.8 Wed Jun 6 09:05:53 2001 +++ php4/main/php_logos.c Tue Jul 31 02:28:04 2001 @@ -67,7 +67,7 @@ } #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; Index: php4/main/php_logos.h diff -u php4/main/php_logos.h:1.3 php4/main/php_logos.h:1.4 --- php4/main/php_logos.h:1.3 Mon May 21 13:48:49 2001 +++ php4/main/php_logos.h Tue Jul 31 02:28:04 2001 @@ -5,6 +5,6 @@ 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 */ Index: php4/main/safe_mode.c diff -u php4/main/safe_mode.c:1.35 php4/main/safe_mode.c:1.36 --- php4/main/safe_mode.c:1.35 Sat Jul 28 07:36:28 2001 +++ php4/main/safe_mode.c Tue Jul 31 02:28:04 2001 @@ -15,7 +15,7 @@ | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: safe_mode.c,v 1.35 2001/07/28 11:36:28 zeev Exp $ */ +/* $Id: safe_mode.c,v 1.36 2001/07/31 06:28:04 zeev Exp $ */ #include "php.h" @@ -166,7 +166,7 @@ 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; Index: php4/sapi/pi3web/pi3web_sapi.c diff -u php4/sapi/pi3web/pi3web_sapi.c:1.26 php4/sapi/pi3web/pi3web_sapi.c:1.27 --- php4/sapi/pi3web/pi3web_sapi.c:1.26 Tue Jul 31 00:53:53 2001 +++ php4/sapi/pi3web/pi3web_sapi.c Tue Jul 31 02:28:04 2001 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pi3web_sapi.c,v 1.26 2001/07/31 04:53:53 zeev Exp $ */ +/* $Id: pi3web_sapi.c,v 1.27 2001/07/31 06:28:04 zeev Exp $ */ #include "pi3web_sapi.h" #include "php.h" @@ -78,7 +78,7 @@ PUTS("<table border=0 cellpadding=3 cellspacing=1 width=600 align=center>\n"); PUTS("<tr><th colspan=2 bgcolor=\"" PHP_HEADER_COLOR "\">Pi3Web Server Information</th></tr>\n"); php_info_print_table_header(2, "Information Field", "Value"); - php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id: pi3web_sapi.c,v 1.26 2001/07/31 04:53:53 zeev Exp $"); + php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id: pi3web_sapi.c,v 1.27 2001/07/31 06:28:04 zeev Exp $"); php_info_print_table_row(2, "Server Name Stamp", HTTPCore_getServerStamp()); snprintf(variable_buf, 511, "%d", HTTPCore_debugEnabled()); php_info_print_table_row(2, "Debug Enabled", variable_buf); @@ -413,7 +413,7 @@ 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(); Index: php4/sapi/servlet/servlet.c diff -u php4/sapi/servlet/servlet.c:1.53 php4/sapi/servlet/servlet.c:1.54 --- php4/sapi/servlet/servlet.c:1.53 Tue Jul 31 00:53:54 2001 +++ php4/sapi/servlet/servlet.c Tue Jul 31 02:28:05 2001 @@ -318,8 +318,6 @@ char cwd[MAXPATHLEN]; #endif TSRMLS_FETCH(); - TSRMLS_FETCH(); - TSRMLS_FETCH(); zend_try { SG(server_context) = emalloc(sizeof(servlet_request)); @@ -379,7 +377,7 @@ 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 { Index: php4/sapi/tux/php_tux.c diff -u php4/sapi/tux/php_tux.c:1.4 php4/sapi/tux/php_tux.c:1.5 --- php4/sapi/tux/php_tux.c:1.4 Sat Jul 28 07:36:37 2001 +++ php4/sapi/tux/php_tux.c Tue Jul 31 02:28:05 2001 @@ -186,7 +186,7 @@ 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);