X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspsocket.cpp;h=c63748eab1a16e790f1983ad91509c9f95f40d03;hb=64904b639d154394fa8138a7c8c0d5ff17e14718;hp=ebf6e3b9d3c7d31f0eda122caf038b7534c739cb;hpb=3dc81ee1331d1b37ee85be9bf0d843e3b6827a2d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index ebf6e3b9d..c63748eab 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -15,7 +15,9 @@ #include "socket.h" #include "inspstring.h" #include "socketengine.h" +#ifndef WINDOWS #include +#endif BufferedSocket::BufferedSocket() { @@ -46,7 +48,7 @@ void BufferedSocket::DoConnect(const std::string &ipaddr, int aport, unsigned lo BufferedSocketError BufferedSocket::BeginConnect(const std::string &ipaddr, int aport, unsigned long maxtime, const std::string &connectbindip) { irc::sockets::sockaddrs addr, bind; - if (!irc::sockets::aptosa(ipaddr.c_str(), aport, &addr)) + if (!irc::sockets::aptosa(ipaddr, aport, &addr)) { ServerInstance->Logs->Log("SOCKET", DEBUG, "BUG: Hostname passed to BufferedSocket, rather than an IP address!"); return I_ERR_CONNECT; @@ -55,7 +57,7 @@ BufferedSocketError BufferedSocket::BeginConnect(const std::string &ipaddr, int bind.sa.sa_family = 0; if (!connectbindip.empty()) { - if (!irc::sockets::aptosa(connectbindip.c_str(), 0, &bind)) + if (!irc::sockets::aptosa(connectbindip, 0, &bind)) { return I_ERR_BIND; } @@ -441,6 +443,8 @@ BufferedSocket::~BufferedSocket() void StreamSocket::HandleEvent(EventType et, int errornum) { + if (!error.empty()) + return; BufferedSocketError errcode = I_ERR_OTHER; switch (et) {