cvs: php4 /ext/sablot sablot.c /ext/session php_session.h session.c /ext/zlib php_zlib.h zlib.c /main SAPI.c SAPI.h main.c output.c php_output.h
/sapi/aolserver aolserver.c /sapi/apache mod_php4.c php_apache.c /sapi/apache2filter sapi_apache2.c /sapi/caudium caudium.c /sapi/cgi cgi_main.c
/sapi/fastcgi fastcgi.c /sapi/isapi php4isapi.c /sapi/nsapi nsapi.c /sapi/phttpd phttpd.c /sapi/pi3web pi3web_sapi.c /sapi/roxen roxen.c
/sapi/servlet servlet.c /sapi/thttpd thttpd.c /sapi/tux php_tux.c
| From: | Sascha Schumann | Date: | Sun, 05 Aug 2001 15:29:47 +0000 |
| Subject: | cvs: php4 /ext/sablot sablot.c /ext/session php_session.h session.c /ext/zlib php_zlib.h zlib.c /main SAPI.c SAPI.h main.c output.c php_output.h /sapi/aolserver aolserver.c /sapi/apache mod_php4.c php_apache.c /sapi/apache2filter sapi_apache2.c /sapi/caudium caudium.c /sapi/cgi cgi_main.c /sapi/fastcgi fastcgi.c /sapi/isapi php4isapi.c /sapi/nsapi nsapi.c /sapi/phttpd phttpd.c /sapi/pi3web pi3web_sapi.c /sapi/roxen roxen.c /sapi/servlet servlet.c /sapi/thttpd thttpd.c /sapi/tux php_tux.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6575@lists.php.net to get a copy of this message | ||
sas Sun Aug 5 11:29:47 2001 EDT
Modified files:
/php4/ext/sablot sablot.c
/php4/ext/session php_session.h session.c
/php4/ext/zlib php_zlib.h zlib.c
/php4/main SAPI.c SAPI.h main.c output.c php_output.h
/php4/sapi/aolserver aolserver.c
/php4/sapi/apache mod_php4.c php_apache.c
/php4/sapi/apache2filter sapi_apache2.c
/php4/sapi/caudium caudium.c
/php4/sapi/cgi cgi_main.c
/php4/sapi/fastcgi fastcgi.c
/php4/sapi/isapi php4isapi.c
/php4/sapi/nsapi nsapi.c
/php4/sapi/phttpd phttpd.c
/php4/sapi/pi3web pi3web_sapi.c
/php4/sapi/roxen roxen.c
/php4/sapi/servlet servlet.c
/php4/sapi/thttpd thttpd.c
/php4/sapi/tux php_tux.c
Log:
more tsrm cleanup
Index: php4/ext/sablot/sablot.c diff -u php4/ext/sablot/sablot.c:1.47 php4/ext/sablot/sablot.c:1.48 --- php4/ext/sablot/sablot.c:1.47 Tue Jul 31 01:44:04 2001 +++ php4/ext/sablot/sablot.c Sun Aug 5 11:29:37 2001 @@ -282,7 +282,7 @@ * Start output buffering, NULL signifies that no "user-space" output function * will be used. The 0 disables chunking */ - php_start_ob_buffer(NULL, 0); + php_start_ob_buffer(NULL, 0 TSRMLS_CC); } /* }}} */ @@ -345,7 +345,7 @@ * current output buffer (so we don't send data twice) */ if (tRes) - php_end_ob_buffer(0, 0); + php_end_ob_buffer(0, 0 TSRMLS_CC); PUTS(tRes); @@ -360,7 +360,7 @@ if (tRes) SablotFree(tRes); else - php_end_ob_buffer(1, 0); + php_end_ob_buffer(1, 0 TSRMLS_CC); } /* }}} */ Index: php4/ext/session/php_session.h diff -u php4/ext/session/php_session.h:1.48 php4/ext/session/php_session.h:1.49 --- php4/ext/session/php_session.h:1.48 Sun Aug 5 10:36:49 2001 +++ php4/ext/session/php_session.h Sun Aug 5 11:29:37 2001 @@ -146,7 +146,7 @@ #ifdef TRANS_SID void session_adapt_uris(const char *, size_t, char **, size_t * TSRMLS_DC); void session_adapt_url(const char *, size_t, char **, size_t * TSRMLS_DC); -void session_adapt_flush(int (*)(const char *, uint)); +void session_adapt_flush(int (*)(const char *, uint) TSRMLS_DC); #else #define session_adapt_uris(a,b,c,d) do { } while(0) #define session_adapt_url(a,b,c,d) do { } while(0) Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.230 php4/ext/session/session.c:1.231 --- php4/ext/session/session.c:1.230 Sun Aug 5 10:36:50 2001 +++ php4/ext/session/session.c Sun Aug 5 11:29:38 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: session.c,v 1.230 2001/08/05 14:36:50 sas Exp $ */ +/* $Id: session.c,v 1.231 2001/08/05 15:29:38 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -658,8 +658,8 @@ php_session_cache_limiter_t *lim; if (SG(headers_sent)) { - char *output_start_filename = php_get_output_start_filename(); - int output_start_lineno = php_get_output_start_lineno(); + char *output_start_filename = php_get_output_start_filename(TSRMLS_C); + int output_start_lineno = php_get_output_start_lineno(TSRMLS_C); if (output_start_filename) { php_error(E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)", @@ -692,8 +692,8 @@ char *date_fmt = NULL; if (SG(headers_sent)) { - char *output_start_filename = php_get_output_start_filename(); - int output_start_lineno = php_get_output_start_lineno(); + char *output_start_filename = php_get_output_start_filename(TSRMLS_C); + int output_start_lineno = php_get_output_start_lineno(TSRMLS_C); if (output_start_filename) { php_error(E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)", @@ -1280,13 +1280,13 @@ *new = url_adapt_single_url(url, urllen, PS(session_name), PS(id), newlen); } -void session_adapt_flush(int (*write)(const char *, uint)) +void session_adapt_flush(int (*write)(const char *, uint TSRMLS_DC) TSRMLS_DC) { char *str; size_t len; str = url_adapt_flush(&len); - if (str) write(str, len); + if (str) write(str, len TSRMLS_CC); } #endif Index: php4/ext/zlib/php_zlib.h diff -u php4/ext/zlib/php_zlib.h:1.19 php4/ext/zlib/php_zlib.h:1.20 --- php4/ext/zlib/php_zlib.h:1.19 Tue Jul 31 19:32:24 2001 +++ php4/ext/zlib/php_zlib.h Sun Aug 5 11:29:39 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_zlib.h,v 1.19 2001/07/31 23:32:24 zeev Exp $ */ +/* $Id: php_zlib.h,v 1.20 2001/08/05 15:29:39 sas Exp $ */ #ifndef PHP_ZLIB_H #define PHP_ZLIB_H @@ -65,7 +65,7 @@ PHP_FUNCTION(ob_gzhandler); FILE *zlib_fopen_wrapper(const char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC); -int php_enable_output_compression(int buffer_size); +int php_enable_output_compression(int buffer_size TSRMLS_DC); #ifdef ZTS Index: php4/ext/zlib/zlib.c diff -u php4/ext/zlib/zlib.c:1.91 php4/ext/zlib/zlib.c:1.92 --- php4/ext/zlib/zlib.c:1.91 Tue Jul 31 03:09:46 2001 +++ php4/ext/zlib/zlib.c Sun Aug 5 11:29:39 2001 @@ -16,7 +16,7 @@ | Stefan Röhrich <sr@linux.de> | +----------------------------------------------------------------------+ */ -/* $Id: zlib.c,v 1.91 2001/07/31 07:09:46 zeev Exp $ */ +/* $Id: zlib.c,v 1.92 2001/08/05 15:29:39 sas Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -187,10 +187,10 @@ case 0: break; case 1: - php_enable_output_compression(4096); + php_enable_output_compression(4096 TSRMLS_CC); break; default: - php_enable_output_compression(ZLIBG(output_compression)); + php_enable_output_compression(ZLIBG(output_compression) TSRMLS_CC); } return SUCCESS; } @@ -1025,10 +1025,9 @@ /* {{{ php_deflate_string */ -int php_deflate_string(const char *str, uint str_length, char **newstr, uint *new_length, int coding, zend_bool do_start, zend_bool do_end) +int php_deflate_string(const char *str, uint str_length, char **newstr, uint *new_length, int coding, zend_bool do_start, zend_bool do_end TSRMLS_DC) { int err; - TSRMLS_FETCH(); ZLIBG(compression_coding) = coding; @@ -1127,7 +1126,7 @@ ZEND_WRONG_PARAM_COUNT(); break; } - if (php_deflate_string(Z_STRVAL_PP(zv_string), Z_STRLEN_PP(zv_string), &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), coding, 1, 1)==SUCCESS) { + if (php_deflate_string(Z_STRVAL_PP(zv_string), Z_STRLEN_PP(zv_string), &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), coding, 1, 1 TSRMLS_CC)==SUCCESS) { Z_TYPE_P(return_value) = IS_STRING; } else { RETURN_FALSE; @@ -1173,7 +1172,7 @@ do_end = ((Z_LVAL_PP(zv_mode) & PHP_OUTPUT_HANDLER_END) ? 1 : 0); Z_STRVAL_P(return_value) = NULL; Z_STRLEN_P(return_value) = 0; - if (php_deflate_string(Z_STRVAL_PP(zv_string), Z_STRLEN_PP(zv_string), &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), coding, do_start, do_end)==SUCCESS) { + if (php_deflate_string(Z_STRVAL_PP(zv_string), Z_STRLEN_PP(zv_string), &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), coding, do_start, do_end TSRMLS_CC)==SUCCESS) { Z_TYPE_P(return_value) = IS_STRING; if (do_start) { switch (coding) { @@ -1223,14 +1222,13 @@ /* {{{ php_gzip_output_handler */ -static void php_gzip_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode) +static void php_gzip_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) { zend_bool do_start, do_end; - TSRMLS_FETCH(); do_start = (mode & PHP_OUTPUT_HANDLER_START ? 1 : 0); do_end = (mode & PHP_OUTPUT_HANDLER_END ? 1 : 0); - if (php_deflate_string(output, output_len, handled_output, handled_output_len, ZLIBG(ob_gzip_coding), do_start, do_end)!=SUCCESS) { + if (php_deflate_string(output, output_len, handled_output, handled_output_len, ZLIBG(ob_gzip_coding), do_start, do_end TSRMLS_CC)!=SUCCESS) { zend_error(E_ERROR, "Compression failed"); } } @@ -1238,10 +1236,9 @@ /* {{{ php_enable_output_compression */ -int php_enable_output_compression(int buffer_size) +int php_enable_output_compression(int buffer_size TSRMLS_DC) { zval **a_encoding, **data; - TSRMLS_FETCH(); if (zend_hash_find(&EG(symbol_table), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), (void **) &data)==FAILURE || Z_TYPE_PP(data)!=IS_ARRAY @@ -1263,8 +1260,8 @@ return FAILURE; } - php_start_ob_buffer(NULL, buffer_size); - php_ob_set_internal_handler(php_gzip_output_handler, buffer_size*1.5); + php_start_ob_buffer(NULL, buffer_size TSRMLS_CC); + php_ob_set_internal_handler(php_gzip_output_handler, buffer_size*1.5 TSRMLS_CC); return SUCCESS; } /* }}} */ Index: php4/main/SAPI.c diff -u php4/main/SAPI.c:1.112 php4/main/SAPI.c:1.113 --- php4/main/SAPI.c:1.112 Tue Jul 31 02:28:03 2001 +++ php4/main/SAPI.c Sun Aug 5 11:29:39 2001 @@ -373,8 +373,8 @@ char *colon_offset; if (SG(headers_sent) && !SG(request_info).no_headers) { - char *output_start_filename = php_get_output_start_filename(); - int output_start_lineno = php_get_output_start_lineno(); + char *output_start_filename = php_get_output_start_filename(TSRMLS_C); + int output_start_lineno = php_get_output_start_lineno(TSRMLS_C); if (output_start_filename) { sapi_module.sapi_error(E_WARNING, "Cannot add header information - headers already sent by (output started at %s:%d)", Index: php4/main/SAPI.h diff -u php4/main/SAPI.h:1.73 php4/main/SAPI.h:1.74 --- php4/main/SAPI.h:1.73 Tue Jul 31 02:28:03 2001 +++ php4/main/SAPI.h Sun Aug 5 11:29:39 2001 @@ -160,7 +160,7 @@ int (*activate)(TSRMLS_D); int (*deactivate)(TSRMLS_D); - int (*ub_write)(const char *str, unsigned int str_length); + int (*ub_write)(const char *str, unsigned int str_length TSRMLS_DC); void (*flush)(void *server_context); struct stat *(*get_stat)(TSRMLS_D); char *(*getenv)(char *name, size_t name_len TSRMLS_DC); Index: php4/main/main.c diff -u php4/main/main.c:1.395 php4/main/main.c:1.396 --- php4/main/main.c:1.395 Sat Aug 4 21:42:44 2001 +++ php4/main/main.c Sun Aug 5 11:29:39 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.395 2001/08/05 01:42:44 zeev Exp $ */ +/* $Id: main.c,v 1.396 2001/08/05 15:29:39 sas Exp $ */ /* {{{ includes */ @@ -622,7 +622,7 @@ zend_try { PG(during_request_startup) = 1; - php_output_activate(); + php_output_activate(TSRMLS_C); /* initialize global variables */ PG(modules_activated) = 0; @@ -645,11 +645,11 @@ Z_STRLEN_P(output_handler) = strlen(PG(output_handler)); /* this can be optimized */ Z_STRVAL_P(output_handler) = estrndup(PG(output_handler), Z_STRLEN_P(output_handler)); Z_TYPE_P(output_handler) = IS_STRING; - php_start_ob_buffer(output_handler, 0); + php_start_ob_buffer(output_handler, 0 TSRMLS_CC); } else if (PG(output_buffering)) { - php_start_ob_buffer(NULL, 0); + php_start_ob_buffer(NULL, 0 TSRMLS_CC); } else if (PG(implicit_flush)) { - php_start_implicit_flush(); + php_start_implicit_flush(TSRMLS_C); } /* We turn this off in php_execute_script() */ @@ -683,7 +683,7 @@ TSRMLS_FETCH(); zend_try { - php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1)); + php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1) TSRMLS_CC); } zend_end_try(); zend_try { @@ -800,7 +800,7 @@ sapi_module = *sf; php_output_startup(); - php_output_activate(); + php_output_activate(TSRMLS_C); zuf.error_function = php_error_cb; zuf.printf_function = php_printf; @@ -883,7 +883,7 @@ REGISTER_MAIN_STRINGL_CONSTANT("PHP_SYSCONFDIR", PHP_SYSCONFDIR, sizeof(PHP_SYSCONFDIR)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT("PHP_LOCALSTATEDIR", PHP_LOCALSTATEDIR, sizeof(PHP_LOCALSTATEDIR)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT("PHP_CONFIG_FILE_PATH", PHP_CONFIG_FILE_PATH, sizeof(PHP_CONFIG_FILE_PATH)-1, CONST_PERSISTENT | CONST_CS); - php_output_register_constants(); + php_output_register_constants(TSRMLS_C); if (php_startup_ticks(TSRMLS_C) == FAILURE) { php_printf("Unable to start PHP ticks\n"); @@ -1249,7 +1249,7 @@ TSRMLS_FETCH(); PG(connection_status) = PHP_CONNECTION_ABORTED; - php_output_set_status(0); + php_output_set_status(0 TSRMLS_CC); if (!PG(ignore_user_abort)) { zend_bailout(); Index: php4/main/output.c diff -u php4/main/output.c:1.71 php4/main/output.c:1.72 --- php4/main/output.c:1.71 Sun Aug 5 10:36:51 2001 +++ php4/main/output.c Sun Aug 5 11:29:40 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: output.c,v 1.71 2001/08/05 14:36:51 sas Exp $ */ +/* $Id: output.c,v 1.72 2001/08/05 15:29:40 sas Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -26,12 +26,12 @@ #include "SAPI.h" /* output functions */ -static int php_ub_body_write(const char *str, uint str_length); -static int php_ub_body_write_no_header(const char *str, uint str_length); -static int php_b_body_write(const char *str, uint str_length); +static int php_ub_body_write(const char *str, uint str_length TSRMLS_DC); +static int php_ub_body_write_no_header(const char *str, uint str_length TSRMLS_DC); +static int php_b_body_write(const char *str, uint str_length TSRMLS_DC); -static void php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size); -static void php_ob_append(const char *text, uint text_length); +static void php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size TSRMLS_DC); +static void php_ob_append(const char *text, uint text_length TSRMLS_DC); #if 0 static void php_ob_prepend(const char *text, uint text_length); #endif @@ -43,7 +43,7 @@ php_output_globals output_globals; #endif -static int php_default_output_func(const char *str, uint str_len) +static int php_default_output_func(const char *str, uint str_len TSRMLS_DC) { fwrite(str, 1, str_len, stderr); return str_len; @@ -71,10 +71,8 @@ } -PHPAPI void php_output_activate(void) +PHPAPI void php_output_activate(TSRMLS_D) { - TSRMLS_FETCH(); - OG(php_body_write) = php_ub_body_write; OG(php_header_write) = sapi_module.ub_write; OG(ob_nesting_level) = 0; @@ -83,18 +81,14 @@ } -PHPAPI void php_output_set_status(zend_bool status) +PHPAPI void php_output_set_status(zend_bool status TSRMLS_DC) { - TSRMLS_FETCH(); - OG(disable_output) = !status; } -void php_output_register_constants() +void php_output_register_constants(TSRMLS_D) { - TSRMLS_FETCH(); - REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_START", PHP_OUTPUT_HANDLER_START, CONST_CS | CONST_PERSISTENT); REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_CONT", PHP_OUTPUT_HANDLER_CONT, CONST_CS | CONST_PERSISTENT); REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_END", PHP_OUTPUT_HANDLER_END, CONST_CS | CONST_PERSISTENT); @@ -104,7 +98,7 @@ PHPAPI int php_body_write(const char *str, uint str_length) { TSRMLS_FETCH(); - return OG(php_body_write)(str, str_length); + return OG(php_body_write)(str, str_length TSRMLS_CC); } PHPAPI int php_header_write(const char *str, uint str_length) @@ -113,23 +107,21 @@ if (OG(disable_output)) { return 0; } else { - return OG(php_header_write)(str, str_length); + return OG(php_header_write)(str, str_length TSRMLS_CC); } } /* {{{ php_start_ob_buffer * Start output buffering */ -PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size) +PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size TSRMLS_DC) { - TSRMLS_FETCH(); - if (OG(ob_lock)) { return FAILURE; } if (chunk_size) { - php_ob_init((chunk_size*3/2), chunk_size/2, output_handler, chunk_size); + php_ob_init((chunk_size*3/2), chunk_size/2, output_handler, chunk_size TSRMLS_CC); } else { - php_ob_init(40*1024, 10*1024, output_handler, chunk_size); + php_ob_init(40*1024, 10*1024, output_handler, chunk_size TSRMLS_CC); } OG(php_body_write) = php_b_body_write; return SUCCESS; @@ -138,7 +130,7 @@ /* {{{ php_end_ob_buffer * End output buffering (one level) */ -PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush) +PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS_DC) { char *final_buffer=NULL; int final_buffer_length=0; @@ -146,7 +138,6 @@ char *to_be_destroyed_buffer; char *to_be_destroyed_handled_output[2] = { 0, 0 }; int status; - TSRMLS_FETCH(); if (OG(ob_nesting_level)==0) { return; @@ -165,12 +156,11 @@ if (OG(active_ob_buffer).internal_output_handler) { final_buffer = OG(active_ob_buffer).internal_output_handler_buffer; final_buffer_length = OG(active_ob_buffer).internal_output_handler_buffer_size; - OG(active_ob_buffer).internal_output_handler(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, &final_buffer, &final_buffer_length, status); + OG(active_ob_buffer).internal_output_handler(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, &final_buffer, &final_buffer_length, status TSRMLS_CC); } else if (OG(active_ob_buffer).output_handler) { zval **params[2]; zval *orig_buffer; zval *z_status; - TSRMLS_FETCH(); ALLOC_INIT_ZVAL(orig_buffer); ZVAL_STRINGL(orig_buffer, OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, 0); @@ -235,7 +225,7 @@ } if (send_buffer) { - OG(php_body_write)(final_buffer, final_buffer_length); + OG(php_body_write)(final_buffer, final_buffer_length TSRMLS_CC); } if (alternate_buffer) { @@ -260,47 +250,39 @@ /* {{{ php_end_ob_buffers * End output buffering (all buffers) */ -PHPAPI void php_end_ob_buffers(zend_bool send_buffer) +PHPAPI void php_end_ob_buffers(zend_bool send_buffer TSRMLS_DC) { - TSRMLS_FETCH(); - while (OG(ob_nesting_level)!=0) { - php_end_ob_buffer(send_buffer, 0); + php_end_ob_buffer(send_buffer, 0 TSRMLS_CC); } if (!OG(disable_output) && send_buffer && BG(use_trans_sid)) { - session_adapt_flush(OG(php_header_write)); + session_adapt_flush(OG(php_header_write) TSRMLS_CC); } } /* }}} */ /* {{{ php_start_implicit_flush */ -PHPAPI void php_start_implicit_flush() +PHPAPI void php_start_implicit_flush(TSRMLS_D) { - TSRMLS_FETCH(); - - php_end_ob_buffer(1, 0); /* Switch out of output buffering if we're in it */ + php_end_ob_buffer(1, 0 TSRMLS_CC); /* Switch out of output buffering if we're in it */ OG(implicit_flush)=1; } /* }}} */ /* {{{ php_end_implicit_flush */ -PHPAPI void php_end_implicit_flush() +PHPAPI void php_end_implicit_flush(TSRMLS_D) { - TSRMLS_FETCH(); - OG(implicit_flush)=0; } /* }}} */ /* {{{ php_ob_set_internal_handler */ -PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size) +PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size TSRMLS_DC) { - TSRMLS_FETCH(); - if (OG(ob_nesting_level)==0) { return; } @@ -317,10 +299,8 @@ /* {{{ php_ob_allocate */ -static inline void php_ob_allocate(void) +static inline void php_ob_allocate(TSRMLS_D) { - TSRMLS_FETCH(); - if (OG(active_ob_buffer).size<OG(active_ob_buffer).text_length) { while (OG(active_ob_buffer).size <= OG(active_ob_buffer).text_length) { OG(active_ob_buffer).size+=OG(active_ob_buffer).block_size; @@ -333,10 +313,8 @@ /* {{{ php_ob_init */ -static void php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size) +static void php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size TSRMLS_DC) { - TSRMLS_FETCH(); - if (OG(ob_nesting_level)>0) { if (OG(ob_nesting_level)==1) { /* initialize stack */ zend_stack_init(&OG(ob_buffers)); @@ -357,16 +335,15 @@ /* {{{ php_ob_append */ -static void php_ob_append(const char *text, uint text_length) +static void php_ob_append(const char *text, uint text_length TSRMLS_DC) { char *target; int original_ob_text_length; - TSRMLS_FETCH(); original_ob_text_length=OG(active_ob_buffer).text_length; OG(active_ob_buffer).text_length = OG(active_ob_buffer).text_length + text_length; - php_ob_allocate(); + php_ob_allocate(TSRMLS_C); target = OG(active_ob_buffer).buffer+original_ob_text_length; memcpy(target, text, text_length); target[text_length]=0; @@ -378,7 +355,7 @@ if (output_handler) { output_handler->refcount++; } - php_end_ob_buffer(1, 1); + php_end_ob_buffer(1, 1 TSRMLS_CC); return; } } @@ -391,7 +368,7 @@ TSRMLS_FETCH(); OG(active_ob_buffer).text_length += text_length; - php_ob_allocate(); + php_ob_allocate(TSRMLS_C); /* php_ob_allocate() may change OG(ob_buffer), so we can't initialize p&start earlier */ p = OG(ob_buffer)+OG(ob_text_length); @@ -408,10 +385,8 @@ /* {{{ php_ob_get_buffer * Return the current output buffer */ -int php_ob_get_buffer(pval *p) +int php_ob_get_buffer(pval *p TSRMLS_DC) { - TSRMLS_FETCH(); - if (OG(ob_nesting_level)==0) { return FAILURE; } @@ -422,10 +397,8 @@ /* {{{ php_ob_get_length * Return the size of the current output buffer */ -int php_ob_get_length(pval *p) +int php_ob_get_length(pval *p TSRMLS_DC) { - TSRMLS_FETCH(); - if (OG(ob_nesting_level) == 0) { return FAILURE; } @@ -440,20 +413,19 @@ /* buffered output function */ -static int php_b_body_write(const char *str, uint str_length) +static int php_b_body_write(const char *str, uint str_length TSRMLS_DC) { - php_ob_append(str, str_length); + php_ob_append(str, str_length TSRMLS_CC); return str_length; } /* {{{ php_ub_body_write_no_header */ -static int php_ub_body_write_no_header(const char *str, uint str_length) +static int php_ub_body_write_no_header(const char *str, uint str_length TSRMLS_DC) { char *newstr = NULL; size_t new_length=0; int result; - TSRMLS_FETCH(); if (OG(disable_output)) { return 0; @@ -467,7 +439,7 @@ str_length = new_length; } - result = OG(php_header_write)(str, str_length); + result = OG(php_header_write)(str, str_length TSRMLS_CC); if (OG(implicit_flush)) { sapi_flush(TSRMLS_C); @@ -479,10 +451,9 @@ /* {{{ php_ub_body_write */ -static int php_ub_body_write(const char *str, uint str_length) +static int php_ub_body_write(const char *str, uint str_length TSRMLS_DC) { int result = 0; - TSRMLS_FETCH(); if (SG(request_info).headers_only) { php_header(); @@ -498,7 +469,7 @@ } OG(php_body_write) = php_ub_body_write_no_header; - result = php_ub_body_write_no_header(str, str_length); + result = php_ub_body_write_no_header(str, str_length TSRMLS_CC); } return result; @@ -548,9 +519,7 @@ ZEND_WRONG_PARAM_COUNT(); break; } - if (php_start_ob_buffer(output_handler, chunk_size)==FAILURE) { - TSRMLS_FETCH(); - + if (php_start_ob_buffer(output_handler, chunk_size TSRMLS_CC)==FAILURE) { if (SG(headers_sent) && !SG(request_info).headers_only) { OG(php_body_write) = php_ub_body_write_no_header; } else { @@ -568,7 +537,7 @@ Flush (send) the output buffer, and turn off output buffering */ PHP_FUNCTION(ob_end_flush) { - php_end_ob_buffer(1, 0); + php_end_ob_buffer(1, 0 TSRMLS_CC); } /* }}} */ @@ -576,7 +545,7 @@ Clean (erase) the output buffer, and turn off output buffering */ PHP_FUNCTION(ob_end_clean) { - php_end_ob_buffer(0, 0); + php_end_ob_buffer(0, 0 TSRMLS_CC); } /* }}} */ @@ -584,7 +553,7 @@ Return the contents of the output buffer */ PHP_FUNCTION(ob_get_contents) { - if (php_ob_get_buffer(return_value)==FAILURE) { + if (php_ob_get_buffer(return_value TSRMLS_CC)==FAILURE) { RETURN_FALSE; } } @@ -594,7 +563,7 @@ Return the length of the output buffer */ PHP_FUNCTION(ob_get_length) { - if (php_ob_get_length(return_value)==FAILURE) { + if (php_ob_get_length(return_value TSRMLS_CC)==FAILURE) { RETURN_FALSE; } } @@ -623,25 +592,21 @@ break; } if (flag) { - php_start_implicit_flush(); + php_start_implicit_flush(TSRMLS_C); } else { - php_end_implicit_flush(); + php_end_implicit_flush(TSRMLS_C); } } /* }}} */ -PHPAPI char *php_get_output_start_filename() +PHPAPI char *php_get_output_start_filename(TSRMLS_D) { - TSRMLS_FETCH(); - return OG(output_start_filename); } -PHPAPI int php_get_output_start_lineno() +PHPAPI int php_get_output_start_lineno(TSRMLS_D) { - TSRMLS_FETCH(); - return OG(output_start_lineno); } Index: php4/main/php_output.h diff -u php4/main/php_output.h:1.28 php4/main/php_output.h:1.29 --- php4/main/php_output.h:1.28 Sat Jul 28 07:36:28 2001 +++ php4/main/php_output.h Sun Aug 5 11:29:40 2001 @@ -16,31 +16,31 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_output.h,v 1.28 2001/07/28 11:36:28 zeev Exp $ */ +/* $Id: php_output.h,v 1.29 2001/08/05 15:29:40 sas Exp $ */ #ifndef PHP_OUTPUT_H #define PHP_OUTPUT_H #include "php.h" -typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode); +typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC); PHPAPI void php_output_startup(void); -PHPAPI void php_output_activate(void); -PHPAPI void php_output_set_status(zend_bool status); -void php_output_register_constants(void); +PHPAPI void php_output_activate(TSRMLS_D); +PHPAPI void php_output_set_status(zend_bool status TSRMLS_DC); +void php_output_register_constants(TSRMLS_D); PHPAPI int php_body_write(const char *str, uint str_length); PHPAPI int php_header_write(const char *str, uint str_length); -PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size); -PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush); -PHPAPI void php_end_ob_buffers(zend_bool send_buffer); -PHPAPI int php_ob_get_buffer(pval *p); -PHPAPI int php_ob_get_length(pval *p); -PHPAPI void php_start_implicit_flush(void); -PHPAPI void php_end_implicit_flush(void); -PHPAPI char *php_get_output_start_filename(void); -PHPAPI int php_get_output_start_lineno(void); -PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size); +PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size TSRMLS_DC); +PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS_DC); +PHPAPI void php_end_ob_buffers(zend_bool send_buffer TSRMLS_DC); +PHPAPI int php_ob_get_buffer(zval *p TSRMLS_DC); +PHPAPI int php_ob_get_length(zval *p TSRMLS_DC); +PHPAPI void php_start_implicit_flush(TSRMLS_D); +PHPAPI void php_end_implicit_flush(TSRMLS_D); +PHPAPI char *php_get_output_start_filename(TSRMLS_D); +PHPAPI int php_get_output_start_lineno(TSRMLS_D); +PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size TSRMLS_DC); PHP_FUNCTION(ob_start); PHP_FUNCTION(ob_end_flush); @@ -63,8 +63,8 @@ } php_ob_buffer; typedef struct _php_output_globals { - int (*php_body_write)(const char *str, uint str_length); /* string output */ - int (*php_header_write)(const char *str, uint str_length); /* unbuffer string output */ + int (*php_body_write)(const char *str, uint str_length TSRMLS_DC); /* string output */ + int (*php_header_write)(const char *str, uint str_length TSRMLS_DC); /* unbuffer string output */ php_ob_buffer active_ob_buffer; unsigned char implicit_flush; char *output_start_filename; Index: php4/sapi/aolserver/aolserver.c diff -u php4/sapi/aolserver/aolserver.c:1.60 php4/sapi/aolserver/aolserver.c:1.61 --- php4/sapi/aolserver/aolserver.c:1.60 Sun Aug 5 10:27:38 2001 +++ php4/sapi/aolserver/aolserver.c Sun Aug 5 11:29:40 2001 @@ -22,7 +22,7 @@ * - CGI/1.1 conformance */ -/* $Id: aolserver.c,v 1.60 2001/08/05 14:27:38 sas Exp $ */ +/* $Id: aolserver.c,v 1.61 2001/08/05 15:29:40 sas Exp $ */ /* conflict between PHP and AOLserver headers */ #define Debug php_Debug @@ -86,11 +86,10 @@ */ static int -php_ns_sapi_ub_write(const char *str, uint str_length) +php_ns_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) { int n; uint sent = 0; - TSRMLS_FETCH(); while (str_length > 0) { n = Ns_ConnWrite(NSG(conn), (void *) str, str_length); @@ -213,7 +212,7 @@ TSRMLS_FETCH(); php_info_print_table_start(); - php_info_print_table_row(2, "SAPI module version", "$Id: aolserver.c,v 1.60 2001/08/05 14:27:38 sas Exp $"); + php_info_print_table_row(2, "SAPI module version", "$Id: aolserver.c,v 1.61 2001/08/05 15:29:40 sas Exp $"); php_info_print_table_row(2, "Build date", Ns_InfoBuildDate()); php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile()); php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog()); Index: php4/sapi/apache/mod_php4.c diff -u php4/sapi/apache/mod_php4.c:1.116 php4/sapi/apache/mod_php4.c:1.117 --- php4/sapi/apache/mod_php4.c:1.116 Sat Aug 4 21:42:45 2001 +++ php4/sapi/apache/mod_php4.c Sun Aug 5 11:29:40 2001 @@ -17,7 +17,7 @@ | PHP 4.0 patches by Zeev Suraski <zeev@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: mod_php4.c,v 1.116 2001/08/05 01:42:45 zeev Exp $ */ +/* $Id: mod_php4.c,v 1.117 2001/08/05 15:29:40 sas Exp $ */ #define NO_REGEX_EXTRA_H #ifdef WIN32 @@ -124,10 +124,9 @@ /* {{{ sapi_apache_ub_write */ -static int sapi_apache_ub_write(const char *str, uint str_length) +static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC) { int ret=0; - TSRMLS_FETCH(); if (SG(server_context)) { ret = rwrite(str, str_length, (request_rec *) SG(server_context)); @@ -311,7 +310,7 @@ { TSRMLS_FETCH(); - php_output_set_status(0); + php_output_set_status(0 TSRMLS_CC); SG(server_context) = NULL; /* The server context (request) is invalid by the time run_cleanups() is called */ if (AP(in_request)) { AP(in_request) = 0; Index: php4/sapi/apache/php_apache.c diff -u php4/sapi/apache/php_apache.c:1.41 php4/sapi/apache/php_apache.c:1.42 --- php4/sapi/apache/php_apache.c:1.41 Sat Aug 4 21:42:45 2001 +++ php4/sapi/apache/php_apache.c Sun Aug 5 11:29:41 2001 @@ -17,7 +17,7 @@ | David Sklar <sklar@student.net> | +----------------------------------------------------------------------+ */ -/* $Id: php_apache.c,v 1.41 2001/08/05 01:42:45 zeev Exp $ */ +/* $Id: php_apache.c,v 1.42 2001/08/05 15:29:41 sas Exp $ */ #define NO_REGEX_EXTRA_H @@ -302,7 +302,6 @@ { pval **filename; request_rec *rr = NULL; - TSRMLS_FETCH(); if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { WRONG_PARAM_COUNT; @@ -321,7 +320,7 @@ RETURN_FALSE; } - php_end_ob_buffers(1); + php_end_ob_buffers(1 TSRMLS_CC); php_header(); if (run_sub_req(rr)) { Index: php4/sapi/apache2filter/sapi_apache2.c diff -u php4/sapi/apache2filter/sapi_apache2.c:1.38 php4/sapi/apache2filter/sapi_apache2.c:1.39 --- php4/sapi/apache2filter/sapi_apache2.c:1.38 Sun Aug 5 10:27:38 2001 +++ php4/sapi/apache2filter/sapi_apache2.c Sun Aug 5 11:29:41 2001 @@ -44,13 +44,12 @@ #include "php_apache.h" static int -php_apache_sapi_ub_write(const char *str, uint str_length) +php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) { apr_bucket *b; apr_bucket_brigade *bb; php_struct *ctx; uint now; - TSRMLS_FETCH(); ctx = SG(server_context); Index: php4/sapi/caudium/caudium.c diff -u php4/sapi/caudium/caudium.c:1.21 php4/sapi/caudium/caudium.c:1.22 --- php4/sapi/caudium/caudium.c:1.21 Sun Aug 5 10:27:38 2001 +++ php4/sapi/caudium/caudium.c Sun Aug 5 11:29:42 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: caudium.c,v 1.21 2001/08/05 14:27:38 sas Exp $ */ +/* $Id: caudium.c,v 1.22 2001/08/05 15:29:42 sas Exp $ */ #include "php.h" #ifdef HAVE_CAUDIUM @@ -204,10 +204,9 @@ */ INLINE static int -php_caudium_low_ub_write(const char *str, uint str_length) { +php_caudium_low_ub_write(const char *str, uint str_length TSRMLS_DC) { int sent_bytes = 0; struct pike_string *to_write = NULL; - TSRMLS_FETCH(); GET_THIS(); if(!MY_FD_OBJ->prog) { PG(connection_status) = PHP_CONNECTION_ABORTED; @@ -235,9 +234,8 @@ */ static int -php_caudium_sapi_ub_write(const char *str, uint str_length) +php_caudium_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) { - TSRMLS_FETCH(); GET_THIS(); int sent_bytes = 0, fd = MY_FD; if(fd) @@ -266,7 +264,7 @@ } THIS->written += sent_bytes; } else { - THREAD_SAFE_RUN(sent_bytes = php_caudium_low_ub_write(str, str_length), + THREAD_SAFE_RUN(sent_bytes = php_caudium_low_ub_write(str, str_length TSRMLS_CC), "write"); } return sent_bytes; @@ -441,7 +439,7 @@ { /* char buf[512]; */ php_info_print_table_start(); - php_info_print_table_row(2, "SAPI module version", "$Id: caudium.c,v 1.21 2001/08/05 14:27:38 sas Exp $"); + php_info_print_table_row(2, "SAPI module version", "$Id: caudium.c,v 1.22 2001/08/05 15:29:42 sas Exp $"); /* php_info_print_table_row(2, "Build date", Ns_InfoBuildDate()); php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile()); php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog()); Index: php4/sapi/cgi/cgi_main.c diff -u php4/sapi/cgi/cgi_main.c:1.129 php4/sapi/cgi/cgi_main.c:1.130 --- php4/sapi/cgi/cgi_main.c:1.129 Sun Aug 5 10:07:33 2001 +++ php4/sapi/cgi/cgi_main.c Sun Aug 5 11:29:43 2001 @@ -108,7 +108,7 @@ #endif } -static int sapi_cgibin_ub_write(const char *str, uint str_length) +static int sapi_cgibin_ub_write(const char *str, uint str_length TSRMLS_DC) { const char *ptr = str; uint remaining = str_length; @@ -493,10 +493,10 @@ case '?': no_headers = 1; php_output_startup(); - php_output_activate(); + php_output_activate(TSRMLS_C); SG(headers_sent) = 1; php_cgi_usage(argv[0]); - php_end_ob_buffers(1); + php_end_ob_buffers(1 TSRMLS_CC); exit(1); break; } @@ -554,10 +554,10 @@ case '?': no_headers = 1; php_output_startup(); - php_output_activate(); + php_output_activate(TSRMLS_C); SG(headers_sent) = 1; php_cgi_usage(argv[0]); - php_end_ob_buffers(1); + php_end_ob_buffers(1 TSRMLS_CC); exit(1); break; @@ -581,7 +581,7 @@ case 'm': /* list compiled in modules */ php_output_startup(); - php_output_activate(); + php_output_activate(TSRMLS_C); SG(headers_sent) = 1; php_printf("Running PHP %s\n%s\n", PHP_VERSION , get_zend_version()); php_printf("[PHP Modules]\n"); @@ -590,7 +590,7 @@ /* zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) _print_module_info, NULL TSRMLS_CC); */ php_printf("Not Implemented\n"); php_printf("\n"); - php_end_ob_buffers(1); + php_end_ob_buffers(1 TSRMLS_CC); exit(1); break; @@ -619,7 +619,7 @@ SG(request_info).no_headers = 1; } php_printf("%s\n", PHP_VERSION); - php_end_ob_buffers(1); + php_end_ob_buffers(1 TSRMLS_CC); exit(1); break; Index: php4/sapi/fastcgi/fastcgi.c diff -u php4/sapi/fastcgi/fastcgi.c:1.15 php4/sapi/fastcgi/fastcgi.c:1.16 --- php4/sapi/fastcgi/fastcgi.c:1.15 Sun Aug 5 10:27:38 2001 +++ php4/sapi/fastcgi/fastcgi.c Sun Aug 5 11:29:43 2001 @@ -91,7 +91,7 @@ static pid_t pgroup; -static int sapi_fastcgi_ub_write(const char *str, uint str_length) +static int sapi_fastcgi_ub_write(const char *str, uint str_length TSRMLS_DC) { uint sent = FCGX_PutStr( str, str_length, out ); return sent; Index: php4/sapi/isapi/php4isapi.c diff -u php4/sapi/isapi/php4isapi.c:1.76 php4/sapi/isapi/php4isapi.c:1.77 --- php4/sapi/isapi/php4isapi.c:1.76 Sat Aug 4 21:42:46 2001 +++ php4/sapi/isapi/php4isapi.c Sun Aug 5 11:29:43 2001 @@ -199,11 +199,10 @@ }; -static int sapi_isapi_ub_write(const char *str, uint str_length) +static int sapi_isapi_ub_write(const char *str, uint str_length TSRMLS_DC) { DWORD num_bytes = str_length; LPEXTENSION_CONTROL_BLOCK ecb; - TSRMLS_FETCH(); ecb = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); if (ecb->WriteClient(ecb->ConnID, (char *) str, &num_bytes, HSE_IO_SYNC ) == FALSE) { Index: php4/sapi/nsapi/nsapi.c diff -u php4/sapi/nsapi/nsapi.c:1.20 php4/sapi/nsapi/nsapi.c:1.21 --- php4/sapi/nsapi/nsapi.c:1.20 Sun Aug 5 01:35:05 2001 +++ php4/sapi/nsapi/nsapi.c Sun Aug 5 11:29:43 2001 @@ -135,12 +135,11 @@ static size_t nsapi_client_size = sizeof(nsapi_client)/sizeof(nsapi_client[0]); static int -sapi_nsapi_ub_write(const char *str, unsigned int str_length) +sapi_nsapi_ub_write(const char *str, unsigned int str_length TSRMLS_DC) { int retval; nsapi_request_context *rc; - TSRMLS_FETCH(); rc = (nsapi_request_context *)SG(server_context); retval = net_write(rc->sn->csd, (char *)str, str_length); if (retval == IO_ERROR /*-1*/ || retval == IO_EOF /*0*/) Index: php4/sapi/phttpd/phttpd.c diff -u php4/sapi/phttpd/phttpd.c:1.29 php4/sapi/phttpd/phttpd.c:1.30 --- php4/sapi/phttpd/phttpd.c:1.29 Sun Aug 5 01:35:05 2001 +++ php4/sapi/phttpd/phttpd.c Sun Aug 5 11:29:45 2001 @@ -57,10 +57,9 @@ } static int -php_phttpd_sapi_ub_write(const char *str, uint str_length) +php_phttpd_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) { int sent_bytes; - TSRMLS_FETCH(); sent_bytes = fd_write(PHG(cip)->fd, str, str_length); Index: php4/sapi/pi3web/pi3web_sapi.c diff -u php4/sapi/pi3web/pi3web_sapi.c:1.29 php4/sapi/pi3web/pi3web_sapi.c:1.30 --- php4/sapi/pi3web/pi3web_sapi.c:1.29 Sun Aug 5 10:17:55 2001 +++ php4/sapi/pi3web/pi3web_sapi.c Sun Aug 5 11:29:46 2001 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pi3web_sapi.c,v 1.29 2001/08/05 14:17:55 sas Exp $ */ +/* $Id: pi3web_sapi.c,v 1.30 2001/08/05 15:29:46 sas 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.29 2001/08/05 14:17:55 sas Exp $"); + php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id: pi3web_sapi.c,v 1.30 2001/08/05 15:29:46 sas 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); @@ -133,11 +133,10 @@ }; -static int zend_pi3web_ub_write(const char *str, uint str_length) +static int zend_pi3web_ub_write(const char *str, uint str_length TSRMLS_DC) { DWORD num_bytes = str_length; LPCONTROL_BLOCK cb; - TSRMLS_FETCH(); cb = (LPCONTROL_BLOCK) SG(server_context); Index: php4/sapi/roxen/roxen.c diff -u php4/sapi/roxen/roxen.c:1.46 php4/sapi/roxen/roxen.c:1.47 --- php4/sapi/roxen/roxen.c:1.46 Sun Aug 5 10:27:39 2001 +++ php4/sapi/roxen/roxen.c Sun Aug 5 11:29:46 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: roxen.c,v 1.46 2001/08/05 14:27:39 sas Exp $ */ +/* $Id: roxen.c,v 1.47 2001/08/05 15:29:46 sas Exp $ */ #include "php.h" #ifdef HAVE_ROXEN @@ -211,13 +211,12 @@ */ static int -php_roxen_low_ub_write(const char *str, uint str_length) { +php_roxen_low_ub_write(const char *str, uint str_length TSRMLS_DC) { int sent_bytes = 0; struct pike_string *to_write = NULL; #ifdef ROXEN_USE_ZTS GET_THIS(); #endif - TSRMLS_FETCH(); if(!MY_FD_OBJ->prog) { PG(connection_status) = PHP_CONNECTION_ABORTED; @@ -243,12 +242,11 @@ */ static int -php_roxen_sapi_ub_write(const char *str, uint str_length) +php_roxen_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) { #ifdef ROXEN_USE_ZTS GET_THIS(); #endif - TSRMLS_FETCH(); int sent_bytes = 0, fd = MY_FD; if(fd) @@ -276,7 +274,7 @@ } } } else { - THREAD_SAFE_RUN(sent_bytes = php_roxen_low_ub_write(str, str_length), + THREAD_SAFE_RUN(sent_bytes = php_roxen_low_ub_write(str, str_length TSRMLS_CC), "write"); } return sent_bytes; @@ -440,7 +438,7 @@ { /* char buf[512]; */ php_info_print_table_start(); - php_info_print_table_row(2, "SAPI module version", "$Id: roxen.c,v 1.46 2001/08/05 14:27:39 sas Exp $"); + php_info_print_table_row(2, "SAPI module version", "$Id: roxen.c,v 1.47 2001/08/05 15:29:46 sas Exp $"); /* php_info_print_table_row(2, "Build date", Ns_InfoBuildDate()); php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile()); php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog()); Index: php4/sapi/servlet/servlet.c diff -u php4/sapi/servlet/servlet.c:1.56 php4/sapi/servlet/servlet.c:1.57 --- php4/sapi/servlet/servlet.c:1.56 Sat Aug 4 21:42:48 2001 +++ php4/sapi/servlet/servlet.c Sun Aug 5 11:29:46 2001 @@ -114,9 +114,8 @@ * sapi callbacks */ -static int sapi_servlet_ub_write(const char *str, uint str_length) +static int sapi_servlet_ub_write(const char *str, uint str_length TSRMLS_DC) { - TSRMLS_FETCH(); if (!SG(server_context)) { fprintf(stderr, str); return 0; Index: php4/sapi/thttpd/thttpd.c diff -u php4/sapi/thttpd/thttpd.c:1.52 php4/sapi/thttpd/thttpd.c:1.53 --- php4/sapi/thttpd/thttpd.c:1.52 Sun Aug 5 10:17:55 2001 +++ php4/sapi/thttpd/thttpd.c Sun Aug 5 11:29:47 2001 @@ -43,11 +43,10 @@ #define TG(v) (thttpd_globals.v) #endif -static int sapi_thttpd_ub_write(const char *str, uint str_length) +static int sapi_thttpd_ub_write(const char *str, uint str_length TSRMLS_DC) { int n; uint sent = 0; - TSRMLS_FETCH(); while (str_length > 0) { n = send(TG(hc)->conn_fd, str, str_length, 0); Index: php4/sapi/tux/php_tux.c diff -u php4/sapi/tux/php_tux.c:1.7 php4/sapi/tux/php_tux.c:1.8 --- php4/sapi/tux/php_tux.c:1.7 Sun Aug 5 10:27:39 2001 +++ php4/sapi/tux/php_tux.c Sun Aug 5 11:29:47 2001 @@ -49,11 +49,10 @@ #define TG(v) (tux_globals.v) -static int sapi_tux_ub_write(const char *str, uint str_length) +static int sapi_tux_ub_write(const char *str, uint str_length TSRMLS_DC) { int n; uint sent = 0; - TSRMLS_FETCH(); /* combine headers and body */ if (TG(number_vec)) {
Index: php4/ext/sablot/sablot.c diff -u php4/ext/sablot/sablot.c:1.47 php4/ext/sablot/sablot.c:1.48 --- php4/ext/sablot/sablot.c:1.47 Tue Jul 31 01:44:04 2001 +++ php4/ext/sablot/sablot.c Sun Aug 5 11:29:37 2001 @@ -282,7 +282,7 @@ * Start output buffering, NULL signifies that no "user-space" output function * will be used. The 0 disables chunking */ - php_start_ob_buffer(NULL, 0); + php_start_ob_buffer(NULL, 0 TSRMLS_CC); } /* }}} */ @@ -345,7 +345,7 @@ * current output buffer (so we don't send data twice) */ if (tRes) - php_end_ob_buffer(0, 0); + php_end_ob_buffer(0, 0 TSRMLS_CC); PUTS(tRes); @@ -360,7 +360,7 @@ if (tRes) SablotFree(tRes); else - php_end_ob_buffer(1, 0); + php_end_ob_buffer(1, 0 TSRMLS_CC); } /* }}} */ Index: php4/ext/session/php_session.h diff -u php4/ext/session/php_session.h:1.48 php4/ext/session/php_session.h:1.49 --- php4/ext/session/php_session.h:1.48 Sun Aug 5 10:36:49 2001 +++ php4/ext/session/php_session.h Sun Aug 5 11:29:37 2001 @@ -146,7 +146,7 @@ #ifdef TRANS_SID void session_adapt_uris(const char *, size_t, char **, size_t * TSRMLS_DC); void session_adapt_url(const char *, size_t, char **, size_t * TSRMLS_DC); -void session_adapt_flush(int (*)(const char *, uint)); +void session_adapt_flush(int (*)(const char *, uint) TSRMLS_DC); #else #define session_adapt_uris(a,b,c,d) do { } while(0) #define session_adapt_url(a,b,c,d) do { } while(0) Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.230 php4/ext/session/session.c:1.231 --- php4/ext/session/session.c:1.230 Sun Aug 5 10:36:50 2001 +++ php4/ext/session/session.c Sun Aug 5 11:29:38 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: session.c,v 1.230 2001/08/05 14:36:50 sas Exp $ */ +/* $Id: session.c,v 1.231 2001/08/05 15:29:38 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -658,8 +658,8 @@ php_session_cache_limiter_t *lim; if (SG(headers_sent)) { - char *output_start_filename = php_get_output_start_filename(); - int output_start_lineno = php_get_output_start_lineno(); + char *output_start_filename = php_get_output_start_filename(TSRMLS_C); + int output_start_lineno = php_get_output_start_lineno(TSRMLS_C); if (output_start_filename) { php_error(E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)", @@ -692,8 +692,8 @@ char *date_fmt = NULL; if (SG(headers_sent)) { - char *output_start_filename = php_get_output_start_filename(); - int output_start_lineno = php_get_output_start_lineno(); + char *output_start_filename = php_get_output_start_filename(TSRMLS_C); + int output_start_lineno = php_get_output_start_lineno(TSRMLS_C); if (output_start_filename) { php_error(E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)", @@ -1280,13 +1280,13 @@ *new = url_adapt_single_url(url, urllen, PS(session_name), PS(id), newlen); } -void session_adapt_flush(int (*write)(const char *, uint)) +void session_adapt_flush(int (*write)(const char *, uint TSRMLS_DC) TSRMLS_DC) { char *str; size_t len; str = url_adapt_flush(&len); - if (str) write(str, len); + if (str) write(str, len TSRMLS_CC); } #endif Index: php4/ext/zlib/php_zlib.h diff -u php4/ext/zlib/php_zlib.h:1.19 php4/ext/zlib/php_zlib.h:1.20 --- php4/ext/zlib/php_zlib.h:1.19 Tue Jul 31 19:32:24 2001 +++ php4/ext/zlib/php_zlib.h Sun Aug 5 11:29:39 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_zlib.h,v 1.19 2001/07/31 23:32:24 zeev Exp $ */ +/* $Id: php_zlib.h,v 1.20 2001/08/05 15:29:39 sas Exp $ */ #ifndef PHP_ZLIB_H #define PHP_ZLIB_H @@ -65,7 +65,7 @@ PHP_FUNCTION(ob_gzhandler); FILE *zlib_fopen_wrapper(const char *path, char *mode, int options, int *issock, int *socketd, char **opened_path TSRMLS_DC); -int php_enable_output_compression(int buffer_size); +int php_enable_output_compression(int buffer_size TSRMLS_DC); #ifdef ZTS Index: php4/ext/zlib/zlib.c diff -u php4/ext/zlib/zlib.c:1.91 php4/ext/zlib/zlib.c:1.92 --- php4/ext/zlib/zlib.c:1.91 Tue Jul 31 03:09:46 2001 +++ php4/ext/zlib/zlib.c Sun Aug 5 11:29:39 2001 @@ -16,7 +16,7 @@ | Stefan Röhrich <sr@linux.de> | +----------------------------------------------------------------------+ */ -/* $Id: zlib.c,v 1.91 2001/07/31 07:09:46 zeev Exp $ */ +/* $Id: zlib.c,v 1.92 2001/08/05 15:29:39 sas Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -187,10 +187,10 @@ case 0: break; case 1: - php_enable_output_compression(4096); + php_enable_output_compression(4096 TSRMLS_CC); break; default: - php_enable_output_compression(ZLIBG(output_compression)); + php_enable_output_compression(ZLIBG(output_compression) TSRMLS_CC); } return SUCCESS; } @@ -1025,10 +1025,9 @@ /* {{{ php_deflate_string */ -int php_deflate_string(const char *str, uint str_length, char **newstr, uint *new_length, int coding, zend_bool do_start, zend_bool do_end) +int php_deflate_string(const char *str, uint str_length, char **newstr, uint *new_length, int coding, zend_bool do_start, zend_bool do_end TSRMLS_DC) { int err; - TSRMLS_FETCH(); ZLIBG(compression_coding) = coding; @@ -1127,7 +1126,7 @@ ZEND_WRONG_PARAM_COUNT(); break; } - if (php_deflate_string(Z_STRVAL_PP(zv_string), Z_STRLEN_PP(zv_string), &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), coding, 1, 1)==SUCCESS) { + if (php_deflate_string(Z_STRVAL_PP(zv_string), Z_STRLEN_PP(zv_string), &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), coding, 1, 1 TSRMLS_CC)==SUCCESS) { Z_TYPE_P(return_value) = IS_STRING; } else { RETURN_FALSE; @@ -1173,7 +1172,7 @@ do_end = ((Z_LVAL_PP(zv_mode) & PHP_OUTPUT_HANDLER_END) ? 1 : 0); Z_STRVAL_P(return_value) = NULL; Z_STRLEN_P(return_value) = 0; - if (php_deflate_string(Z_STRVAL_PP(zv_string), Z_STRLEN_PP(zv_string), &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), coding, do_start, do_end)==SUCCESS) { + if (php_deflate_string(Z_STRVAL_PP(zv_string), Z_STRLEN_PP(zv_string), &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), coding, do_start, do_end TSRMLS_CC)==SUCCESS) { Z_TYPE_P(return_value) = IS_STRING; if (do_start) { switch (coding) { @@ -1223,14 +1222,13 @@ /* {{{ php_gzip_output_handler */ -static void php_gzip_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode) +static void php_gzip_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) { zend_bool do_start, do_end; - TSRMLS_FETCH(); do_start = (mode & PHP_OUTPUT_HANDLER_START ? 1 : 0); do_end = (mode & PHP_OUTPUT_HANDLER_END ? 1 : 0); - if (php_deflate_string(output, output_len, handled_output, handled_output_len, ZLIBG(ob_gzip_coding), do_start, do_end)!=SUCCESS) { + if (php_deflate_string(output, output_len, handled_output, handled_output_len, ZLIBG(ob_gzip_coding), do_start, do_end TSRMLS_CC)!=SUCCESS) { zend_error(E_ERROR, "Compression failed"); } } @@ -1238,10 +1236,9 @@ /* {{{ php_enable_output_compression */ -int php_enable_output_compression(int buffer_size) +int php_enable_output_compression(int buffer_size TSRMLS_DC) { zval **a_encoding, **data; - TSRMLS_FETCH(); if (zend_hash_find(&EG(symbol_table), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), (void **) &data)==FAILURE || Z_TYPE_PP(data)!=IS_ARRAY @@ -1263,8 +1260,8 @@ return FAILURE; } - php_start_ob_buffer(NULL, buffer_size); - php_ob_set_internal_handler(php_gzip_output_handler, buffer_size*1.5); + php_start_ob_buffer(NULL, buffer_size TSRMLS_CC); + php_ob_set_internal_handler(php_gzip_output_handler, buffer_size*1.5 TSRMLS_CC); return SUCCESS; } /* }}} */ Index: php4/main/SAPI.c diff -u php4/main/SAPI.c:1.112 php4/main/SAPI.c:1.113 --- php4/main/SAPI.c:1.112 Tue Jul 31 02:28:03 2001 +++ php4/main/SAPI.c Sun Aug 5 11:29:39 2001 @@ -373,8 +373,8 @@ char *colon_offset; if (SG(headers_sent) && !SG(request_info).no_headers) { - char *output_start_filename = php_get_output_start_filename(); - int output_start_lineno = php_get_output_start_lineno(); + char *output_start_filename = php_get_output_start_filename(TSRMLS_C); + int output_start_lineno = php_get_output_start_lineno(TSRMLS_C); if (output_start_filename) { sapi_module.sapi_error(E_WARNING, "Cannot add header information - headers already sent by (output started at %s:%d)", Index: php4/main/SAPI.h diff -u php4/main/SAPI.h:1.73 php4/main/SAPI.h:1.74 --- php4/main/SAPI.h:1.73 Tue Jul 31 02:28:03 2001 +++ php4/main/SAPI.h Sun Aug 5 11:29:39 2001 @@ -160,7 +160,7 @@ int (*activate)(TSRMLS_D); int (*deactivate)(TSRMLS_D); - int (*ub_write)(const char *str, unsigned int str_length); + int (*ub_write)(const char *str, unsigned int str_length TSRMLS_DC); void (*flush)(void *server_context); struct stat *(*get_stat)(TSRMLS_D); char *(*getenv)(char *name, size_t name_len TSRMLS_DC); Index: php4/main/main.c diff -u php4/main/main.c:1.395 php4/main/main.c:1.396 --- php4/main/main.c:1.395 Sat Aug 4 21:42:44 2001 +++ php4/main/main.c Sun Aug 5 11:29:39 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.395 2001/08/05 01:42:44 zeev Exp $ */ +/* $Id: main.c,v 1.396 2001/08/05 15:29:39 sas Exp $ */ /* {{{ includes */ @@ -622,7 +622,7 @@ zend_try { PG(during_request_startup) = 1; - php_output_activate(); + php_output_activate(TSRMLS_C); /* initialize global variables */ PG(modules_activated) = 0; @@ -645,11 +645,11 @@ Z_STRLEN_P(output_handler) = strlen(PG(output_handler)); /* this can be optimized */ Z_STRVAL_P(output_handler) = estrndup(PG(output_handler), Z_STRLEN_P(output_handler)); Z_TYPE_P(output_handler) = IS_STRING; - php_start_ob_buffer(output_handler, 0); + php_start_ob_buffer(output_handler, 0 TSRMLS_CC); } else if (PG(output_buffering)) { - php_start_ob_buffer(NULL, 0); + php_start_ob_buffer(NULL, 0 TSRMLS_CC); } else if (PG(implicit_flush)) { - php_start_implicit_flush(); + php_start_implicit_flush(TSRMLS_C); } /* We turn this off in php_execute_script() */ @@ -683,7 +683,7 @@ TSRMLS_FETCH(); zend_try { - php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1)); + php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1) TSRMLS_CC); } zend_end_try(); zend_try { @@ -800,7 +800,7 @@ sapi_module = *sf; php_output_startup(); - php_output_activate(); + php_output_activate(TSRMLS_C); zuf.error_function = php_error_cb; zuf.printf_function = php_printf; @@ -883,7 +883,7 @@ REGISTER_MAIN_STRINGL_CONSTANT("PHP_SYSCONFDIR", PHP_SYSCONFDIR, sizeof(PHP_SYSCONFDIR)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT("PHP_LOCALSTATEDIR", PHP_LOCALSTATEDIR, sizeof(PHP_LOCALSTATEDIR)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT("PHP_CONFIG_FILE_PATH", PHP_CONFIG_FILE_PATH, sizeof(PHP_CONFIG_FILE_PATH)-1, CONST_PERSISTENT | CONST_CS); - php_output_register_constants(); + php_output_register_constants(TSRMLS_C); if (php_startup_ticks(TSRMLS_C) == FAILURE) { php_printf("Unable to start PHP ticks\n"); @@ -1249,7 +1249,7 @@ TSRMLS_FETCH(); PG(connection_status) = PHP_CONNECTION_ABORTED; - php_output_set_status(0); + php_output_set_status(0 TSRMLS_CC); if (!PG(ignore_user_abort)) { zend_bailout(); Index: php4/main/output.c diff -u php4/main/output.c:1.71 php4/main/output.c:1.72 --- php4/main/output.c:1.71 Sun Aug 5 10:36:51 2001 +++ php4/main/output.c Sun Aug 5 11:29:40 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: output.c,v 1.71 2001/08/05 14:36:51 sas Exp $ */ +/* $Id: output.c,v 1.72 2001/08/05 15:29:40 sas Exp $ */ #include "php.h" #include "ext/standard/head.h" @@ -26,12 +26,12 @@ #include "SAPI.h" /* output functions */ -static int php_ub_body_write(const char *str, uint str_length); -static int php_ub_body_write_no_header(const char *str, uint str_length); -static int php_b_body_write(const char *str, uint str_length); +static int php_ub_body_write(const char *str, uint str_length TSRMLS_DC); +static int php_ub_body_write_no_header(const char *str, uint str_length TSRMLS_DC); +static int php_b_body_write(const char *str, uint str_length TSRMLS_DC); -static void php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size); -static void php_ob_append(const char *text, uint text_length); +static void php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size TSRMLS_DC); +static void php_ob_append(const char *text, uint text_length TSRMLS_DC); #if 0 static void php_ob_prepend(const char *text, uint text_length); #endif @@ -43,7 +43,7 @@ php_output_globals output_globals; #endif -static int php_default_output_func(const char *str, uint str_len) +static int php_default_output_func(const char *str, uint str_len TSRMLS_DC) { fwrite(str, 1, str_len, stderr); return str_len; @@ -71,10 +71,8 @@ } -PHPAPI void php_output_activate(void) +PHPAPI void php_output_activate(TSRMLS_D) { - TSRMLS_FETCH(); - OG(php_body_write) = php_ub_body_write; OG(php_header_write) = sapi_module.ub_write; OG(ob_nesting_level) = 0; @@ -83,18 +81,14 @@ } -PHPAPI void php_output_set_status(zend_bool status) +PHPAPI void php_output_set_status(zend_bool status TSRMLS_DC) { - TSRMLS_FETCH(); - OG(disable_output) = !status; } -void php_output_register_constants() +void php_output_register_constants(TSRMLS_D) { - TSRMLS_FETCH(); - REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_START", PHP_OUTPUT_HANDLER_START, CONST_CS | CONST_PERSISTENT); REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_CONT", PHP_OUTPUT_HANDLER_CONT, CONST_CS | CONST_PERSISTENT); REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_END", PHP_OUTPUT_HANDLER_END, CONST_CS | CONST_PERSISTENT); @@ -104,7 +98,7 @@ PHPAPI int php_body_write(const char *str, uint str_length) { TSRMLS_FETCH(); - return OG(php_body_write)(str, str_length); + return OG(php_body_write)(str, str_length TSRMLS_CC); } PHPAPI int php_header_write(const char *str, uint str_length) @@ -113,23 +107,21 @@ if (OG(disable_output)) { return 0; } else { - return OG(php_header_write)(str, str_length); + return OG(php_header_write)(str, str_length TSRMLS_CC); } } /* {{{ php_start_ob_buffer * Start output buffering */ -PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size) +PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size TSRMLS_DC) { - TSRMLS_FETCH(); - if (OG(ob_lock)) { return FAILURE; } if (chunk_size) { - php_ob_init((chunk_size*3/2), chunk_size/2, output_handler, chunk_size); + php_ob_init((chunk_size*3/2), chunk_size/2, output_handler, chunk_size TSRMLS_CC); } else { - php_ob_init(40*1024, 10*1024, output_handler, chunk_size); + php_ob_init(40*1024, 10*1024, output_handler, chunk_size TSRMLS_CC); } OG(php_body_write) = php_b_body_write; return SUCCESS; @@ -138,7 +130,7 @@ /* {{{ php_end_ob_buffer * End output buffering (one level) */ -PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush) +PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS_DC) { char *final_buffer=NULL; int final_buffer_length=0; @@ -146,7 +138,6 @@ char *to_be_destroyed_buffer; char *to_be_destroyed_handled_output[2] = { 0, 0 }; int status; - TSRMLS_FETCH(); if (OG(ob_nesting_level)==0) { return; @@ -165,12 +156,11 @@ if (OG(active_ob_buffer).internal_output_handler) { final_buffer = OG(active_ob_buffer).internal_output_handler_buffer; final_buffer_length = OG(active_ob_buffer).internal_output_handler_buffer_size; - OG(active_ob_buffer).internal_output_handler(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, &final_buffer, &final_buffer_length, status); + OG(active_ob_buffer).internal_output_handler(OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, &final_buffer, &final_buffer_length, status TSRMLS_CC); } else if (OG(active_ob_buffer).output_handler) { zval **params[2]; zval *orig_buffer; zval *z_status; - TSRMLS_FETCH(); ALLOC_INIT_ZVAL(orig_buffer); ZVAL_STRINGL(orig_buffer, OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, 0); @@ -235,7 +225,7 @@ } if (send_buffer) { - OG(php_body_write)(final_buffer, final_buffer_length); + OG(php_body_write)(final_buffer, final_buffer_length TSRMLS_CC); } if (alternate_buffer) { @@ -260,47 +250,39 @@ /* {{{ php_end_ob_buffers * End output buffering (all buffers) */ -PHPAPI void php_end_ob_buffers(zend_bool send_buffer) +PHPAPI void php_end_ob_buffers(zend_bool send_buffer TSRMLS_DC) { - TSRMLS_FETCH(); - while (OG(ob_nesting_level)!=0) { - php_end_ob_buffer(send_buffer, 0); + php_end_ob_buffer(send_buffer, 0 TSRMLS_CC); } if (!OG(disable_output) && send_buffer && BG(use_trans_sid)) { - session_adapt_flush(OG(php_header_write)); + session_adapt_flush(OG(php_header_write) TSRMLS_CC); } } /* }}} */ /* {{{ php_start_implicit_flush */ -PHPAPI void php_start_implicit_flush() +PHPAPI void php_start_implicit_flush(TSRMLS_D) { - TSRMLS_FETCH(); - - php_end_ob_buffer(1, 0); /* Switch out of output buffering if we're in it */ + php_end_ob_buffer(1, 0 TSRMLS_CC); /* Switch out of output buffering if we're in it */ OG(implicit_flush)=1; } /* }}} */ /* {{{ php_end_implicit_flush */ -PHPAPI void php_end_implicit_flush() +PHPAPI void php_end_implicit_flush(TSRMLS_D) { - TSRMLS_FETCH(); - OG(implicit_flush)=0; } /* }}} */ /* {{{ php_ob_set_internal_handler */ -PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size) +PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size TSRMLS_DC) { - TSRMLS_FETCH(); - if (OG(ob_nesting_level)==0) { return; } @@ -317,10 +299,8 @@ /* {{{ php_ob_allocate */ -static inline void php_ob_allocate(void) +static inline void php_ob_allocate(TSRMLS_D) { - TSRMLS_FETCH(); - if (OG(active_ob_buffer).size<OG(active_ob_buffer).text_length) { while (OG(active_ob_buffer).size <= OG(active_ob_buffer).text_length) { OG(active_ob_buffer).size+=OG(active_ob_buffer).block_size; @@ -333,10 +313,8 @@ /* {{{ php_ob_init */ -static void php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size) +static void php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size TSRMLS_DC) { - TSRMLS_FETCH(); - if (OG(ob_nesting_level)>0) { if (OG(ob_nesting_level)==1) { /* initialize stack */ zend_stack_init(&OG(ob_buffers)); @@ -357,16 +335,15 @@ /* {{{ php_ob_append */ -static void php_ob_append(const char *text, uint text_length) +static void php_ob_append(const char *text, uint text_length TSRMLS_DC) { char *target; int original_ob_text_length; - TSRMLS_FETCH(); original_ob_text_length=OG(active_ob_buffer).text_length; OG(active_ob_buffer).text_length = OG(active_ob_buffer).text_length + text_length; - php_ob_allocate(); + php_ob_allocate(TSRMLS_C); target = OG(active_ob_buffer).buffer+original_ob_text_length; memcpy(target, text, text_length); target[text_length]=0; @@ -378,7 +355,7 @@ if (output_handler) { output_handler->refcount++; } - php_end_ob_buffer(1, 1); + php_end_ob_buffer(1, 1 TSRMLS_CC); return; } } @@ -391,7 +368,7 @@ TSRMLS_FETCH(); OG(active_ob_buffer).text_length += text_length; - php_ob_allocate(); + php_ob_allocate(TSRMLS_C); /* php_ob_allocate() may change OG(ob_buffer), so we can't initialize p&start earlier */ p = OG(ob_buffer)+OG(ob_text_length); @@ -408,10 +385,8 @@ /* {{{ php_ob_get_buffer * Return the current output buffer */ -int php_ob_get_buffer(pval *p) +int php_ob_get_buffer(pval *p TSRMLS_DC) { - TSRMLS_FETCH(); - if (OG(ob_nesting_level)==0) { return FAILURE; } @@ -422,10 +397,8 @@ /* {{{ php_ob_get_length * Return the size of the current output buffer */ -int php_ob_get_length(pval *p) +int php_ob_get_length(pval *p TSRMLS_DC) { - TSRMLS_FETCH(); - if (OG(ob_nesting_level) == 0) { return FAILURE; } @@ -440,20 +413,19 @@ /* buffered output function */ -static int php_b_body_write(const char *str, uint str_length) +static int php_b_body_write(const char *str, uint str_length TSRMLS_DC) { - php_ob_append(str, str_length); + php_ob_append(str, str_length TSRMLS_CC); return str_length; } /* {{{ php_ub_body_write_no_header */ -static int php_ub_body_write_no_header(const char *str, uint str_length) +static int php_ub_body_write_no_header(const char *str, uint str_length TSRMLS_DC) { char *newstr = NULL; size_t new_length=0; int result; - TSRMLS_FETCH(); if (OG(disable_output)) { return 0; @@ -467,7 +439,7 @@ str_length = new_length; } - result = OG(php_header_write)(str, str_length); + result = OG(php_header_write)(str, str_length TSRMLS_CC); if (OG(implicit_flush)) { sapi_flush(TSRMLS_C); @@ -479,10 +451,9 @@ /* {{{ php_ub_body_write */ -static int php_ub_body_write(const char *str, uint str_length) +static int php_ub_body_write(const char *str, uint str_length TSRMLS_DC) { int result = 0; - TSRMLS_FETCH(); if (SG(request_info).headers_only) { php_header(); @@ -498,7 +469,7 @@ } OG(php_body_write) = php_ub_body_write_no_header; - result = php_ub_body_write_no_header(str, str_length); + result = php_ub_body_write_no_header(str, str_length TSRMLS_CC); } return result; @@ -548,9 +519,7 @@ ZEND_WRONG_PARAM_COUNT(); break; } - if (php_start_ob_buffer(output_handler, chunk_size)==FAILURE) { - TSRMLS_FETCH(); - + if (php_start_ob_buffer(output_handler, chunk_size TSRMLS_CC)==FAILURE) { if (SG(headers_sent) && !SG(request_info).headers_only) { OG(php_body_write) = php_ub_body_write_no_header; } else { @@ -568,7 +537,7 @@ Flush (send) the output buffer, and turn off output buffering */ PHP_FUNCTION(ob_end_flush) { - php_end_ob_buffer(1, 0); + php_end_ob_buffer(1, 0 TSRMLS_CC); } /* }}} */ @@ -576,7 +545,7 @@ Clean (erase) the output buffer, and turn off output buffering */ PHP_FUNCTION(ob_end_clean) { - php_end_ob_buffer(0, 0); + php_end_ob_buffer(0, 0 TSRMLS_CC); } /* }}} */ @@ -584,7 +553,7 @@ Return the contents of the output buffer */ PHP_FUNCTION(ob_get_contents) { - if (php_ob_get_buffer(return_value)==FAILURE) { + if (php_ob_get_buffer(return_value TSRMLS_CC)==FAILURE) { RETURN_FALSE; } } @@ -594,7 +563,7 @@ Return the length of the output buffer */ PHP_FUNCTION(ob_get_length) { - if (php_ob_get_length(return_value)==FAILURE) { + if (php_ob_get_length(return_value TSRMLS_CC)==FAILURE) { RETURN_FALSE; } } @@ -623,25 +592,21 @@ break; } if (flag) { - php_start_implicit_flush(); + php_start_implicit_flush(TSRMLS_C); } else { - php_end_implicit_flush(); + php_end_implicit_flush(TSRMLS_C); } } /* }}} */ -PHPAPI char *php_get_output_start_filename() +PHPAPI char *php_get_output_start_filename(TSRMLS_D) { - TSRMLS_FETCH(); - return OG(output_start_filename); } -PHPAPI int php_get_output_start_lineno() +PHPAPI int php_get_output_start_lineno(TSRMLS_D) { - TSRMLS_FETCH(); - return OG(output_start_lineno); } Index: php4/main/php_output.h diff -u php4/main/php_output.h:1.28 php4/main/php_output.h:1.29 --- php4/main/php_output.h:1.28 Sat Jul 28 07:36:28 2001 +++ php4/main/php_output.h Sun Aug 5 11:29:40 2001 @@ -16,31 +16,31 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_output.h,v 1.28 2001/07/28 11:36:28 zeev Exp $ */ +/* $Id: php_output.h,v 1.29 2001/08/05 15:29:40 sas Exp $ */ #ifndef PHP_OUTPUT_H #define PHP_OUTPUT_H #include "php.h" -typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode); +typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC); PHPAPI void php_output_startup(void); -PHPAPI void php_output_activate(void); -PHPAPI void php_output_set_status(zend_bool status); -void php_output_register_constants(void); +PHPAPI void php_output_activate(TSRMLS_D); +PHPAPI void php_output_set_status(zend_bool status TSRMLS_DC); +void php_output_register_constants(TSRMLS_D); PHPAPI int php_body_write(const char *str, uint str_length); PHPAPI int php_header_write(const char *str, uint str_length); -PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size); -PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush); -PHPAPI void php_end_ob_buffers(zend_bool send_buffer); -PHPAPI int php_ob_get_buffer(pval *p); -PHPAPI int php_ob_get_length(pval *p); -PHPAPI void php_start_implicit_flush(void); -PHPAPI void php_end_implicit_flush(void); -PHPAPI char *php_get_output_start_filename(void); -PHPAPI int php_get_output_start_lineno(void); -PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size); +PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size TSRMLS_DC); +PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS_DC); +PHPAPI void php_end_ob_buffers(zend_bool send_buffer TSRMLS_DC); +PHPAPI int php_ob_get_buffer(zval *p TSRMLS_DC); +PHPAPI int php_ob_get_length(zval *p TSRMLS_DC); +PHPAPI void php_start_implicit_flush(TSRMLS_D); +PHPAPI void php_end_implicit_flush(TSRMLS_D); +PHPAPI char *php_get_output_start_filename(TSRMLS_D); +PHPAPI int php_get_output_start_lineno(TSRMLS_D); +PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size TSRMLS_DC); PHP_FUNCTION(ob_start); PHP_FUNCTION(ob_end_flush); @@ -63,8 +63,8 @@ } php_ob_buffer; typedef struct _php_output_globals { - int (*php_body_write)(const char *str, uint str_length); /* string output */ - int (*php_header_write)(const char *str, uint str_length); /* unbuffer string output */ + int (*php_body_write)(const char *str, uint str_length TSRMLS_DC); /* string output */ + int (*php_header_write)(const char *str, uint str_length TSRMLS_DC); /* unbuffer string output */ php_ob_buffer active_ob_buffer; unsigned char implicit_flush; char *output_start_filename; Index: php4/sapi/aolserver/aolserver.c diff -u php4/sapi/aolserver/aolserver.c:1.60 php4/sapi/aolserver/aolserver.c:1.61 --- php4/sapi/aolserver/aolserver.c:1.60 Sun Aug 5 10:27:38 2001 +++ php4/sapi/aolserver/aolserver.c Sun Aug 5 11:29:40 2001 @@ -22,7 +22,7 @@ * - CGI/1.1 conformance */ -/* $Id: aolserver.c,v 1.60 2001/08/05 14:27:38 sas Exp $ */ +/* $Id: aolserver.c,v 1.61 2001/08/05 15:29:40 sas Exp $ */ /* conflict between PHP and AOLserver headers */ #define Debug php_Debug @@ -86,11 +86,10 @@ */ static int -php_ns_sapi_ub_write(const char *str, uint str_length) +php_ns_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) { int n; uint sent = 0; - TSRMLS_FETCH(); while (str_length > 0) { n = Ns_ConnWrite(NSG(conn), (void *) str, str_length); @@ -213,7 +212,7 @@ TSRMLS_FETCH(); php_info_print_table_start(); - php_info_print_table_row(2, "SAPI module version", "$Id: aolserver.c,v 1.60 2001/08/05 14:27:38 sas Exp $"); + php_info_print_table_row(2, "SAPI module version", "$Id: aolserver.c,v 1.61 2001/08/05 15:29:40 sas Exp $"); php_info_print_table_row(2, "Build date", Ns_InfoBuildDate()); php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile()); php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog()); Index: php4/sapi/apache/mod_php4.c diff -u php4/sapi/apache/mod_php4.c:1.116 php4/sapi/apache/mod_php4.c:1.117 --- php4/sapi/apache/mod_php4.c:1.116 Sat Aug 4 21:42:45 2001 +++ php4/sapi/apache/mod_php4.c Sun Aug 5 11:29:40 2001 @@ -17,7 +17,7 @@ | PHP 4.0 patches by Zeev Suraski <zeev@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: mod_php4.c,v 1.116 2001/08/05 01:42:45 zeev Exp $ */ +/* $Id: mod_php4.c,v 1.117 2001/08/05 15:29:40 sas Exp $ */ #define NO_REGEX_EXTRA_H #ifdef WIN32 @@ -124,10 +124,9 @@ /* {{{ sapi_apache_ub_write */ -static int sapi_apache_ub_write(const char *str, uint str_length) +static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC) { int ret=0; - TSRMLS_FETCH(); if (SG(server_context)) { ret = rwrite(str, str_length, (request_rec *) SG(server_context)); @@ -311,7 +310,7 @@ { TSRMLS_FETCH(); - php_output_set_status(0); + php_output_set_status(0 TSRMLS_CC); SG(server_context) = NULL; /* The server context (request) is invalid by the time run_cleanups() is called */ if (AP(in_request)) { AP(in_request) = 0; Index: php4/sapi/apache/php_apache.c diff -u php4/sapi/apache/php_apache.c:1.41 php4/sapi/apache/php_apache.c:1.42 --- php4/sapi/apache/php_apache.c:1.41 Sat Aug 4 21:42:45 2001 +++ php4/sapi/apache/php_apache.c Sun Aug 5 11:29:41 2001 @@ -17,7 +17,7 @@ | David Sklar <sklar@student.net> | +----------------------------------------------------------------------+ */ -/* $Id: php_apache.c,v 1.41 2001/08/05 01:42:45 zeev Exp $ */ +/* $Id: php_apache.c,v 1.42 2001/08/05 15:29:41 sas Exp $ */ #define NO_REGEX_EXTRA_H @@ -302,7 +302,6 @@ { pval **filename; request_rec *rr = NULL; - TSRMLS_FETCH(); if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { WRONG_PARAM_COUNT; @@ -321,7 +320,7 @@ RETURN_FALSE; } - php_end_ob_buffers(1); + php_end_ob_buffers(1 TSRMLS_CC); php_header(); if (run_sub_req(rr)) { Index: php4/sapi/apache2filter/sapi_apache2.c diff -u php4/sapi/apache2filter/sapi_apache2.c:1.38 php4/sapi/apache2filter/sapi_apache2.c:1.39 --- php4/sapi/apache2filter/sapi_apache2.c:1.38 Sun Aug 5 10:27:38 2001 +++ php4/sapi/apache2filter/sapi_apache2.c Sun Aug 5 11:29:41 2001 @@ -44,13 +44,12 @@ #include "php_apache.h" static int -php_apache_sapi_ub_write(const char *str, uint str_length) +php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) { apr_bucket *b; apr_bucket_brigade *bb; php_struct *ctx; uint now; - TSRMLS_FETCH(); ctx = SG(server_context); Index: php4/sapi/caudium/caudium.c diff -u php4/sapi/caudium/caudium.c:1.21 php4/sapi/caudium/caudium.c:1.22 --- php4/sapi/caudium/caudium.c:1.21 Sun Aug 5 10:27:38 2001 +++ php4/sapi/caudium/caudium.c Sun Aug 5 11:29:42 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: caudium.c,v 1.21 2001/08/05 14:27:38 sas Exp $ */ +/* $Id: caudium.c,v 1.22 2001/08/05 15:29:42 sas Exp $ */ #include "php.h" #ifdef HAVE_CAUDIUM @@ -204,10 +204,9 @@ */ INLINE static int -php_caudium_low_ub_write(const char *str, uint str_length) { +php_caudium_low_ub_write(const char *str, uint str_length TSRMLS_DC) { int sent_bytes = 0; struct pike_string *to_write = NULL; - TSRMLS_FETCH(); GET_THIS(); if(!MY_FD_OBJ->prog) { PG(connection_status) = PHP_CONNECTION_ABORTED; @@ -235,9 +234,8 @@ */ static int -php_caudium_sapi_ub_write(const char *str, uint str_length) +php_caudium_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) { - TSRMLS_FETCH(); GET_THIS(); int sent_bytes = 0, fd = MY_FD; if(fd) @@ -266,7 +264,7 @@ } THIS->written += sent_bytes; } else { - THREAD_SAFE_RUN(sent_bytes = php_caudium_low_ub_write(str, str_length), + THREAD_SAFE_RUN(sent_bytes = php_caudium_low_ub_write(str, str_length TSRMLS_CC), "write"); } return sent_bytes; @@ -441,7 +439,7 @@ { /* char buf[512]; */ php_info_print_table_start(); - php_info_print_table_row(2, "SAPI module version", "$Id: caudium.c,v 1.21 2001/08/05 14:27:38 sas Exp $"); + php_info_print_table_row(2, "SAPI module version", "$Id: caudium.c,v 1.22 2001/08/05 15:29:42 sas Exp $"); /* php_info_print_table_row(2, "Build date", Ns_InfoBuildDate()); php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile()); php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog()); Index: php4/sapi/cgi/cgi_main.c diff -u php4/sapi/cgi/cgi_main.c:1.129 php4/sapi/cgi/cgi_main.c:1.130 --- php4/sapi/cgi/cgi_main.c:1.129 Sun Aug 5 10:07:33 2001 +++ php4/sapi/cgi/cgi_main.c Sun Aug 5 11:29:43 2001 @@ -108,7 +108,7 @@ #endif } -static int sapi_cgibin_ub_write(const char *str, uint str_length) +static int sapi_cgibin_ub_write(const char *str, uint str_length TSRMLS_DC) { const char *ptr = str; uint remaining = str_length; @@ -493,10 +493,10 @@ case '?': no_headers = 1; php_output_startup(); - php_output_activate(); + php_output_activate(TSRMLS_C); SG(headers_sent) = 1; php_cgi_usage(argv[0]); - php_end_ob_buffers(1); + php_end_ob_buffers(1 TSRMLS_CC); exit(1); break; } @@ -554,10 +554,10 @@ case '?': no_headers = 1; php_output_startup(); - php_output_activate(); + php_output_activate(TSRMLS_C); SG(headers_sent) = 1; php_cgi_usage(argv[0]); - php_end_ob_buffers(1); + php_end_ob_buffers(1 TSRMLS_CC); exit(1); break; @@ -581,7 +581,7 @@ case 'm': /* list compiled in modules */ php_output_startup(); - php_output_activate(); + php_output_activate(TSRMLS_C); SG(headers_sent) = 1; php_printf("Running PHP %s\n%s\n", PHP_VERSION , get_zend_version()); php_printf("[PHP Modules]\n"); @@ -590,7 +590,7 @@ /* zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) _print_module_info, NULL TSRMLS_CC); */ php_printf("Not Implemented\n"); php_printf("\n"); - php_end_ob_buffers(1); + php_end_ob_buffers(1 TSRMLS_CC); exit(1); break; @@ -619,7 +619,7 @@ SG(request_info).no_headers = 1; } php_printf("%s\n", PHP_VERSION); - php_end_ob_buffers(1); + php_end_ob_buffers(1 TSRMLS_CC); exit(1); break; Index: php4/sapi/fastcgi/fastcgi.c diff -u php4/sapi/fastcgi/fastcgi.c:1.15 php4/sapi/fastcgi/fastcgi.c:1.16 --- php4/sapi/fastcgi/fastcgi.c:1.15 Sun Aug 5 10:27:38 2001 +++ php4/sapi/fastcgi/fastcgi.c Sun Aug 5 11:29:43 2001 @@ -91,7 +91,7 @@ static pid_t pgroup; -static int sapi_fastcgi_ub_write(const char *str, uint str_length) +static int sapi_fastcgi_ub_write(const char *str, uint str_length TSRMLS_DC) { uint sent = FCGX_PutStr( str, str_length, out ); return sent; Index: php4/sapi/isapi/php4isapi.c diff -u php4/sapi/isapi/php4isapi.c:1.76 php4/sapi/isapi/php4isapi.c:1.77 --- php4/sapi/isapi/php4isapi.c:1.76 Sat Aug 4 21:42:46 2001 +++ php4/sapi/isapi/php4isapi.c Sun Aug 5 11:29:43 2001 @@ -199,11 +199,10 @@ }; -static int sapi_isapi_ub_write(const char *str, uint str_length) +static int sapi_isapi_ub_write(const char *str, uint str_length TSRMLS_DC) { DWORD num_bytes = str_length; LPEXTENSION_CONTROL_BLOCK ecb; - TSRMLS_FETCH(); ecb = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); if (ecb->WriteClient(ecb->ConnID, (char *) str, &num_bytes, HSE_IO_SYNC ) == FALSE) { Index: php4/sapi/nsapi/nsapi.c diff -u php4/sapi/nsapi/nsapi.c:1.20 php4/sapi/nsapi/nsapi.c:1.21 --- php4/sapi/nsapi/nsapi.c:1.20 Sun Aug 5 01:35:05 2001 +++ php4/sapi/nsapi/nsapi.c Sun Aug 5 11:29:43 2001 @@ -135,12 +135,11 @@ static size_t nsapi_client_size = sizeof(nsapi_client)/sizeof(nsapi_client[0]); static int -sapi_nsapi_ub_write(const char *str, unsigned int str_length) +sapi_nsapi_ub_write(const char *str, unsigned int str_length TSRMLS_DC) { int retval; nsapi_request_context *rc; - TSRMLS_FETCH(); rc = (nsapi_request_context *)SG(server_context); retval = net_write(rc->sn->csd, (char *)str, str_length); if (retval == IO_ERROR /*-1*/ || retval == IO_EOF /*0*/) Index: php4/sapi/phttpd/phttpd.c diff -u php4/sapi/phttpd/phttpd.c:1.29 php4/sapi/phttpd/phttpd.c:1.30 --- php4/sapi/phttpd/phttpd.c:1.29 Sun Aug 5 01:35:05 2001 +++ php4/sapi/phttpd/phttpd.c Sun Aug 5 11:29:45 2001 @@ -57,10 +57,9 @@ } static int -php_phttpd_sapi_ub_write(const char *str, uint str_length) +php_phttpd_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) { int sent_bytes; - TSRMLS_FETCH(); sent_bytes = fd_write(PHG(cip)->fd, str, str_length); Index: php4/sapi/pi3web/pi3web_sapi.c diff -u php4/sapi/pi3web/pi3web_sapi.c:1.29 php4/sapi/pi3web/pi3web_sapi.c:1.30 --- php4/sapi/pi3web/pi3web_sapi.c:1.29 Sun Aug 5 10:17:55 2001 +++ php4/sapi/pi3web/pi3web_sapi.c Sun Aug 5 11:29:46 2001 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pi3web_sapi.c,v 1.29 2001/08/05 14:17:55 sas Exp $ */ +/* $Id: pi3web_sapi.c,v 1.30 2001/08/05 15:29:46 sas 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.29 2001/08/05 14:17:55 sas Exp $"); + php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id: pi3web_sapi.c,v 1.30 2001/08/05 15:29:46 sas 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); @@ -133,11 +133,10 @@ }; -static int zend_pi3web_ub_write(const char *str, uint str_length) +static int zend_pi3web_ub_write(const char *str, uint str_length TSRMLS_DC) { DWORD num_bytes = str_length; LPCONTROL_BLOCK cb; - TSRMLS_FETCH(); cb = (LPCONTROL_BLOCK) SG(server_context); Index: php4/sapi/roxen/roxen.c diff -u php4/sapi/roxen/roxen.c:1.46 php4/sapi/roxen/roxen.c:1.47 --- php4/sapi/roxen/roxen.c:1.46 Sun Aug 5 10:27:39 2001 +++ php4/sapi/roxen/roxen.c Sun Aug 5 11:29:46 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: roxen.c,v 1.46 2001/08/05 14:27:39 sas Exp $ */ +/* $Id: roxen.c,v 1.47 2001/08/05 15:29:46 sas Exp $ */ #include "php.h" #ifdef HAVE_ROXEN @@ -211,13 +211,12 @@ */ static int -php_roxen_low_ub_write(const char *str, uint str_length) { +php_roxen_low_ub_write(const char *str, uint str_length TSRMLS_DC) { int sent_bytes = 0; struct pike_string *to_write = NULL; #ifdef ROXEN_USE_ZTS GET_THIS(); #endif - TSRMLS_FETCH(); if(!MY_FD_OBJ->prog) { PG(connection_status) = PHP_CONNECTION_ABORTED; @@ -243,12 +242,11 @@ */ static int -php_roxen_sapi_ub_write(const char *str, uint str_length) +php_roxen_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) { #ifdef ROXEN_USE_ZTS GET_THIS(); #endif - TSRMLS_FETCH(); int sent_bytes = 0, fd = MY_FD; if(fd) @@ -276,7 +274,7 @@ } } } else { - THREAD_SAFE_RUN(sent_bytes = php_roxen_low_ub_write(str, str_length), + THREAD_SAFE_RUN(sent_bytes = php_roxen_low_ub_write(str, str_length TSRMLS_CC), "write"); } return sent_bytes; @@ -440,7 +438,7 @@ { /* char buf[512]; */ php_info_print_table_start(); - php_info_print_table_row(2, "SAPI module version", "$Id: roxen.c,v 1.46 2001/08/05 14:27:39 sas Exp $"); + php_info_print_table_row(2, "SAPI module version", "$Id: roxen.c,v 1.47 2001/08/05 15:29:46 sas Exp $"); /* php_info_print_table_row(2, "Build date", Ns_InfoBuildDate()); php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile()); php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog()); Index: php4/sapi/servlet/servlet.c diff -u php4/sapi/servlet/servlet.c:1.56 php4/sapi/servlet/servlet.c:1.57 --- php4/sapi/servlet/servlet.c:1.56 Sat Aug 4 21:42:48 2001 +++ php4/sapi/servlet/servlet.c Sun Aug 5 11:29:46 2001 @@ -114,9 +114,8 @@ * sapi callbacks */ -static int sapi_servlet_ub_write(const char *str, uint str_length) +static int sapi_servlet_ub_write(const char *str, uint str_length TSRMLS_DC) { - TSRMLS_FETCH(); if (!SG(server_context)) { fprintf(stderr, str); return 0; Index: php4/sapi/thttpd/thttpd.c diff -u php4/sapi/thttpd/thttpd.c:1.52 php4/sapi/thttpd/thttpd.c:1.53 --- php4/sapi/thttpd/thttpd.c:1.52 Sun Aug 5 10:17:55 2001 +++ php4/sapi/thttpd/thttpd.c Sun Aug 5 11:29:47 2001 @@ -43,11 +43,10 @@ #define TG(v) (thttpd_globals.v) #endif -static int sapi_thttpd_ub_write(const char *str, uint str_length) +static int sapi_thttpd_ub_write(const char *str, uint str_length TSRMLS_DC) { int n; uint sent = 0; - TSRMLS_FETCH(); while (str_length > 0) { n = send(TG(hc)->conn_fd, str, str_length, 0); Index: php4/sapi/tux/php_tux.c diff -u php4/sapi/tux/php_tux.c:1.7 php4/sapi/tux/php_tux.c:1.8 --- php4/sapi/tux/php_tux.c:1.7 Sun Aug 5 10:27:39 2001 +++ php4/sapi/tux/php_tux.c Sun Aug 5 11:29:47 2001 @@ -49,11 +49,10 @@ #define TG(v) (tux_globals.v) -static int sapi_tux_ub_write(const char *str, uint str_length) +static int sapi_tux_ub_write(const char *str, uint str_length TSRMLS_DC) { int n; uint sent = 0; - TSRMLS_FETCH(); /* combine headers and body */ if (TG(number_vec)) {