summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-01-20 12:08:09 +0000
committerPeter Powell <petpow@saberuk.com>2018-01-20 12:08:09 +0000
commitb18e6b5556f2deedf6ebf154477c4d69dcf02638 (patch)
tree6638d7aa7b936892fecffac999870778ee54ba2e /src
parentbe12938393585ba0994a1aeaafcb6fd879580506 (diff)
Pass an irc::socket::sockaddrs to SocketEngine::Connect().
Diffstat (limited to 'src')
-rw-r--r--src/inspsocket.cpp2
-rw-r--r--src/modules/m_ident.cpp2
-rw-r--r--src/socketengine.cpp4
3 files changed, 4 insertions, 4 deletions
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;