From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Hartwig Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] read-response-body should return received data when any break happens Date: Fri, 16 Mar 2012 02:48:11 +0800 Message-ID: References: <877gylu2wf.fsf@Kagami.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1331837338 30648 80.91.229.3 (15 Mar 2012 18:48:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Mar 2012 18:48:58 +0000 (UTC) Cc: guile-devel To: Ian Price Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Mar 15 19:48:55 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S8FjJ-0005bF-3L for guile-devel@m.gmane.org; Thu, 15 Mar 2012 19:48:53 +0100 Original-Received: from localhost ([::1]:35358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8FjI-000112-Gv for guile-devel@m.gmane.org; Thu, 15 Mar 2012 14:48:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8FjA-0000z7-OX for guile-devel@gnu.org; Thu, 15 Mar 2012 14:48:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8Fih-00016b-2L for guile-devel@gnu.org; Thu, 15 Mar 2012 14:48:44 -0400 Original-Received: from mail-ee0-f41.google.com ([74.125.83.41]:34917) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8Fig-000162-Ps for guile-devel@gnu.org; Thu, 15 Mar 2012 14:48:14 -0400 Original-Received: by eeke53 with SMTP id e53so2086053eek.0 for ; Thu, 15 Mar 2012 11:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=dOl2xU7bh3rni9V+Lw8YvGYmcaGdrrQpNo8g2G53A+I=; b=LroJeUvo1XVl3rIb8C9DjotVdoZpYzNhW57HoynV/1CY6sMYPpF+9d7JlKQKWmLucu cermBFs3UWQh2b281v2ga8Kpb1nti7afiKudLCtzrXRXu9VC5WqAD72YZUNd5gszJ7a9 NN3gdy66Bvrg6KQ/7/XL7VKwNgJtaHNZVcT6WB06BkItvGEkwamkCXIa23YzV/jOTAd1 vjwlEN2a6oWsFl8yqVM4UCljwaK1CyyFuYsu6hJntlO0gScl5zVSQj3ywVTFffwQp6UK pu59KGeFTRgx918fimfjZ92MEjmIOwnA4ChjZpRUO9sEP668M4b2HOFxApMqByEb46kY /wRw== Original-Received: by 10.50.37.236 with SMTP id b12mr10720676igk.36.1331837291787; Thu, 15 Mar 2012 11:48:11 -0700 (PDT) Original-Received: by 10.231.5.161 with HTTP; Thu, 15 Mar 2012 11:48:11 -0700 (PDT) In-Reply-To: <877gylu2wf.fsf@Kagami.home> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.83.41 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:14108 Archived-At: On 16 March 2012 02:37, Ian Price wrote: > Daniel Hartwig writes: >> For example, reusing the same bytevector and looping over >> read-response-body! saving the results to disk each time. =C2=A0This lim= its >> the memory use to the size of the bytevector *and* removes the copy >> operation from your implementation (bonus!). > If you wanted to do it that way, it'd be better to pass in the port > directly and cut out the middle man. > Indeed. The procedure shown is similar to one from one of my own projects which features the write-to-disk internally. I guess it pays to keep in mind that it is trivial to rearrange procedures such as this to suit any particular situation. The OP appeared--to me--to be very over worked for the task. Perhaps such error-tolerance/streaming capabilities can be tied in at a level closer to get-bytevector-n... Regards