Re: Streams segfault
| From: | Wez Furlong | Date: | Fri, 23 Aug 2002 18:04:12 +0000 |
| Subject: | Re: Streams segfault | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-87362@lists.php.net to get a copy of this message | ||
No; once closed, a stream is pefree()d - just like a FILE*.
Also, php_stream_error is currently a NOP:
#define php_stream_error(stream) (0)
It's a NOP because at the time, there was no code using the
equivalent stdio function; right now, it's only the ftp extension
that's using it.
I'll implement it this weekend, along with a couple of minor tweaks
to the filter system.
--Wez.
On 08/23/02, "Rasmus Lerdorf" <rasmus@php.net> wrote:
> Can we call php_stream_error() on a closed stream?
>
> On Fri, 23 Aug 2002, Wez Furlong wrote:
>
> > On 08/23/02, "Rasmus Lerdorf" <rasmus@lerdorf.ca> wrote:
> > > if (!n) {
> > > php_stream_close(stream);
> >
> > Closing the stream here leaves stream undefined.
> >
> > > efree(font);
> > > if (php_stream_eof(stream)) {
> >
> > And here it blows up.
> >
> > I've committed a fix for this by closing the stream a couple of
> > lines later.
> > I'm not sure why the code was like that; perhaps it was an error
> > on my part when converting it all to streams.
> >
> > Anyway, should be fixed now - thanks for pointing it out!
> >
> > --Wez.
> >
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php