From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nala Ginrut Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] read-response-body should return received data when error occcurs (V2) Date: Fri, 16 Mar 2012 13:54:56 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec51d20d827713f04bb55d9c6 X-Trace: dough.gmane.org 1331877305 7044 80.91.229.3 (16 Mar 2012 05:55:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 16 Mar 2012 05:55:05 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Mar 16 06:55:05 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 1S8Q80-000880-RS for guile-devel@m.gmane.org; Fri, 16 Mar 2012 06:55:04 +0100 Original-Received: from localhost ([::1]:32818 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8Q80-0001xU-1Z for guile-devel@m.gmane.org; Fri, 16 Mar 2012 01:55:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8Q7w-0001wQ-Jx for guile-devel@gnu.org; Fri, 16 Mar 2012 01:55:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8Q7u-0004Cb-K4 for guile-devel@gnu.org; Fri, 16 Mar 2012 01:55:00 -0400 Original-Received: from mail-vx0-f169.google.com ([209.85.220.169]:51573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8Q7u-0004CP-Cl for guile-devel@gnu.org; Fri, 16 Mar 2012 01:54:58 -0400 Original-Received: by vcbfk14 with SMTP id fk14so5025219vcb.0 for ; Thu, 15 Mar 2012 22:54:56 -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 :content-type; bh=w+ppf9pBsvLaMG8E08G2CBN6cQFZwkit/OIiaH+csPg=; b=xx4jAQ73JvuHYuG2Mc1kx4mG8GCgQUfm55Ibv47JNiIkFEVazu7H1pBIcV5cG4dXST H675oIAVhC6xY2VkHN1Ay4VXsnlu78QvTCeS7z6gmhR6SB5nMf/oouoV7i+FNNxPov/+ bbkNLyYXsT+La736oSH0s2C+5NaLRz3dJ+Z2X7PHVrpY5U3mt4yGckx3dIh8XayP0xo+ LlKXUluZcdNoDXrFZtMcmbtAiiq9gi9JRvgjD7d9hk+tQXcRvr5fmacr9mNrRNQTSZn9 IiqceAoW2dKFstkgk2foXA3Gpi4SqhOSLgfkbel+yCe4gBFCtgA7XHRaFWu3HxjLHK4y f0yg== Original-Received: by 10.52.38.102 with SMTP id f6mr936795vdk.70.1331877296697; Thu, 15 Mar 2012 22:54:56 -0700 (PDT) Original-Received: by 10.52.88.231 with HTTP; Thu, 15 Mar 2012 22:54:56 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.220.169 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:14117 Archived-At: --bcaec51d20d827713f04bb55d9c6 Content-Type: text/plain; charset=UTF-8 This patch will return any data get-bytevector-n received and throw error when get . Actually, it's not the same feature in the old version thread http://lists.gnu.org/archive/html/guile-devel/2012-03/msg00116.html The old version is complicated because it catches *any* exception and return the received data within exception. But this new version is an easy one. My point is, read-response-body is a low level procedure, so we shouldn't make it complex. But our current doesn't return received data when the received data is less than the content-length. I think it should return it, and let the user determine whether it's an error or continue reading. And if any one need a more complicated handler, it's better to write his/her own body reader. My vote is to write a high level HTTP library to deal with the complex situation. --bcaec51d20d827713f04bb55d9c6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This patch will return any data get-bytevector-n received and throw error w= hen get <eof>.
Actually, it's not the same feature in the old = version thread http://lists.gnu.org/archive/html/guile-devel/2012-03/m= sg00116.html
The old version is complicated because it catches *any* exception and retur= n the received data within exception.
But this new version is an easy on= e.
My point is, read-response-body is a low level procedure, so we shoul= dn't make it complex. But our current doesn't return received data = when the received data is less than the content-length. I think it should r= eturn it, and let the user=C2=A0 determine whether it's an error or con= tinue reading.
=C2=A0And if any one need a more complicated handler, it's better to wr= ite his/her own body reader. My vote is to write a high level HTTP library = to deal with the complex situation.
--bcaec51d20d827713f04bb55d9c6--