I'd recommend adopting Sara's suggestion; those memset()s you have there shouldn't be needed:
char buf[GETS_FETCH_SIZE]; while (ret > 0) { if (!f(stream, sizeof(buf), buf)) break; php_stream_write_string(IMAPG(gets_stream), buf); } return NULL; --Wez. On 9/26/05, Michael Wallner <[EMAIL PROTECTED]> wrote: > Hi Sara Golemon, you wrote: > > > Here's how I'd write this block, it assumed that f returns the number of > > bytes actually read, but according to the proto for readfn_t it *should* > > do that. > > Well, unfortunately not. It seems that net_get_buffer() in mail.c is > used as standard readfn_t which only returns NIL/T i.e. 0/1. > > But the patch's implementation is by no means mandatory, it's just > about getting the data out with enabled memory_limit, so I actually > wouldn't mind if it would get implemented in a totally different way ;) > > Regards, > -- > Michael - < mike(@)php.net > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php