Re: Re: [PATCH] imap_savebody()

From: Date: Mon, 26 Sep 2005 15:22:09 +0000
Subject: Re: Re: [PATCH] imap_savebody()
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-19172@lists.php.net to get a copy of this message
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 <mike@php.net> 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 > >

« previous php.internals (#19172) next »