From b18e6b5556f2deedf6ebf154477c4d69dcf02638 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 20 Jan 2018 12:08:09 +0000 Subject: Pass an irc::socket::sockaddrs to SocketEngine::Connect(). --- src/inspsocket.cpp | 2 +- src/modules/m_ident.cpp | 2 +- src/socketengine.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index a564d3eec..709ad443b 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -96,7 +96,7 @@ BufferedSocketError BufferedSocket::BeginConnect(const irc::sockets::sockaddrs& SocketEngine::NonBlocking(fd); - if (SocketEngine::Connect(this, &dest.sa, dest.sa_size()) == -1) + if (SocketEngine::Connect(this, dest) == -1) { if (errno != EINPROGRESS) return I_ERR_CONNECT; diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 806c70ad2..4b110ccd6 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -126,7 +126,7 @@ class IdentRequestSocket : public EventHandler SocketEngine::NonBlocking(GetFd()); /* Attempt connection (nonblocking) */ - if (SocketEngine::Connect(this, &connaddr.sa, connaddr.sa_size()) == -1 && errno != EINPROGRESS) + if (SocketEngine::Connect(this, connaddr) == -1 && errno != EINPROGRESS) { this->Close(); throw ModuleException("connect() failed"); diff --git a/src/socketengine.cpp b/src/socketengine.cpp index 986726f3a..e02261bad 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -277,9 +277,9 @@ int SocketEngine::WriteV(EventHandler* fd, const iovec* iovec, int count) } #endif -int SocketEngine::Connect(EventHandler* fd, const sockaddr *serv_addr, socklen_t addrlen) +int SocketEngine::Connect(EventHandler* fd, const irc::sockets::sockaddrs& address) { - int ret = connect(fd->GetFd(), serv_addr, addrlen); + int ret = connect(fd->GetFd(), &address.sa, address.sa_size()); #ifdef _WIN32 if ((ret == SOCKET_ERROR) && (WSAGetLastError() == WSAEWOULDBLOCK)) errno = EINPROGRESS; -- cgit v1.2.3