diff options
| author | 2007-06-14 21:33:07 +0000 | |
|---|---|---|
| committer | 2007-06-14 21:33:07 +0000 | |
| commit | 2b293ebe7586687df2df9c87eb1b05697b4d318a (patch) | |
| tree | 075b8dea7e2e3dcce95606103edbe3f57553871f /src/dns.cpp | |
| parent | + Added a check between servers prefixes at the CAPAB negotiation stage. This... (diff) | |
| download | inspircd++-2b293ebe7586687df2df9c87eb1b05697b4d318a.tar.gz inspircd++-2b293ebe7586687df2df9c87eb1b05697b4d318a.tar.bz2 inspircd++-2b293ebe7586687df2df9c87eb1b05697b4d318a.zip | |
- 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
Diffstat (limited to 'src/dns.cpp')
| -rw-r--r-- | src/dns.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
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 <arpa/inet.h> #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) |
