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 --- include/socketengine_iocp.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/socketengine_iocp.h b/include/socketengine_iocp.h index 615c44fd7..5de7af03f 100644 --- a/include/socketengine_iocp.h +++ b/include/socketengine_iocp.h @@ -14,7 +14,7 @@ #ifndef __SOCKETENGINE_IOCP__ #define __SOCKETENGINE_IOCP__ -#define READ_BUFFER_SIZE 500 +#define READ_BUFFER_SIZE 600 #define USING_IOCP 1 #include "inspircd_config.h" @@ -37,7 +37,11 @@ class Overlapped public: OVERLAPPED m_overlap; SocketIOEvent m_event; - int m_params; +#ifdef WIN64 + unsigned __int64 m_params; +#else + unsigned long m_params; +#endif Overlapped(SocketIOEvent ev, int params) : m_event(ev), m_params(params) { @@ -45,6 +49,14 @@ class Overlapped } }; +struct udp_overlap +{ + unsigned char udp_buffer[600]; + unsigned long udp_len; + sockaddr udp_sockaddr[2]; + unsigned long udp_sockaddr_len; +}; + struct accept_overlap { int socket; @@ -173,6 +185,11 @@ public: * @return A pointer to the event handler, or NULL */ EventHandler* GetIntRef(int fd); + + /** Holds the preallocated buffer passed to WSARecvFrom + * function. Yes, I know, it's a dirty hack. + */ + udp_overlap * udp_ov; }; //typedef void(*OpHandler)(EventHandler) -- cgit v1.2.3