diff options
author | Kalle Sommer Nielsen <kalle@php.net> | 2013-12-18 09:06:39 +0100 |
---|---|---|
committer | Kalle Sommer Nielsen <kalle@php.net> | 2013-12-18 09:06:39 +0100 |
commit | ed5a8d510f6e4ae865008fe711efbbc5452adf42 (patch) | |
tree | ee91470302effff16eae78220f55c8b16e8a4464 /sapi | |
parent | f70f89c1b1e0bbd2b2b6940bb0a4e12a2be07770 (diff) | |
download | php-git-ed5a8d510f6e4ae865008fe711efbbc5452adf42.tar.gz |
Pass the TSRMLS parameters to the sapi flush hook, this shaves off a few TSRMLS_FETCH() calls in our various SAPIs
Diffstat (limited to 'sapi')
-rw-r--r-- | sapi/apache/mod_php5.c | 2 | ||||
-rw-r--r-- | sapi/apache2filter/sapi_apache2.c | 3 | ||||
-rw-r--r-- | sapi/apache2handler/sapi_apache2.c | 3 | ||||
-rw-r--r-- | sapi/apache_hooks/mod_php5.c | 2 | ||||
-rw-r--r-- | sapi/cgi/cgi_main.c | 4 | ||||
-rw-r--r-- | sapi/cli/php_cli.c | 2 | ||||
-rw-r--r-- | sapi/cli/php_cli_server.c | 3 | ||||
-rw-r--r-- | sapi/embed/php_embed.c | 2 | ||||
-rw-r--r-- | sapi/fpm/fpm/fpm_main.c | 2 | ||||
-rw-r--r-- | sapi/litespeed/lsapi_main.c | 2 | ||||
-rw-r--r-- | sapi/milter/php_milter.c | 6 | ||||
-rw-r--r-- | sapi/nsapi/nsapi.c | 3 |
12 files changed, 13 insertions, 21 deletions
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c index 8361f7f410..28039039a0 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 8ce490ea43..c992c1c2d3 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 b7f95e0c12..cf1a83fa53 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 66adb482ed..4827932c7d 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/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 66ecce60c0..6fc5a86d12 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; diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 2fd3dbed10..cb52cd7072 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. diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 77e4d09ba0..89f20f6358 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; diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c index 414b4dbb02..66961ec6ef 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 91abfea959..e1c8ff081a 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -315,7 +315,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 1626dcb84d..850433d29c 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -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) { diff --git a/sapi/milter/php_milter.c b/sapi/milter/php_milter.c index 7e8662fc19..f0ce1b02f7 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 */ diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c index 1e6a680c91..ee0f4b09cf 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 */ |