summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-04-15 06:47:38 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-04-15 06:47:38 +0200
commit58a2c00d443db24e415582fcd267b848e8c7e313 (patch)
tree27ac4cac29d780597d16ecefc7216d623906e458
parentf7b75d7eb4a52ac58a213e98e300f66850e32e82 (diff)
downloadbiboumi-58a2c00d443db24e415582fcd267b848e8c7e313.tar.gz
biboumi-58a2c00d443db24e415582fcd267b848e8c7e313.tar.bz2
biboumi-58a2c00d443db24e415582fcd267b848e8c7e313.tar.xz
biboumi-58a2c00d443db24e415582fcd267b848e8c7e313.zip
Call on_connection_failed() when the connection fails to be established
-rw-r--r--src/network/socket_handler.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/socket_handler.cpp b/src/network/socket_handler.cpp
index 74446d9..546b1b4 100644
--- a/src/network/socket_handler.cpp
+++ b/src/network/socket_handler.cpp
@@ -155,7 +155,10 @@ void SocketHandler::on_recv()
else if (-1 == size)
{
log_warning("Error while reading from socket: " << strerror(errno));
- this->on_connection_close();
+ if (this->connecting)
+ this->on_connection_failed(strerror(errno));
+ else
+ this->on_connection_close();
this->close();
}
else