]> granicus.if.org Git - php/commitdiff
Pass the TSRMLS parameters to the sapi flush hook, this shaves off a few TSRMLS_FETCH...
authorKalle Sommer Nielsen <kalle@php.net>
Wed, 18 Dec 2013 08:06:39 +0000 (09:06 +0100)
committerKalle Sommer Nielsen <kalle@php.net>
Wed, 18 Dec 2013 08:06:39 +0000 (09:06 +0100)
14 files changed:
main/SAPI.c
main/SAPI.h
sapi/apache/mod_php5.c
sapi/apache2filter/sapi_apache2.c
sapi/apache2handler/sapi_apache2.c
sapi/apache_hooks/mod_php5.c
sapi/cgi/cgi_main.c
sapi/cli/php_cli.c
sapi/cli/php_cli_server.c
sapi/embed/php_embed.c
sapi/fpm/fpm/fpm_main.c
sapi/litespeed/lsapi_main.c
sapi/milter/php_milter.c
sapi/nsapi/nsapi.c

index c9ba5d5dce8511650bd4ddc36555c877bba26c4f..4cdb6f946d9ce1a95e2cb563f02e4eb24aa22708 100644 (file)
@@ -992,7 +992,7 @@ SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, ch
 SAPI_API int sapi_flush(TSRMLS_D)
 {
        if (sapi_module.flush) {
-               sapi_module.flush(SG(server_context));
+               sapi_module.flush(SG(server_context) TSRMLS_CC);
                return SUCCESS;
        } else {
                return FAILURE;
index 928fca95da72ed1d134012e6939ab1744f250f83..3097cf17431e9ac8a3cd45ae3d6f7d7bff4aabae 100644 (file)
@@ -227,7 +227,7 @@ struct _sapi_module_struct {
        int (*deactivate)(TSRMLS_D);
 
        int (*ub_write)(const char *str, unsigned int str_length TSRMLS_DC);
-       void (*flush)(void *server_context);
+       void (*flush)(void *server_context TSRMLS_DC);
        struct stat *(*get_stat)(TSRMLS_D);
        char *(*getenv)(char *name, size_t name_len TSRMLS_DC);
 
index 8361f7f41060d60aee1bc17bc3ef4e7b227fc095..28039039a09a1d427e1f979267c02a01b64e871b 100644 (file)
@@ -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
index 8ce490ea43da5ee3de756a604b8e702114af9d41..c992c1c2d3daf1a1c8ff1321fa4bf6bc46e0d599 100644 (file)
@@ -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;
 
index b7f95e0c1272996b48cee904d9fe98c062c6c413..cf1a83fa533d9fa8d0469224dbda10f81e95c925 100644 (file)
@@ -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;
 
index 66adb482ed1a0a142bab145516ecef00d4a34e77..4827932c7dad53fc6914f5d71a87851335278dbb 100644 (file)
@@ -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
index 66ecce60c0068d40d3017832610a660011ba9c9a..6fc5a86d127ad57edee8315bb25ac0f2e7322749 100644 (file)
@@ -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;
 
index 2fd3dbed100f47be45225915c9000078ba2dfbcf..cb52cd70726e614688a9d50ea3f2ed3e5e00143b 100644 (file)
@@ -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.
index 77e4d09ba0a929e3fad4f14c8b3938dd043b114c..89f20f63584acb002af54de5426c90052e5b1519 100644 (file)
@@ -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;
index 414b4dbb022a523793e901d629fb4cfc1f6d9df1..66961ec6ef27a19bddcebb0aef8ddf14d0932373 100644 (file)
@@ -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();
index 91abfea959f3ad972e497329c9bfc4b55412138a..e1c8ff081a055897b3367ca86b6cd2f2afbd8e43 100644 (file)
@@ -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) {
index 1626dcb84d1bdb8d78d0cb887242d06d8e2429ae..850433d29c32482a701fd64cd38a3b3857e5285d 100644 (file)
@@ -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) {
index 7e8662fc19d0152ee70f75357f80a070d157d7c9..f0ce1b02f72d17438faf6d21afbc436ad89de367 100644 (file)
@@ -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 */
 
index 1e6a680c91a69e9b9e4f91782d2582c3fa16939d..ee0f4b09cf5ff7da12da44a9f5449f1d20c93747 100644 (file)
@@ -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 */