Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19172 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40788 invoked by uid 1010); 26 Sep 2005 15:22:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 40773 invoked from network); 26 Sep 2005 15:22:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Sep 2005 15:22:13 -0000 X-Host-Fingerprint: 64.233.162.194 zproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.162.194:30595] helo=zproxy.gmail.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 83/4D-24510-52218334 for ; Mon, 26 Sep 2005 11:22:13 -0400 Received: by zproxy.gmail.com with SMTP id 40so378582nzk for ; Mon, 26 Sep 2005 08:22:09 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Luf2mllxRtDogp400B4Clpxb2zxZ5eAHlb6MBfh2kgHbYvOkaMzCXQbqifmt2cSEuWNNJHxe12anRj8aWpcYbK6v5CDxuTcQcTerF8Xs9MV+18FOeQ1tOyju34h9g+or0fLLLfk8pZW8KLiqzW2UkaoEQ/6ZNYbk0s92PH54DOI= Received: by 10.54.143.15 with SMTP id q15mr626359wrd; Mon, 26 Sep 2005 08:22:09 -0700 (PDT) Received: by 10.54.76.6 with HTTP; Mon, 26 Sep 2005 08:22:09 -0700 (PDT) Message-ID: <4e89b4260509260822f0ac52d@mail.gmail.com> Date: Mon, 26 Sep 2005 11:22:09 -0400 Reply-To: Wez Furlong To: Michael Wallner Cc: internals@lists.php.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <79.1A.24510.546D2334@pb1.pair.com> <91.71.24510.E9A93334@pb1.pair.com> <003501c5c064$4782bc60$5c8be5a9@ohr.berkeley.edu> <35.D0.24510.B52F7334@pb1.pair.com> <001001c5c2aa$f73a7740$6c051fac@lighthammer> Subject: Re: [PHP-DEV] Re: [PATCH] imap_savebody() From: kingwez@gmail.com (Wez Furlong) 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 wrote: > Hi Sara Golemon, you wrote: > > > Here's how I'd write this block, it assumed that f returns the number o= f > > 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 > >