Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support cancellation during client connection establishment #721

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
fixup! fixup! fixup! Support cancellation during client connection es…
…tablishment
  • Loading branch information
DerGuteMoritz committed Apr 18, 2024
commit 568847c841bff74cf1f0d1ce25a0d531bfef552f
10 changes: 5 additions & 5 deletions src/aleph/http.clj
Original file line number Diff line number Diff line change
@@ -466,11 +466,11 @@
(middleware/handle-redirects request req))))))))))))
req))]
(d/connect response result)
(d/catch' result
(fn [e]
(log/trace e "Request failed. Disposing of connection...")
(@dispose-conn!)
(d/error-deferred e)))
(d/on-realized result
identity
(fn [e]
(log/trace e "Request failed. Disposing of connection...")
(@dispose-conn!)))
result)))

(defn cancel-request!