]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspsocket.cpp
3rd time lucky? Fix again for setsockopt.
[user/henk/code/inspircd.git] / src / inspsocket.cpp
index ebf6e3b9d3c7d31f0eda122caf038b7534c739cb..c63748eab1a16e790f1983ad91509c9f95f40d03 100644 (file)
@@ -15,7 +15,9 @@
 #include "socket.h"
 #include "inspstring.h"
 #include "socketengine.h"
+#ifndef WINDOWS
 #include <sys/uio.h>
+#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)
        {