net/http-client: fix http-conn-live? result

Merge to v6.0
(cherry picked from commit 1f6453de89)
This commit is contained in:
Matthew Flatt 2013-12-06 17:19:07 -07:00 committed by Ryan Culpepper
parent f61b212293
commit b923f9c1b2
2 changed files with 18 additions and 1 deletions

View File

@ -78,6 +78,22 @@
#:headers empty
#:data #f)
raw ereq estatus eheaders econtent))
#,(syntax/loc stx
(test-e the-port
(let ([c (hc:http-conn-open "localhost"
#:port the-port
#:ssl? #f)])
(check-equal? #t (hc:http-conn-live? c))
(hc:http-conn-send! c
"/"
#:method "GET"
#:headers empty
#:data #f)
(begin0
(hc:http-conn-recv! c
#:close? #t)
(check-equal? #f (hc:http-conn-live? c))))
raw ereq estatus eheaders econtent))
#,(syntax/loc stx
(test-e the-port
(u:http-sendrecv/url

View File

@ -44,7 +44,8 @@
(define (http-conn-live? hc)
(and (http-conn-to hc)
(http-conn-from hc)))
(http-conn-from hc)
#t))
(define (http-conn-open! hc host-bs #:ssl? [ssl? #f] #:port [port (if ssl? 443 80)])
(http-conn-close! hc)