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)))))
|
(loop bs)))))
|
||||||
|
|
||||||
(define-values (in out) (make-pipe PIPE-SIZE))
|
(define-values (in out) (make-pipe PIPE-SIZE))
|
||||||
|
(define chunk-t
|
||||||
(thread
|
(thread
|
||||||
(λ ()
|
(λ ()
|
||||||
(http-pipe-chunk (http-conn-from hc) out)
|
(http-pipe-chunk (http-conn-from hc) out))))
|
||||||
|
(thread
|
||||||
|
(λ ()
|
||||||
|
(thread-wait chunk-t)
|
||||||
(when close?
|
(when close?
|
||||||
(http-conn-close! hc))
|
(http-conn-close! hc))
|
||||||
(close-output-port out)))
|
(close-output-port out)))
|
||||||
|
@ -237,9 +241,13 @@
|
||||||
(cond
|
(cond
|
||||||
[(and (memq 'gzip decodes) (regexp-member #rx#"^(?i:Content-Encoding: +gzip)$" headers))
|
[(and (memq 'gzip decodes) (regexp-member #rx#"^(?i:Content-Encoding: +gzip)$" headers))
|
||||||
(define-values (in out) (make-pipe PIPE-SIZE))
|
(define-values (in out) (make-pipe PIPE-SIZE))
|
||||||
|
(define gunzip-t
|
||||||
(thread
|
(thread
|
||||||
(λ ()
|
(λ ()
|
||||||
(gunzip-through-ports raw-response-port out)
|
(gunzip-through-ports raw-response-port out))))
|
||||||
|
(thread
|
||||||
|
(λ ()
|
||||||
|
(thread-wait gunzip-t)
|
||||||
(close-output-port out)))
|
(close-output-port out)))
|
||||||
in]
|
in]
|
||||||
[else
|
[else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user