summaryrefslogtreecommitdiff
path: root/src/network/socket_handler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/socket_handler.cpp')
-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