]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/dns.cpp
Changed m_messageflood to use PreMessage and PreNotice, because it may kick the user
[user/henk/code/inspircd.git] / src / dns.cpp
index 99b156bf13a21dfd2c0c0ac8ac9c30649da1e26c..d9b3671d2cfc89dffb66c2f1c78cedafd04c9304 100644 (file)
@@ -29,6 +29,7 @@ looks like this, walks like this or tastes like this.
 #include <arpa/inet.h>
 #else
 #include "inspircd_win32wrapper.h"
+#include "inspircd_se_config.h"
 #endif
 
 #include "dns.h"
@@ -41,6 +42,7 @@ using irc::sockets::insp_inaddr;
 using irc::sockets::insp_ntoa;
 using irc::sockets::insp_aton;
 using irc::sockets::OpenTCPSocket;
+using irc::sockets::NonBlocking;
 
 /** Masks to mask off the responses we get from the DNSRequest methods
  */
@@ -358,6 +360,7 @@ void DNS::Rehash()
        /* Initialize mastersocket */
        int s = OpenTCPSocket(ServerInstance->Config->DNSServer, SOCK_DGRAM);
        this->SetFd(s);
+       NonBlocking(s);
 
        /* Have we got a socket and is it nonblocking? */
        if (this->GetFd() != -1)
@@ -624,7 +627,10 @@ DNSResult DNS::GetResult()
        const char* ipaddr_from;
        unsigned short int port_from = 0;
 
-       int length = recvfrom(this->GetFd(),(char*)buffer,sizeof(DNSHeader),0,from,&x);
+       void* m_readEvent = NULL;
+       GetExt("windows_readevent", m_readEvent);
+
+       int length = _recvfrom(this->GetFd(),(char*)buffer,sizeof(DNSHeader),0,from,&x);
 
        /* Did we get the whole header? */
        if (length < 12)
@@ -756,7 +762,7 @@ DNSResult DNS::GetResult()
                                 * as the last parameter on the line with a value ":1".
                                 */
                                if (*formatted == ':')
-                                       resultstr = "0" + resultstr;
+                                       resultstr.insert(0, "0");
                        }
                        break;