Display a better error when connection fails
The error should not tell “while reading” when we are just connecting.
This commit is contained in:
@@ -266,7 +266,10 @@ ssize_t TCPSocketHandler::do_recv(void* recv_buf, const size_t buf_size)
|
|||||||
}
|
}
|
||||||
else if (-1 == size)
|
else if (-1 == size)
|
||||||
{
|
{
|
||||||
log_warning("Error while reading from socket: " << strerror(errno));
|
if (this->connecting)
|
||||||
|
log_warning("Error connecting: " << strerror(errno));
|
||||||
|
else
|
||||||
|
log_warning("Error while reading from socket: " << strerror(errno));
|
||||||
// Remember if we were connecting, or already connected when this
|
// Remember if we were connecting, or already connected when this
|
||||||
// happened, because close() sets this->connecting to false
|
// happened, because close() sets this->connecting to false
|
||||||
const auto were_connecting = this->connecting;
|
const auto were_connecting = this->connecting;
|
||||||
|
|||||||
Reference in New Issue
Block a user