summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-02-22 23:36:03 +0100
committerFlorent Le Coz <louiz@louiz.org>2014-02-22 23:36:03 +0100
commit541af5236e69bcc86c6f993d09358173596483a7 (patch)
tree3225cb3955c3c08def15ab6837556f2f4b460334 /src/network
parent730cc6e1bd52ed2f9e785b08bfbe91e0d42605e5 (diff)
downloadbiboumi-541af5236e69bcc86c6f993d09358173596483a7.tar.gz
biboumi-541af5236e69bcc86c6f993d09358173596483a7.tar.bz2
biboumi-541af5236e69bcc86c6f993d09358173596483a7.tar.xz
biboumi-541af5236e69bcc86c6f993d09358173596483a7.zip
Consider that the connect() succeded if errno EISCONN
Apparently on some systems, subsquent connect() calls may fail with EISCONN error, to indicate that the connection succeded in the background, instead of returning 0.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/socket_handler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/socket_handler.cpp b/src/network/socket_handler.cpp
index ee21bca..ca9d9e2 100644
--- a/src/network/socket_handler.cpp
+++ b/src/network/socket_handler.cpp
@@ -97,7 +97,8 @@ void SocketHandler::connect(const std::string& address, const std::string& port)
for (struct addrinfo* rp = addr_res; rp; rp = rp->ai_next)
{
- if (::connect(this->socket, rp->ai_addr, rp->ai_addrlen) == 0)
+ if (::connect(this->socket, rp->ai_addr, rp->ai_addrlen) == 0
+ || errno == EISCONN)
{
log_info("Connection success.");
this->connected = true;