From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Darren Hoo Newsgroups: gmane.lisp.guile.user Subject: An http session that ends with a TCP Reset sent by the server Date: Thu, 13 Jun 2013 18:23:57 +0800 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1371119050 5535 80.91.229.3 (13 Jun 2013 10:24:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Jun 2013 10:24:10 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Jun 13 12:24:11 2013 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 1Un4hP-00036B-6x for guile-user@m.gmane.org; Thu, 13 Jun 2013 12:24:11 +0200 Original-Received: from localhost ([::1]:57318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Un4hO-0007Kt-QJ for guile-user@m.gmane.org; Thu, 13 Jun 2013 06:24:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Un4hF-0007GP-Aw for guile-user@gnu.org; Thu, 13 Jun 2013 06:24:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Un4hD-0005a1-IY for guile-user@gnu.org; Thu, 13 Jun 2013 06:24:01 -0400 Original-Received: from mail-we0-x229.google.com ([2a00:1450:400c:c03::229]:57415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Un4hD-0005ZR-CV for guile-user@gnu.org; Thu, 13 Jun 2013 06:23:59 -0400 Original-Received: by mail-we0-f169.google.com with SMTP id n57so7918505wev.28 for ; Thu, 13 Jun 2013 03:23:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=cocEy93OV6HaPZd9aJ4p5MB+wB7NiWEQgWgdKiZwIrg=; b=m6CsgbRlXoFVUg+gSVbj1vTDRI7sCOdZ3Ktb8nRykTVziNxUwSn8Ik8WF9k7GifJBQ AWt+1AaqQZt0KIt9r7FSnPKxjPtLZuiOZ1akOEJvmbnevy3+7uqG9MizCYdYEnKmwjfJ wiPtv7YeU14j/b9rycEwjZUgy34lhzrKWqTO7NhZkfZDVc74ar8m6p0/Zs+osBGvdUkQ Lnh7+9iZ8z9kE3IINm9RMNekgk1ixLAqBLY6Pc/1gUF1HOABbUGxjy4qpcNJAIeau5za aoOci3kf9r9+/F9aHL8He/Gog+I/G9n1b1/e/3qh/HHjDrInOe69k8R8hxkewFxTLrJD 4KCQ== X-Received: by 10.194.173.71 with SMTP id bi7mr184874wjc.2.1371119037793; Thu, 13 Jun 2013 03:23:57 -0700 (PDT) Original-Received: by 10.194.37.72 with HTTP; Thu, 13 Jun 2013 03:23:57 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::229 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:10433 Archived-At: I used web client to access a web service as what follows: scheme@(guile-user)> (use-modules (web client)) scheme@(guile-user)> (http-get "http://172.18.23.123/") ERROR: In procedure get-bytevector-n!: ERROR: In procedure fport_fill_input: Connection reset by peer Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> ,bt In web/client.scm: 230:12 4 (request "http://172.18.23.123/" #:body #f #:port # #:method "GET" #:version (1 . 1) #:keep-alive? #f #:headers () #:decode-body? #t # #f # #) In web/response.scm: 310:2 3 (read-response-body #< version: (1 . 1) code: 200 reason-phrase: "OK" headers: ((cache-control no-cache) (connection close) (content-type text/html) (cont=85>) In unknown file: 2 (get-bytevector-all #) In web/response.scm: 249:4 1 (read! #vu8(60 104 116 109 108 62 13 10 60 104 101 97 100 62 13 10 60 115 99 114 105 112 116 32 116 121 112 101 61 34 116 101 120 116 47 106 97 118 97 115 99 114 =85) =85) In unknown file: 0 (get-bytevector-n! # #vu8(60 104 116 109 108 62 13 10 60 104 101 97 100 62 13 10 60 115 99 114 105 112 116 32 116 121 112 101 61 34 116 # =85) =85) scheme@(guile-user) [1]> tcpdump shows that the server ends the http session abruptly with a RST: 16:07:31.060489 IP 192.168.199.228.57353 > 172.18.23.123.80: Flags [S], seq 3473013508, win 65535, options [mss 1460,nop,wscale 4,nop,nop,TS val 931410271 ecr 0,sackOK,eol], length 0 16:07:31.064571 IP 172.18.23.123.80 > 192.168.199.228.57353: Flags [S.], seq 4261252364, ack 3473013509, win 1024, options [mss 1024], length 0 16:07:31.064635 IP 192.168.199.228.57353 > 172.18.23.123.80: Flags [.], ack 1, win 65535, length 0 16:07:31.064923 IP 192.168.199.228.57353 > 172.18.23.123.80: Flags [P.], seq 1:60, ack 1, win 65535, length 59 16:07:31.066022 IP 172.18.23.123.80 > 192.168.199.228.57353: Flags [P.], seq 1:521, ack 60, win 1024, length 520 16:07:31.066075 IP 192.168.199.228.57353 > 172.18.23.123.80: Flags [.], ack 521, win 65015, length 0 16:07:31.068523 IP 172.18.23.123.80 > 192.168.199.228.57353: Flags [R], seq 4261252885, win 1024, length 0 This seems compliant with RFC 1122: 4.2.2.13 Closing a Connection: RFC-793 Section 3.5 A TCP connection may terminate in two ways: (1) the normal TCP close sequence using a FIN handshake, and (2) an "abort" in which one or more RST segments are sent and the connection state is immediately discarded. The server responds with a body that contains an http redirect information = but ends with a RST packet which is case (2). My question is how I can I handle this, ie, read the response body and ignore the RST in Guile without changing anything in libguile?