From e6eaa24f504978eefd4d55be6b4899bd335e84f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 12 Dec 2022 14:38:43 +0100 Subject: macOS: Error out on eaddrnotavail instead of retrying This is to avoid reconnecting forever in a loop on bad configuration (such as IP in a different subnet). --- src/gun_tcp.erl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gun_tcp.erl b/src/gun_tcp.erl index 16d9e15..ffca8df 100644 --- a/src/gun_tcp.erl +++ b/src/gun_tcp.erl @@ -91,6 +91,7 @@ try_connect([], _, _, _, _, Error) -> Error. maybe_exit({error, einval}) -> exit(badarg); +maybe_exit({error, eaddrnotavail}) -> exit(badarg); maybe_exit(Error) -> Error. -spec send(inet:socket(), iodata()) -> ok | {error, atom()}. -- cgit v1.2.3