#34429 [Csd]: [PATCH] Output buffering cannot be turned off with FastCGI
| From: | zimage at icdsoft dot com | Date: | Sun, 18 Dec 2005 00:37:04 +0000 |
| Subject: | #34429 [Csd]: [PATCH] Output buffering cannot be turned off with FastCGI | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-90603@lists.php.net to get a copy of this message | ||
ID: 34429
User updated by: zimage at icdsoft dot com
Reported By: zimage at icdsoft dot com
Status: Closed
Bug Type: CGI related
Operating System: *
PHP Version: 5CVS, 4CVS (2005-09-12)
Assigned To: mike
New Comment:
I've just tested it and can confirm that flush() now works as expected.
Thank you.
Previous Comments:
------------------------------------------------------------------------
[2005-12-09 18:06:11] dmitry@php.net
Fixed in CVS HEAD, PHP_5_1 and PHP_5_0.
------------------------------------------------------------------------
[2005-12-06 23:29:18] ilya at cs dot msu dot su
So, here is a trivial patch, that works... Sent it to
internals@lists.php.net
Hope, this will close this bug.
? khext.patch
Index: sapi/cgi/cgi_main.c
===================================================================
RCS file: /repository/php-src/sapi/cgi/cgi_main.c,v
retrieving revision 1.271
diff -u -r1.271 cgi_main.c
--- sapi/cgi/cgi_main.c 3 Dec 2005 01:27:37 -0000 1.271
+++ sapi/cgi/cgi_main.c 6 Dec 2005 21:58:18 -0000
@@ -264,13 +264,15 @@
static void sapi_cgibin_flush(void *server_context)
{
- if (!FCGX_IsCGI()) {
+ int flush_result;
+ if (!FCGX_IsCGI()) {
FCGX_Request *request = (FCGX_Request *)
server_context;
- if (
+ flush_result = FCGX_FFlush(request->out);
+ if (
#ifndef PHP_WIN32
!parent &&
#endif
- (!request || FCGX_FFlush(request->out) == -1)) {
+ (!request || flush_result == -1)) {
php_handle_aborted_connection();
}
return;
------------------------------------------------------------------------
[2005-11-30 06:26:27] ilya at cs dot msu dot su
I've the same problem... At the newest php, on Debian and FreeBSD,
doesn't matter, using fastcgi compiled in... Any suggestions about this
problem?!
It is a very important bug for me, because I'd like to give webpages to
users by parts, compiling them on fly!-)
------------------------------------------------------------------------
[2005-11-19 03:50:22] fabwash at hotmail dot com
I have the same problem.. What I did was to send a lot of blank space
to fill up the buffer:
add_message($id, str_pad('',4096));
That fixed the problem but increases the bandwidth.
------------------------------------------------------------------------
[2005-10-10 15:06:16] pdxtechie at gmail dot com
This would also be useful for Ajax (using, for example, the
RicoAjaxEngine.) If you are unable to disable buffering, there is no
way to stream XML for progress updates through Ajax.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/34429
--
Edit this bug report at http://bugs.php.net/?id=34429&edit=1