Re: cvs: php4 /main output.c
| From: | Yasuo Ohgaki | Date: | Thu, 03 Oct 2002 13:50:33 +0000 |
| Subject: | Re: cvs: php4 /main output.c | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-88983@lists.php.net to get a copy of this message | ||
Thanks James,
I thought PG(implict_flush) was deleting buffer in old code. (but
my memory could be wrong)
Anyway, I understand the difference, but interrelation what
implicit_flush directive should do was different.
My last commit should make everyone happy, since it ignores
PG(implicit_flush).
--
Yasuo Ohgaki
James Moore wrote:
Sebastian Bergmann wrote:Yasuo, Firstly output buffering != output layering. I don't not see fixing a problem with the output layer (which implicit flush affects) in output_buffering as the right thing to do. If there is a problem it should be fixed in the output layer not output buffering otherwise everytime output buffering is used we have to remember extra function calls (IE centeralise and reduce). Now as Zeev said the first bug seems to have been introduced by him disabling output buffering in an implicit flush. Lets have a look at the expected behaviour of implicit_flush (ignore output buffering for now) If implicit flush is OFF And I call echo "blah", blah goes into a buffer and waits to be flushed so that we cut down on I/O operations. If Implicit flush is ON And I call echo "Blah" blah goes into a buffer then flush() (what actually happens is irrelevant this is the behaviour in general terms) is called automatically so blah is sent to the client immeditaly. This is useful if I am writing a command line app for example when I don't want output to have to wait. Now I have not discussed why implicit flush is always on in CLI as I would advocate defaulting this to on in php-cli.ini but not statically code it, but that is irrelevant to this issue at this second. So lets look at what happens when output buffering is on. Lets say we have multiple buffers: +-----------------------+ -+How about you read Zeev's excellent explanation of this issue in Message-Id: <5.1.0.14.2.20021003111648.05550388@localhost>?Zeev may forgot some or misunderstood my patches. I have to take a look at SAPI code. IIRC it has been changed a little to work around broken flush. (I remember someone is tweaking output layer wrongly :) Without my patch, implicit flush is __USELESS__ that needs buffers. Okay, what you want to do with implicit_flush? I think it may be okay to enable implicit_flush for CLI? with buffering by default or not?| TOP LEVEL BUFFER | |+-----------------------+ | O| | UWhen this buffer is flushed | T // IF ob_implicit_flush NOT implicit_flushThe output ends up in the | P // is use thenthis affectsnext layer | U // when thisbuffer is changed| | T \|/ | +-----------------------+ | B | NEXT OUTPUT BUFFER | | U +-----------------------+ | F | | Fwhen this buffer is flushed | Ethe data is passed to | R the output layer | S | | \|/ --++-----------------------+| OUTPUT LAYER | // It is in thissection where implicit flush has an affect+-----------------------+ // which meansafter every output operation from PHP then// flush is calledmaking sure any remaining buffered (at server level)// output is sentto the client. Now there is currently a bug in start_implicit_flush which turns output buffering off for some reason (from what zeev said) so that is the place to fix it NOT if the output_buffering layer. If everyone agress this is the behaviour that we want lets work towards this behaviour rather than adding hacks. - James