From 2b293ebe7586687df2df9c87eb1b05697b4d318a Mon Sep 17 00:00:00 2001 From: burlex Date: Thu, 14 Jun 2007 21:33:07 +0000 Subject: - Fixed UDP Overlapped I/O under windows. (not the best way this could be done by far, but probably the best that is possible with our EventHandler setup). *dns will now work under win32* :) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7313 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/dns.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/dns.cpp') diff --git a/src/dns.cpp b/src/dns.cpp index 99b156bf1..2d8fdeb65 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -29,6 +29,7 @@ looks like this, walks like this or tastes like this. #include #else #include "inspircd_win32wrapper.h" +#include "inspircd_se_config.h" #endif #include "dns.h" @@ -623,8 +624,15 @@ DNSResult DNS::GetResult() #endif const char* ipaddr_from; unsigned short int port_from = 0; - +#ifdef USING_IOCP + /** Dirty hack for IOCP UDP sockets **/ + udp_overlap * ov = ((IOCPEngine*)ServerInstance->SE)->udp_ov; + memcpy(buffer, ov->udp_buffer, ov->udp_len); + memcpy(from, ov->udp_sockaddr, ov->udp_sockaddr_len); + int length = ov->udp_len; +#else int length = recvfrom(this->GetFd(),(char*)buffer,sizeof(DNSHeader),0,from,&x); +#endif /* Did we get the whole header? */ if (length < 12) -- cgit v1.3.1-10-gc9f91