protect against errors in chunking or gunziping... without this there can be hangs
This commit is contained in:
parent
718cbd4c41
commit
fc8075245a
|
@ -192,9 +192,13 @@
|
|||
(loop bs)))))
|
||||
|
||||
(define-values (in out) (make-pipe PIPE-SIZE))
|
||||
(define chunk-t
|
||||
(thread
|
||||
(λ ()
|
||||
(http-pipe-chunk (http-conn-from hc) out))))
|
||||
(thread
|
||||
(λ ()
|
||||
(http-pipe-chunk (http-conn-from hc) out)
|
||||
(thread-wait chunk-t)
|
||||
(when close?
|
||||
(http-conn-close! hc))
|
||||
(close-output-port out)))
|
||||
|
@ -237,9 +241,13 @@
|
|||
(cond
|
||||
[(and (memq 'gzip decodes) (regexp-member #rx#"^(?i:Content-Encoding: +gzip)$" headers))
|
||||
(define-values (in out) (make-pipe PIPE-SIZE))
|
||||
(thread
|
||||
(define gunzip-t
|
||||
(thread
|
||||
(λ ()
|
||||
(gunzip-through-ports raw-response-port out))))
|
||||
(thread
|
||||
(λ ()
|
||||
(gunzip-through-ports raw-response-port out)
|
||||
(thread-wait gunzip-t)
|
||||
(close-output-port out)))
|
||||
in]
|
||||
[else
|
||||
|
|
Loading…
Reference in New Issue
Block a user