summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2001-08-05 15:29:47 +0000
committerSascha Schumann <sas@php.net>2001-08-05 15:29:47 +0000
commit8aef1930565d36807647e52b5e5b7c4e3f4a57b1 (patch)
treeb5aedc9051d566b1bcf94fef22e5d2798b33a7ea /sapi
parent02fea7ed2358518441637a1fbe5113bc4f92dd9d (diff)
downloadphp-git-8aef1930565d36807647e52b5e5b7c4e3f4a57b1.tar.gz
more tsrm cleanup
Diffstat (limited to 'sapi')
-rw-r--r--sapi/aolserver/aolserver.c3
-rw-r--r--sapi/apache/mod_php4.c5
-rw-r--r--sapi/apache/php_apache.c3
-rw-r--r--sapi/apache2filter/sapi_apache2.c3
-rw-r--r--sapi/caudium/caudium.c8
-rw-r--r--sapi/cgi/cgi_main.c16
-rw-r--r--sapi/fastcgi/fastcgi.c2
-rw-r--r--sapi/isapi/php4isapi.c3
-rw-r--r--sapi/nsapi/nsapi.c3
-rw-r--r--sapi/phttpd/phttpd.c3
-rw-r--r--sapi/pi3web/pi3web_sapi.c3
-rw-r--r--sapi/roxen/roxen.c8
-rw-r--r--sapi/servlet/servlet.c3
-rw-r--r--sapi/thttpd/thttpd.c3
-rw-r--r--sapi/tux/php_tux.c3
15 files changed, 27 insertions, 42 deletions
diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c
index 7e3271be64..3d2f0164f0 100644
--- a/sapi/aolserver/aolserver.c
+++ b/sapi/aolserver/aolserver.c
@@ -86,11 +86,10 @@ static void php_ns_config(php_ns_context *ctx, char global);
*/
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);
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c
index 4265f4aa6a..1321c5cb1b 100644
--- a/sapi/apache/mod_php4.c
+++ b/sapi/apache/mod_php4.c
@@ -124,10 +124,9 @@ void php_save_umask(void)
/* {{{ 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 @@ static void php_apache_request_shutdown(void *dummy)
{
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;
diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c
index 6b141c52b4..0f14f90421 100644
--- a/sapi/apache/php_apache.c
+++ b/sapi/apache/php_apache.c
@@ -302,7 +302,6 @@ PHP_FUNCTION(virtual)
{
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 @@ PHP_FUNCTION(virtual)
RETURN_FALSE;
}
- php_end_ob_buffers(1);
+ php_end_ob_buffers(1 TSRMLS_CC);
php_header();
if (run_sub_req(rr)) {
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index 15fab6a1cc..cca75156bf 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -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);
diff --git a/sapi/caudium/caudium.c b/sapi/caudium/caudium.c
index caae71b2dd..962b9acc92 100644
--- a/sapi/caudium/caudium.c
+++ b/sapi/caudium/caudium.c
@@ -204,10 +204,9 @@ INLINE static int lookup_integer_header(char *headername, int default_value)
*/
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 @@ php_caudium_low_ub_write(const char *str, uint str_length) {
*/
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 @@ php_caudium_sapi_ub_write(const char *str, uint str_length)
}
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;
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 52b9e6ccdd..5e09d5a694 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -108,7 +108,7 @@ static inline size_t sapi_cgibin_single_write(const char *str, uint str_length)
#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 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
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 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
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 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
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 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
/* 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 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
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;
diff --git a/sapi/fastcgi/fastcgi.c b/sapi/fastcgi/fastcgi.c
index 0984dabe84..e0a3fe7384 100644
--- a/sapi/fastcgi/fastcgi.c
+++ b/sapi/fastcgi/fastcgi.c
@@ -91,7 +91,7 @@ static int parent = 1;
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;
diff --git a/sapi/isapi/php4isapi.c b/sapi/isapi/php4isapi.c
index da0c303ebc..b272bd4ff8 100644
--- a/sapi/isapi/php4isapi.c
+++ b/sapi/isapi/php4isapi.c
@@ -199,11 +199,10 @@ static zend_module_entry php_isapi_module = {
};
-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) {
diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c
index e7633f07b6..9465db5076 100644
--- a/sapi/nsapi/nsapi.c
+++ b/sapi/nsapi/nsapi.c
@@ -135,12 +135,11 @@ static nsapi_equiv nsapi_client[] = {
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*/)
diff --git a/sapi/phttpd/phttpd.c b/sapi/phttpd/phttpd.c
index c3aec39e93..ff5cc6677c 100644
--- a/sapi/phttpd/phttpd.c
+++ b/sapi/phttpd/phttpd.c
@@ -57,10 +57,9 @@ php_phttpd_startup(sapi_module_struct *sapi_module)
}
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);
diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c
index cba147a7c2..1e94b161a2 100644
--- a/sapi/pi3web/pi3web_sapi.c
+++ b/sapi/pi3web/pi3web_sapi.c
@@ -133,11 +133,10 @@ static zend_module_entry php_pi3web_module = {
};
-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);
diff --git a/sapi/roxen/roxen.c b/sapi/roxen/roxen.c
index 9dd8708e86..81f67c43d0 100644
--- a/sapi/roxen/roxen.c
+++ b/sapi/roxen/roxen.c
@@ -211,13 +211,12 @@ INLINE static int lookup_integer_header(char *headername, int default_value)
*/
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 @@ php_roxen_low_ub_write(const char *str, uint str_length) {
*/
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 @@ php_roxen_sapi_ub_write(const char *str, uint str_length)
}
}
} 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;
diff --git a/sapi/servlet/servlet.c b/sapi/servlet/servlet.c
index edfce72b81..aaf4589b3f 100644
--- a/sapi/servlet/servlet.c
+++ b/sapi/servlet/servlet.c
@@ -114,9 +114,8 @@ void ThrowServletException (JNIEnv *jenv, char *msg) {
* 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;
diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c
index 969836ceec..d14325db94 100644
--- a/sapi/thttpd/thttpd.c
+++ b/sapi/thttpd/thttpd.c
@@ -43,11 +43,10 @@ static php_thttpd_globals thttpd_globals;
#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);
diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c
index 70199750fd..4d44b40728 100644
--- a/sapi/tux/php_tux.c
+++ b/sapi/tux/php_tux.c
@@ -49,11 +49,10 @@ static php_tux_globals tux_globals;
#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)) {