diff --git a/Changelog b/Changelog index d5d496e..d31324f 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +2019-02-03: +- fixed: if connection could not established we need to clear sock to -1 + 2019-01-30: - Adding unix socket to the possible connections diff --git a/tcp.cc b/tcp.cc index e7f899c..66e500d 100644 --- a/tcp.cc +++ b/tcp.cc @@ -180,6 +180,7 @@ int TCP::Connect() { if (sock == -1) continue; if (connect(sock, rp->ai_addr, rp->ai_addrlen) != -1) break; close(sock); + sock = -1; } freeaddrinfo(res);