1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 02:53:12 +02:00

Fixed error message from being unable to connect

This commit is contained in:
Adam
2011-07-31 04:00:35 -04:00
parent 1cb11bba5d
commit f32149117a
3 changed files with 22 additions and 11 deletions
+6 -1
View File
@@ -324,7 +324,7 @@ void SocketIO::Connect(ConnectionSocket *s, const Anope::string &target, int por
if (c == -1)
{
if (Anope::LastErrorCode() != EINPROGRESS)
throw SocketException("Error connecting to server: " + Anope::LastError());
s->OnError(Anope::LastError());
else
SocketEngine::MarkWritable(s);
}
@@ -718,6 +718,11 @@ bool ConnectionSocket::ProcessWrite()
*/
void ConnectionSocket::ProcessError()
{
int optval = 0;
socklen_t optlen = sizeof(optval);
getsockopt(this->GetFD(), SOL_SOCKET, SO_ERROR, &optval, &optlen);
errno = optval;
this->OnError(optval ? Anope::LastError() : "");
}
/** Called on a successful connect