summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
Diffstat (limited to 'sapi')
-rw-r--r--sapi/apache/mod_php5.c2
-rw-r--r--sapi/apache2filter/sapi_apache2.c3
-rw-r--r--sapi/apache2handler/sapi_apache2.c3
-rw-r--r--sapi/apache_hooks/mod_php5.c2
-rw-r--r--sapi/apache_hooks/php_apache.c12
-rw-r--r--sapi/caudium/caudium.c5
-rw-r--r--sapi/cgi/cgi_main.c10
-rw-r--r--sapi/cli/php_cli.c6
-rw-r--r--sapi/cli/php_cli_server.c8
-rw-r--r--sapi/continuity/capi.c2
-rw-r--r--sapi/embed/php_embed.c2
-rw-r--r--sapi/fpm/fpm/fpm_main.c2
-rw-r--r--sapi/litespeed/lsapi_main.c6
-rw-r--r--sapi/litespeed/lsapilib.c44
-rw-r--r--sapi/milter/php_milter.c8
-rw-r--r--sapi/nsapi/nsapi.c3
-rw-r--r--sapi/pi3web/pi3web_sapi.c2
-rw-r--r--sapi/roxen/roxen.c5
-rw-r--r--sapi/thttpd/thttpd.c3
-rw-r--r--sapi/tux/php_tux.c10
20 files changed, 74 insertions, 64 deletions
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c
index a1e5a70e89..37252e1126 100644
--- a/sapi/apache/mod_php5.c
+++ b/sapi/apache/mod_php5.c
@@ -108,7 +108,7 @@ static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC)
/* {{{ sapi_apache_flush
*/
-static void sapi_apache_flush(void *server_context)
+static void sapi_apache_flush(void *server_context TSRMLS_DC)
{
if (server_context) {
#if MODULE_MAGIC_NUMBER > 19970110
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index da920f818c..6b56e78545 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -245,14 +245,13 @@ php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC)
}
static void
-php_apache_sapi_flush(void *server_context)
+php_apache_sapi_flush(void *server_context TSRMLS_DC)
{
php_struct *ctx;
apr_bucket_brigade *bb;
apr_bucket_alloc_t *ba;
apr_bucket *b;
ap_filter_t *f; /* output filters */
- TSRMLS_FETCH();
ctx = server_context;
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index d2b3a327ff..37d862f889 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -287,11 +287,10 @@ php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC)
}
static void
-php_apache_sapi_flush(void *server_context)
+php_apache_sapi_flush(void *server_context TSRMLS_DC)
{
php_struct *ctx;
request_rec *r;
- TSRMLS_FETCH();
ctx = server_context;
diff --git a/sapi/apache_hooks/mod_php5.c b/sapi/apache_hooks/mod_php5.c
index a069e324c1..901d3b57a3 100644
--- a/sapi/apache_hooks/mod_php5.c
+++ b/sapi/apache_hooks/mod_php5.c
@@ -253,7 +253,7 @@ static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC)
/* {{{ sapi_apache_flush
*/
-static void sapi_apache_flush(void *server_context)
+static void sapi_apache_flush(void *server_context TSRMLS_DC)
{
if (server_context) {
#if MODULE_MAGIC_NUMBER > 19970110
diff --git a/sapi/apache_hooks/php_apache.c b/sapi/apache_hooks/php_apache.c
index 6531ca20ee..76a4219b0a 100644
--- a/sapi/apache_hooks/php_apache.c
+++ b/sapi/apache_hooks/php_apache.c
@@ -155,15 +155,13 @@ static request_rec *get_apache_request(zval *z TSRMLS_DC)
return r;
}
-/* {{{ php_apache_request_new(request_rec *r)
+/* {{{ php_apache_request_new(request_rec *r TSRMLS_DC)
* create a new zval-instance for ApacheRequest that wraps request_rec
*/
-zval *php_apache_request_new(request_rec *r)
+zval *php_apache_request_new(request_rec *r TSRMLS_DC)
{
zval *req;
zval *addr;
-
- TSRMLS_FETCH();
MAKE_STD_ZVAL(addr);
Z_TYPE_P(addr) = IS_LONG;
@@ -1170,7 +1168,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_uri)
if (!sub_r) {
RETURN_FALSE;
}
- return_value = php_apache_request_new(sub_r);
+ return_value = php_apache_request_new(sub_r TSRMLS_CC);
}
/* }}} */
@@ -1196,7 +1194,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_file)
if (!sub_r) {
RETURN_FALSE;
}
- return_value = php_apache_request_new(sub_r);
+ return_value = php_apache_request_new(sub_r TSRMLS_CC);
}
/* }}} */
@@ -1222,7 +1220,7 @@ PHP_FUNCTION(apache_request_sub_req_method_uri)
if (!sub_r) {
RETURN_FALSE;
}
- return_value = php_apache_request_new(sub_r);
+ return_value = php_apache_request_new(sub_r TSRMLS_CC);
}
/* }}} */
diff --git a/sapi/caudium/caudium.c b/sapi/caudium/caudium.c
index e707f3576e..946f7a039e 100644
--- a/sapi/caudium/caudium.c
+++ b/sapi/caudium/caudium.c
@@ -395,11 +395,10 @@ php_caudium_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
* the client. Used for POST/PUT requests.
*/
-INLINE static int php_caudium_low_read_post(char *buf, uint count_bytes)
+INLINE static int php_caudium_low_read_post(char *buf, uint count_bytes TSRMLS_DC)
{
uint total_read = 0;
GET_THIS();
- TSRMLS_FETCH();
if(!MY_FD_OBJ->prog)
{
@@ -423,7 +422,7 @@ static int
php_caudium_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC)
{
uint total_read = 0;
- THREAD_SAFE_RUN(total_read = php_caudium_low_read_post(buf, count_bytes), "read post");
+ THREAD_SAFE_RUN(total_read = php_caudium_low_read_post(buf, count_bytes TSRMLS_CC), "read post");
return total_read;
}
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index f464e1e92a..5b22fa580f 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -324,14 +324,14 @@ static int sapi_fcgi_ub_write(const char *str, uint str_length TSRMLS_DC)
return str_length;
}
-static void sapi_cgi_flush(void *server_context)
+static void sapi_cgi_flush(void *server_context TSRMLS_DC)
{
if (fflush(stdout) == EOF) {
php_handle_aborted_connection();
}
}
-static void sapi_fcgi_flush(void *server_context)
+static void sapi_fcgi_flush(void *server_context TSRMLS_DC)
{
fcgi_request *request = (fcgi_request*) server_context;
@@ -928,7 +928,7 @@ static int sapi_cgi_deactivate(TSRMLS_D)
php_handle_aborted_connection();
}
} else {
- sapi_cgi_flush(SG(server_context));
+ sapi_cgi_flush(SG(server_context) TSRMLS_CC);
}
}
return SUCCESS;
@@ -2240,7 +2240,7 @@ consult the installation file that came with this distribution, or visit \n\
break;
case 'z': /* load extension file */
- zend_load_extension(php_optarg);
+ zend_load_extension(php_optarg TSRMLS_CC);
break;
default:
@@ -2493,7 +2493,7 @@ consult the installation file that came with this distribution, or visit \n\
/* Zeev might want to do something with this one day */
case PHP_MODE_INDENT:
open_file_for_scanning(&file_handle TSRMLS_CC);
- zend_indent();
+ zend_indent(TSRMLS_C);
zend_file_handle_dtor(&file_handle TSRMLS_CC);
php_output_teardown();
return SUCCESS;
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 9daa382eec..7c971176b6 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -320,7 +320,7 @@ static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{
}
/* }}} */
-static void sapi_cli_flush(void *server_context) /* {{{ */
+static void sapi_cli_flush(void *server_context TSRMLS_DC) /* {{{ */
{
/* Ignore EBADF here, it's caused by the fact that STDIN/STDOUT/STDERR streams
* are/could be closed before fflush() is called.
@@ -870,7 +870,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
break;
case 'z': /* load extension file */
- zend_load_extension(php_optarg);
+ zend_load_extension(php_optarg TSRMLS_CC);
break;
case 'H':
hide_argv = 1;
@@ -1024,7 +1024,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
/* Zeev might want to do something with this one day */
case PHP_MODE_INDENT:
open_file_for_scanning(&file_handle TSRMLS_CC);
- zend_indent();
+ zend_indent(TSRMLS_C);
zend_file_handle_dtor(file_handle.handle TSRMLS_CC);
goto out;
break;
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 3f2aaf0088..2c68fa17a4 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -614,10 +614,9 @@ static int sapi_cli_server_ub_write(const char *str, uint str_length TSRMLS_DC)
return php_cli_server_client_send_through(client, str, str_length);
} /* }}} */
-static void sapi_cli_server_flush(void *server_context) /* {{{ */
+static void sapi_cli_server_flush(void *server_context TSRMLS_DC) /* {{{ */
{
php_cli_server_client *client = server_context;
- TSRMLS_FETCH();
if (!client) {
return;
@@ -1144,7 +1143,7 @@ static int php_cli_server_content_sender_send(php_cli_server_content_sender *sen
return 0;
} /* }}} */
-static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sender, int fd, size_t *nbytes_read) /* {{{ */
+static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sender, int fd, size_t *nbytes_read TSRMLS_DC) /* {{{ */
{
ssize_t _nbytes_read;
php_cli_server_chunk *chunk = php_cli_server_chunk_heap_new_self_contained(131072);
@@ -1152,7 +1151,6 @@ static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sen
_nbytes_read = read(fd, chunk->data.heap.p, chunk->data.heap.len);
if (_nbytes_read < 0) {
char *errstr = get_last_error();
- TSRMLS_FETCH();
php_cli_server_logf("%s" TSRMLS_CC, errstr);
pefree(errstr, 1);
php_cli_server_chunk_dtor(chunk);
@@ -2368,7 +2366,7 @@ static int php_cli_server_send_event(php_cli_server *server, php_cli_server_clie
if (client->content_sender_initialized) {
if (client->file_fd >= 0 && !client->content_sender.buffer.first) {
size_t nbytes_read;
- if (php_cli_server_content_sender_pull(&client->content_sender, client->file_fd, &nbytes_read)) {
+ if (php_cli_server_content_sender_pull(&client->content_sender, client->file_fd, &nbytes_read TSRMLS_CC)) {
php_cli_server_close_connection(server, client TSRMLS_CC);
return FAILURE;
}
diff --git a/sapi/continuity/capi.c b/sapi/continuity/capi.c
index 953991474d..87fd9328f2 100644
--- a/sapi/continuity/capi.c
+++ b/sapi/continuity/capi.c
@@ -462,7 +462,7 @@ int phpFinit(lstTset * opt)
core_globals = ts_resource(core_globals_id);
logFmsg(0, "mod/php: PHP Interface v3 (module)");
- logFmsg(0, "mod/php: Copyright (c) 1999-2005 The PHP Group. All rights reserved.");
+ logFmsg(0, "mod/php: Copyright (c) 1999-2013 The PHP Group. All rights reserved.");
sapi_startup(&capi_sapi_module);
capi_sapi_module.startup(&capi_sapi_module);
diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c
index dad54de1ae..b4fc5aaf10 100644
--- a/sapi/embed/php_embed.c
+++ b/sapi/embed/php_embed.c
@@ -79,7 +79,7 @@ static int php_embed_ub_write(const char *str, uint str_length TSRMLS_DC)
return str_length;
}
-static void php_embed_flush(void *server_context)
+static void php_embed_flush(void *server_context TSRMLS_DC)
{
if (fflush(stdout)==EOF) {
php_handle_aborted_connection();
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 93090832f5..807ea8bb5d 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -316,7 +316,7 @@ static int sapi_cgibin_ub_write(const char *str, uint str_length TSRMLS_DC)
}
-static void sapi_cgibin_flush(void *server_context)
+static void sapi_cgibin_flush(void *server_context TSRMLS_DC)
{
/* fpm has started, let use fcgi instead of stdout */
if (fpm_is_running) {
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index 33ebb988a6..850433d29c 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: lsapi_main.c,v 1.57 2013/08/23 14:50:25 gwang Exp $ */
+/* $Id: lsapi_main.c,v 1.59 2013/11/18 21:14:38 gwang Exp $ */
#include "php.h"
#include "SAPI.h"
@@ -157,7 +157,7 @@ static int sapi_lsapi_ub_write(const char *str, uint str_length TSRMLS_DC)
/* {{{ sapi_lsapi_flush
*/
-static void sapi_lsapi_flush( void * server_context )
+static void sapi_lsapi_flush( void * server_context TSRMLS_DC )
{
if ( lsapi_mode ) {
if ( LSAPI_Flush() == -1) {
@@ -372,7 +372,7 @@ static void sapi_lsapi_log_message(char *message TSRMLS_DC)
static sapi_module_struct lsapi_sapi_module =
{
"litespeed",
- "LiteSpeed V6.4",
+ "LiteSpeed V6.6",
php_lsapi_startup, /* startup */
php_module_shutdown_wrapper, /* shutdown */
diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c
index 4a9affc60f..cdd60763db 100644
--- a/sapi/litespeed/lsapilib.c
+++ b/sapi/litespeed/lsapilib.c
@@ -1211,6 +1211,7 @@ int LSAPI_IsRunning(void)
int LSAPI_InitRequest( LSAPI_Request * pReq, int fd )
{
+ int newfd;
if ( !pReq )
return -1;
memset( pReq, 0, sizeof( LSAPI_Request ) );
@@ -1224,7 +1225,14 @@ int LSAPI_InitRequest( LSAPI_Request * pReq, int fd )
pReq->m_respPktHeaderEnd = &pReq->m_respPktHeader[5];
if ( allocateRespHeaderBuf( pReq, LSAPI_INIT_RESP_HEADER_LEN ) == -1 )
return -1;
-
+
+ if ( fd == STDIN_FILENO )
+ {
+ fd = dup( fd );
+ newfd = open( "/dev/null", O_RDWR );
+ dup2( newfd, STDIN_FILENO );
+ }
+
if ( isPipe( fd ) )
{
pReq->m_fdListen = -1;
@@ -2386,6 +2394,8 @@ typedef struct _lsapi_prefork_server
int m_iAvoidFork;
lsapi_child_status * m_pChildrenStatus;
+ lsapi_child_status * m_pChildrenStatusCur;
+ lsapi_child_status * m_pChildrenStatusEnd;
}lsapi_prefork_server;
@@ -2474,11 +2484,15 @@ static void lsapi_cleanup(int signal)
static lsapi_child_status * find_child_status( int pid )
{
lsapi_child_status * pStatus = g_prefork_server->m_pChildrenStatus;
- lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatus + g_prefork_server->m_iMaxChildren * 2;
+ lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatusEnd;
while( pStatus < pEnd )
{
if ( pStatus->m_pid == pid )
+ {
+ if ( pStatus + 1 > g_prefork_server->m_pChildrenStatusCur )
+ g_prefork_server->m_pChildrenStatusCur = pStatus + 1;
return pStatus;
+ }
++pStatus;
}
return NULL;
@@ -2513,8 +2527,12 @@ static void lsapi_sigchild( int signal )
{
child_status->m_pid = 0;
--g_prefork_server->m_iCurChildren;
+
}
}
+ while(( g_prefork_server->m_pChildrenStatusCur > g_prefork_server->m_pChildrenStatus )
+ &&( g_prefork_server->m_pChildrenStatusCur[-1].m_pid == 0 ))
+ --g_prefork_server->m_pChildrenStatusCur;
}
@@ -2523,7 +2541,7 @@ static int lsapi_init_children_status()
int size = 4096;
char * pBuf;
- size = g_prefork_server->m_iMaxChildren * sizeof( lsapi_child_status ) * 2;
+ size = (g_prefork_server->m_iMaxChildren + g_prefork_server->m_iExtraChildren ) * sizeof( lsapi_child_status ) * 2;
size = (size + 4095 ) / 4096 * 4096;
pBuf =( char*) mmap( NULL, size, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_SHARED, -1, 0 );
@@ -2533,7 +2551,9 @@ static int lsapi_init_children_status()
return -1;
}
memset( pBuf, 0, size );
- g_prefork_server->m_pChildrenStatus = (lsapi_child_status *)pBuf;
+ g_prefork_server->m_pChildrenStatus = (lsapi_child_status *)pBuf;
+ g_prefork_server->m_pChildrenStatusCur = (lsapi_child_status *)pBuf;
+ g_prefork_server->m_pChildrenStatusEnd = (lsapi_child_status *)pBuf + size / sizeof( lsapi_child_status );
return 0;
}
@@ -2563,7 +2583,7 @@ static void lsapi_check_child_status( long tmCur )
int dying = 0;
int count = 0;
lsapi_child_status * pStatus = g_prefork_server->m_pChildrenStatus;
- lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatus + g_prefork_server->m_iMaxChildren * 2;
+ lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatusCur;
while( pStatus < pEnd )
{
tobekilled = 0;
@@ -2576,13 +2596,15 @@ static void lsapi_check_child_status( long tmCur )
if (( g_prefork_server->m_iCurChildren - dying > g_prefork_server->m_iMaxChildren)||
( idle > g_prefork_server->m_iMaxIdleChildren ))
{
- tobekilled = SIGUSR1;
+ ++pStatus->m_iKillSent;
+ //tobekilled = SIGUSR1;
}
else
{
if (( s_max_idle_secs> 0)&&(tmCur - pStatus->m_tmWaitBegin > s_max_idle_secs + 5 ))
{
- tobekilled = SIGUSR1;
+ ++pStatus->m_iKillSent;
+ //tobekilled = SIGUSR1;
}
}
if ( !tobekilled )
@@ -2716,6 +2738,8 @@ static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer, LSAPI_Re
if ( pServer->m_iCurChildren >= (pServer->m_iMaxChildren + pServer->m_iExtraChildren ) )
{
+ fprintf( stderr, "Reached max children process limit: %d, extra: %d, current: %d, please increase LSAPI_CHILDREN.\n",
+ pServer->m_iMaxChildren, pServer->m_iExtraChildren, pServer->m_iCurChildren );
usleep( 100000 );
continue;
}
@@ -2876,7 +2900,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq )
{
if ( !g_running )
return -1;
- if (( s_pChildStatus )&&( s_pChildStatus->m_iKillSent ))
+ if ((s_req_processed)&&( s_pChildStatus )&&( s_pChildStatus->m_iKillSent ))
return -1;
FD_ZERO( &readfds );
FD_SET( fd, &readfds );
@@ -2904,7 +2928,7 @@ int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq )
}
else if ( ret >= 1 )
{
- if (( s_pChildStatus )&&( s_pChildStatus->m_iKillSent ))
+ if (s_req_processed && ( s_pChildStatus )&&( s_pChildStatus->m_iKillSent ))
return -1;
if ( fd == pReq->m_fdListen )
{
@@ -3066,6 +3090,8 @@ static int lsapi_initSuEXEC()
{
if ( g_prefork_server->m_iMaxChildren < 100 )
g_prefork_server->m_iMaxChildren = 100;
+ if ( g_prefork_server->m_iExtraChildren < 1000 )
+ g_prefork_server->m_iExtraChildren = 1000;
}
}
if ( !s_defaultUid || !s_defaultGid )
diff --git a/sapi/milter/php_milter.c b/sapi/milter/php_milter.c
index 432fd806c2..e0b2d0a0af 100644
--- a/sapi/milter/php_milter.c
+++ b/sapi/milter/php_milter.c
@@ -860,10 +860,6 @@ static int sapi_milter_ub_write(const char *str, uint str_length TSRMLS_DC)
return str_length;
}
-static void sapi_milter_flush(void *server_context)
-{
-}
-
static void sapi_milter_register_variables(zval *track_vars_array TSRMLS_DC)
{
php_register_variable ("SERVER_SOFTWARE", "Sendmail Milter", track_vars_array TSRMLS_CC);
@@ -906,7 +902,7 @@ static sapi_module_struct milter_sapi_module = {
NULL, /* deactivate */
sapi_milter_ub_write, /* unbuffered write */
- sapi_milter_flush, /* flush */
+ NULL, /* flush */
NULL, /* get uid */
NULL, /* getenv */
@@ -1119,7 +1115,7 @@ int main(int argc, char *argv[])
break;
case 'z': /* load extension file */
- zend_load_extension(ap_php_optarg);
+ zend_load_extension(ap_php_optarg TSRMLS_CC);
break;
default:
diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c
index ec3137ca51..5ed133c18d 100644
--- a/sapi/nsapi/nsapi.c
+++ b/sapi/nsapi/nsapi.c
@@ -467,10 +467,9 @@ static int sapi_nsapi_ub_write(const char *str, unsigned int str_length TSRMLS_D
}
/* modified version of apache2 */
-static void sapi_nsapi_flush(void *server_context)
+static void sapi_nsapi_flush(void *server_context TSRMLS_DC)
{
nsapi_request_context *rc = (nsapi_request_context *)server_context;
- TSRMLS_FETCH();
if (!rc) {
/* we have no context, so no flushing needed. This fixes a SIGSEGV on shutdown */
diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c
index 4bc08e5382..0e17c0e029 100644
--- a/sapi/pi3web/pi3web_sapi.c
+++ b/sapi/pi3web/pi3web_sapi.c
@@ -385,7 +385,7 @@ MODULE_API DWORD PHP5_wrapper(LPCONTROL_BLOCK lpCB)
}
if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS )
{
- zend_indent();
+ zend_indent(TSRMLS_C);
}
else
{
diff --git a/sapi/roxen/roxen.c b/sapi/roxen/roxen.c
index b3a64345ea..14456477b0 100644
--- a/sapi/roxen/roxen.c
+++ b/sapi/roxen/roxen.c
@@ -387,13 +387,12 @@ php_roxen_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
* the client. Used for POST/PUT requests.
*/
-INLINE static int php_roxen_low_read_post(char *buf, uint count_bytes)
+INLINE static int php_roxen_low_read_post(char *buf, uint count_bytes TSRMLS_DC)
{
uint total_read = 0;
#ifdef ROXEN_USE_ZTS
GET_THIS();
#endif
- TSRMLS_FETCH();
if(!MY_FD_OBJ->prog)
{
@@ -417,7 +416,7 @@ static int
php_roxen_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC)
{
uint total_read = 0;
- THREAD_SAFE_RUN(total_read = php_roxen_low_read_post(buf, count_bytes), "read post");
+ THREAD_SAFE_RUN(total_read = php_roxen_low_read_post(buf, count_bytes TSRMLS_CC), "read post");
return total_read;
}
diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c
index 843e4a62fb..f6ba8585b9 100644
--- a/sapi/thttpd/thttpd.c
+++ b/sapi/thttpd/thttpd.c
@@ -349,11 +349,12 @@ static zend_module_entry php_thttpd_module = {
STANDARD_MODULE_PROPERTIES
};
-static int php_thttpd_startup(sapi_module_struct *sapi_module)
+static int php_thttpd_startup(sapi_module_struct *sapi_module TSRMLS_DC)
{
#if PHP_API_VERSION >= 20020918
if (php_module_startup(sapi_module, &php_thttpd_module, 1) == FAILURE) {
#else
+ /* No TSRMLS_CC here to zend_startup_module() as 5.6 and older does not have that parameter */
if (php_module_startup(sapi_module) == FAILURE
|| zend_startup_module(&php_thttpd_module) == FAILURE) {
#endif
diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c
index 55d911f8ab..9dba8efbfe 100644
--- a/sapi/tux/php_tux.c
+++ b/sapi/tux/php_tux.c
@@ -96,7 +96,7 @@ static int sapi_tux_ub_write(const char *str, uint str_length TSRMLS_DC)
return n;
}
-static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers)
+static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
{
char buf[1024];
struct iovec *vec;
@@ -107,7 +107,6 @@ static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers)
size_t len;
char *status_line;
int locate_cl;
- TSRMLS_FETCH();
max_headers = 30;
n = 1;
@@ -158,11 +157,10 @@ static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers)
return SAPI_HEADER_SENT_SUCCESSFULLY;
}
-static int sapi_tux_read_post(char *buffer, uint count_bytes)
+static int sapi_tux_read_post(char *buffer, uint count_bytes TSRMLS_DC)
{
#if 0
int amount = 0;
- TSRMLS_FETCH();
TG(req)->objectlen = count_bytes;
TG(req)->object_addr = buffer;
@@ -177,10 +175,8 @@ static int sapi_tux_read_post(char *buffer, uint count_bytes)
#endif
}
-static char *sapi_tux_read_cookies(void)
+static char *sapi_tux_read_cookies(TSRMLS_D)
{
- TSRMLS_FETCH();
-
return TG(req)->cookies;
}