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.
This commit is contained in:
Cadence Ember 2022-09-03 19:55:17 +12:00
parent 3f1aeb8414
commit a2ec8bb923
Signed by untrusted user: cadence
GPG Key ID: BC1C2C61CF521B17
1 changed files with 2 additions and 1 deletions

View File

@ -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)]))