diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/inspsocket.cpp | 14 | ||||
-rw-r--r-- | src/socketengine.cpp | 6 | ||||
-rw-r--r-- | src/users.cpp | 6 |
3 files changed, 26 insertions, 0 deletions
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 684ee051d..44fe7b72b 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -541,3 +541,17 @@ size_t StreamSocket::getSendQSize() const } return ret; } + +void StreamSocket::SwapInternals(StreamSocket& other) +{ + if (type != other.type) + return; + + EventHandler::SwapInternals(other); + std::swap(closeonempty, other.closeonempty); + std::swap(closing, other.closing); + std::swap(error, other.error); + std::swap(iohook, other.iohook); + std::swap(recvq, other.recvq); + std::swap(sendq, other.sendq); +} diff --git a/src/socketengine.cpp b/src/socketengine.cpp index df6ff5a02..f447fded8 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -50,6 +50,12 @@ EventHandler::EventHandler() event_mask = 0; } +void EventHandler::SwapInternals(EventHandler& other) +{ + std::swap(fd, other.fd); + std::swap(event_mask, other.event_mask); +} + void EventHandler::SetFd(int FD) { this->fd = FD; diff --git a/src/users.cpp b/src/users.cpp index c0dc69ff4..26353ab24 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -301,6 +301,12 @@ void UserIOHandler::AddWriteBuf(const std::string &data) WriteData(data); } +void UserIOHandler::SwapInternals(UserIOHandler& other) +{ + StreamSocket::SwapInternals(other); + std::swap(checked_until, other.checked_until); +} + bool UserIOHandler::OnSetEndPoint(const irc::sockets::sockaddrs& server, const irc::sockets::sockaddrs& client) { memcpy(&user->server_sa, &server, sizeof(irc::sockets::sockaddrs)); |