mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
http-get: don't shutdown write end of socket
* module/web/http.scm ("Connection"): Write the "close" token in lower-case. * module/web/client.scm (http-get): Don't shutdown the writing side of the pipe if we are not doing a keepalive, as this may prevent the request from being sent at all. Prevented http://friendfeed.com/ from being correctly fetched.
This commit is contained in:
parent
4dbac5e08b
commit
ed3e8b8e06
2 changed files with 13 additions and 5 deletions
|
@ -129,8 +129,6 @@ Otherwise it will be returned as a bytevector."
|
|||
extra-headers)))))
|
||||
(write-request req port)
|
||||
(force-output port)
|
||||
(if (not keep-alive?)
|
||||
(shutdown port 1))
|
||||
(let* ((res (read-response port))
|
||||
(body (read-response-body res)))
|
||||
(if (not keep-alive?)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; HTTP messages
|
||||
|
||||
;; Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
|
||||
|
||||
;; This library is free software; you can redistribute it and/or
|
||||
;; modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1307,9 +1307,19 @@ treated specially, and is just returned as a plain string."
|
|||
;; Connection = "Connection" ":" 1#(connection-token)
|
||||
;; connection-token = token
|
||||
;; e.g.
|
||||
;; Connection: close, foo-header
|
||||
;; Connection: close, Foo-Header
|
||||
;;
|
||||
(declare-header-list-header! "Connection")
|
||||
(declare-header! "Connection"
|
||||
split-header-names
|
||||
list-of-header-names?
|
||||
(lambda (val port)
|
||||
(write-list val port
|
||||
(lambda (x port)
|
||||
(display (if (eq? x 'close)
|
||||
"close"
|
||||
(header->string x))
|
||||
port))
|
||||
", ")))
|
||||
|
||||
;; Date = "Date" ":" HTTP-date
|
||||
;; e.g.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue