From 8e825cb29df9ebadadf967ad62e2ac9b069f4c4f Mon Sep 17 00:00:00 2001 From: "carpentry-heartbeat[bot]" Date: Thu, 4 Jun 2026 09:18:37 +0200 Subject: [PATCH 1/3] Propagate Connection.send errors in build-and-send --- http-client.carp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/http-client.carp b/http-client.carp index 3f3fe61..3d93d27 100644 --- a/http-client.carp +++ b/http-client.carp @@ -263,15 +263,14 @@ the response is complete.") (match (connect &scheme &host port config) (Result.Error e) (Result.Error e) (Result.Success conn) - (let-do [host-vals [@&host] - conn-vals [@"close"] - with-host (Map.put headers &@"Host" &host-vals) - full-headers (Map.put with-host - &@"Connection" - &conn-vals) - req (Request.request @verb uri [] full-headers @body)] - (ignore (Connection.send &conn &(Request.str &req))) - (Result.Success conn))))))) + (let [host-vals [@&host] + conn-vals [@"close"] + with-host (Map.put headers &@"Host" &host-vals) + full-headers (Map.put with-host &@"Connection" &conn-vals) + req (Request.request @verb uri [] full-headers @body)] + (match (Connection.send &conn &(Request.str &req)) + (Result.Success _) (Result.Success conn) + (Result.Error e) (Result.Error e)))))))) (hidden read-headers) (private read-headers) From 6e02dba4c50165d12642fdd81f020c3a5d9b9a2e Mon Sep 17 00:00:00 2001 From: "carpentry-heartbeat[bot]" Date: Fri, 5 Jun 2026 05:44:13 +0200 Subject: [PATCH 2/3] Close connection on send error to prevent resource leak --- http-client.carp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http-client.carp b/http-client.carp index 3d93d27..d08f5f2 100644 --- a/http-client.carp +++ b/http-client.carp @@ -270,7 +270,7 @@ the response is complete.") req (Request.request @verb uri [] full-headers @body)] (match (Connection.send &conn &(Request.str &req)) (Result.Success _) (Result.Success conn) - (Result.Error e) (Result.Error e)))))))) + (Result.Error e) (do (Connection.close conn) (Result.Error e))))))))) (hidden read-headers) (private read-headers) From 0d4125aa7e98ef9c160c95be51fdd5a583e0ef10 Mon Sep 17 00:00:00 2001 From: carpentry-agent Date: Fri, 5 Jun 2026 13:11:27 +0200 Subject: [PATCH 3/3] fix: run carp-fmt on http-client.carp --- http-client.carp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/http-client.carp b/http-client.carp index d08f5f2..de6a1af 100644 --- a/http-client.carp +++ b/http-client.carp @@ -270,7 +270,8 @@ the response is complete.") req (Request.request @verb uri [] full-headers @body)] (match (Connection.send &conn &(Request.str &req)) (Result.Success _) (Result.Success conn) - (Result.Error e) (do (Connection.close conn) (Result.Error e))))))))) + (Result.Error e) + (do (Connection.close conn) (Result.Error e))))))))) (hidden read-headers) (private read-headers)