net/url: fix problems with new implementation on net/http-client
Various `net/url` operations need to request a close of the
connection after the operation completes, and `het/http-client`
needs to actually close the input-port half of a connection.
Also, add `http-conn-abandon!`.
Also also, add limits on internal pipes, so that data doesn't pile
up in a connection-processing thread, and fix POST/PUT by adding
a needed CRLF after posted data.
original commit: 0dcaa5e19f
This commit is contained in:
parent
8dfb089fc2
commit
b4613332a3
|
@ -61,6 +61,13 @@ Closes @racket[hc] if it is live.
|
|||
|
||||
}
|
||||
|
||||
@defproc[(http-conn-abandon! [hc http-conn?])
|
||||
void?]{
|
||||
|
||||
Closes the output side of @racket[hc], if it is live.
|
||||
|
||||
}
|
||||
|
||||
@defproc[(http-conn-send! [hc http-conn-live?] [uri (or/c bytes? string?)]
|
||||
[#:version version (or/c bytes? string?) #"1.1"]
|
||||
[#:method method (or/c bytes? string? symbol?) #"GET"]
|
||||
|
|
|
@ -151,12 +151,14 @@
|
|||
(module+ main (tests))
|
||||
(define (tests)
|
||||
(test
|
||||
(run-tests "http" values #f)
|
||||
(for ([i 100]) ; repeat to catch port leaks
|
||||
(run-tests "http" values #f))
|
||||
(for ([i 100])
|
||||
(run-tests "https" (let ([ctx (ssl-make-server-context)])
|
||||
(ssl-load-certificate-chain! ctx (collection-file-path "test.pem" "openssl"))
|
||||
(ssl-load-private-key! ctx (collection-file-path "test.pem" "openssl"))
|
||||
(lambda (in out)
|
||||
(ports->ssl-ports in out #:mode 'accept #:context ctx)))
|
||||
#t)))
|
||||
#t))))
|
||||
|
||||
(module+ test (require (submod ".." main))) ; for raco test & drdr
|
||||
|
|
Loading…
Reference in New Issue
Block a user