From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chris Vine Newsgroups: gmane.lisp.guile.user Subject: Re: Using guile's web client Date: Thu, 15 Mar 2012 10:40:38 +0000 Message-ID: <20120315104038.7513d7c1@laptop.homenet> References: <20120315000554.6e1918df@laptop.homenet> <877gymr7go.fsf@Kagami.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1331808069 7491 80.91.229.3 (15 Mar 2012 10:41:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Mar 2012 10:41:09 +0000 (UTC) Cc: Guile User To: Ian Price Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Mar 15 11:41:08 2012 Return-path: Envelope-to: guile-user@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 1S887I-0004QU-D0 for guile-user@m.gmane.org; Thu, 15 Mar 2012 11:41:08 +0100 Original-Received: from localhost ([::1]:50824 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S887F-0004KG-Ca for guile-user@m.gmane.org; Thu, 15 Mar 2012 06:41:05 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8876-0004IN-I5 for guile-user@gnu.org; Thu, 15 Mar 2012 06:41:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S886i-0007iI-0K for guile-user@gnu.org; Thu, 15 Mar 2012 06:40:56 -0400 Original-Received: from avasout01.plus.net ([84.93.230.227]:44580) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S886h-0007i1-My for guile-user@gnu.org; Thu, 15 Mar 2012 06:40:31 -0400 Original-Received: from laptop.homenet ([87.115.27.146]) by avasout01 with smtp id lmgT1i008398V2F01mgUzZ; Thu, 15 Mar 2012 10:40:28 +0000 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=ZZifx7pA c=1 sm=1 a=f1A3htCmpLxZ9iQnSXhhSA==:17 a=kj9zAlcOel0A:10 a=mK_AVkanAAAA:8 a=WZTzwnXT8LRIWfGFOrwA:9 a=CjuIK1q_8ugA:10 a=9xyTavCNlvEA:10 a=f1A3htCmpLxZ9iQnSXhhSA==:117 Original-Received: from laptop.homenet (IDENT:1000@localhost [127.0.0.1]) by laptop.homenet (8.14.4/8.14.4) with ESMTP id q2FAecYG006631; Thu, 15 Mar 2012 10:40:38 GMT In-Reply-To: <877gymr7go.fsf@Kagami.home> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; i686-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 84.93.230.227 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:9346 Archived-At: On Thu, 15 Mar 2012 01:14:31 +0000 Ian Price wrote: [snip] > It's actually debatable whether or not this is your fault :). http-get > returns 2 values: the response and the body. When you call > read-response-body on the port, you are trying to read information > that has already been read, and so it is coming up with an > (eof-object) rather than the body. However, I notice that the manual > doesn't actually say that it returns two values, so that'll need to > be fixed. Ah thanks, that's great. My "fault" was in assuming that in the absence of documentation, the http-get procedure does what is "obvious" (ie what other similar high-level http libraries do) and leaves the reading of the body to read-response-body. I have now looked at the source for the web module and that reveals all. It also follows then that I don't need the keep-alive on the http-get procedure call. A version of read-response-body which reads what's available would be handy, so that data could be read as it comes in if you are using guile with an event loop, say via guile's select procedure (I couldn't see one but I may well have missed it). That is obviously irrelevant to my toy trial. Chris