From a2ec8bb9239a016d0a5ccaa304c5af926b5d2b0b Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Sat, 3 Sep 2022 19:55:17 +1200 Subject: [PATCH] Fix image loading not working after a while http-easy connections are pooled, and streaming responses does not automatically close the response (they are closed automatically in other situations). After 128 (the default) opened connections to fetch images, the pool ran out of connections, and future attempts would just time out waiting for a connection. Fixed by manually closing the connection at the correct time. --- src/page-proxy.rkt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/page-proxy.rkt b/src/page-proxy.rkt index e6c7f5f..f494e28 100644 --- a/src/page-proxy.rkt +++ b/src/page-proxy.rkt @@ -24,6 +24,7 @@ #:code (easy:response-status-code dest-r) #:mime-type (easy:response-headers-ref dest-r 'content-type) (λ (out) - (copy-port (easy:response-output dest-r) out))))) + (copy-port (easy:response-output dest-r) out) + (easy:response-close! dest-r))))) (next-dispatcher))] [#f (next-dispatcher)]))