Re: Infinite Loop / Segfault in ob_*()
| From: | Sebastian Bergmann | Date: | Sun, 24 Mar 2002 08:54:01 +0000 |
| Subject: | Re: Infinite Loop / Segfault in ob_*() | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-81702@lists.php.net to get a copy of this message | ||
Yasuo Ohgaki wrote:
> I will change code so that ob_end_clean() (and other similar
> functions) may not be called from inside ob_start() call back
> function. It's easy one to fix :)
>
> This code does not make sense to me, but I may miss
> something. Do you want any usefulness in this code?
Yasuo,
of course the code snippet I posted makes no obvious sense, it is after
all only the shortest snippet of code that reproduces the segfault I
encountered.
I am currently working on an application that registers a callback via
ob_start() and gets called this way with the whole output, which
happens to be XML, of the rest of the script as its input data.
In this callback, I use the ext/xml functions to parse this XML data.
Now when, for instance, a parse error occurs, I need to emit an
appropriate error messsage, hence I need to stop the output buffering
and output something. And, at this point, it segfaults.
I would rather see the possibility of calling ob_end_clean() in a
ob_start() callback function than removing this feature.
--
Sebastian Bergmann
http://sebastian-bergmann.de/ http://phpOpenTracker.de/
Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/