Re: stream filter problem
| From: | Wez Furlong | Date: | Sun, 05 Jan 2003 00:19:11 +0000 |
| Subject: | Re: stream filter problem | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-93135@lists.php.net to get a copy of this message | ||
the filter write functions should return the number of bytes of
the input buffer that they *consumed*, not how many were written.
(The read function should of course return the number read, but cannot
exceed the maximum buffer size).
However, there also seems to be a similar sounding problem with the
user-space filters; I will investiage in more detail later this weekend,
if I get time.
--Wez.
On Sun, 5 Jan 2003 moriyoshi@at.wakwak.com wrote:
> Hi,
>
> I'm currently working on base64 filter, and then I'm stuck with odd
> behaviour of stream_filter_write op. When I try to write some larger
> chunk to the next output filter than the length of buffer passed to
> my function, stream segfaults sometimes or goes into infinite loops on
> other attempts in the next call of the write op.
>
> Is this just my fault that I should always limit chunk length within the range
> of the given length? Or possible stream bugs?
>
> Please try the attached patch and run the following script to reproduce the
> problem.
>
> <?php
> stream_filter_append(STDOUT, "string.segfaulting");
> fwrite(STDOUT, "test");
> ?>
>
> Thanks,
>
> Moriyoshi
>