X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspsocket.cpp;h=ebbff448ed15bfd791aee08ccb49c3d13b1db6b9;hb=66ecf04088b747c00e7fdf8380fbece7848018be;hp=a564d3eec867b5d2602789c546471b8510936140;hpb=36040be2952186d56a6646ee7d972aaafdd4e31a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index a564d3eec..ebbff448e 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -83,12 +83,12 @@ BufferedSocketError BufferedSocket::BeginConnect(const std::string& ipaddr, int BufferedSocketError BufferedSocket::BeginConnect(const irc::sockets::sockaddrs& dest, const irc::sockets::sockaddrs& bind, unsigned int timeout) { if (fd < 0) - fd = socket(dest.sa.sa_family, SOCK_STREAM, 0); + fd = socket(dest.family(), SOCK_STREAM, 0); if (fd < 0) return I_ERR_SOCKET; - if (bind.sa.sa_family != 0) + if (bind.family() != 0) { if (SocketEngine::Bind(fd, bind) < 0) return I_ERR_BIND; @@ -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; @@ -293,7 +293,7 @@ void StreamSocket::FlushSendQ(SendQueue& sq) const SendQueue::Element& elem = *i; iovecs[j].iov_base = const_cast(elem.data()); iovecs[j].iov_len = elem.length(); - rv_max += elem.length(); + rv_max += iovecs[j].iov_len; } rv = SocketEngine::WriteV(this, iovecs, bufcount); } @@ -358,6 +358,11 @@ void StreamSocket::FlushSendQ(SendQueue& sq) } } +bool StreamSocket::OnSetEndPoint(const irc::sockets::sockaddrs& local, const irc::sockets::sockaddrs& remote) +{ + return false; +} + void StreamSocket::WriteData(const std::string &data) { if (fd < 0)