diff options
Diffstat (limited to 'sapi/cgi/cgi_main.c')
-rw-r--r-- | sapi/cgi/cgi_main.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 7e41932c08..538861faab 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -83,12 +83,18 @@ PHPAPI extern char *optarg; PHPAPI extern int optind; -static int zend_cgibin_ub_write(const char *str, uint str_length) +static int sapi_cgibin_ub_write(const char *str, uint str_length) { return fwrite(str, 1, str_length, stdout); } +static void sapi_cgibin_flush(void *server_context) +{ + fflush(stdout); +} + + static void sapi_cgi_send_header(sapi_header_struct *sapi_header, void *server_context) { if (sapi_header) { @@ -126,7 +132,8 @@ static sapi_module_struct sapi_module = { php_module_startup, /* startup */ php_module_shutdown_wrapper, /* shutdown */ - zend_cgibin_ub_write, /* unbuffered write */ + sapi_cgibin_ub_write, /* unbuffered write */ + sapi_cgibin_flush, /* flush */ php_error, /* error handler */ |