From 656e19351668cb5ada005d4e9e7e6d1f787990e2 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 2 Feb 2006 16:34:34 +0000 Subject: *UNTESTED DO NOT USE YET* - async dns for InspSocket as test - removing requirement on nss_dns.so.1 git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3017 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/dns.h | 3 +++ include/socket.h | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/dns.h b/include/dns.h index 33b5f8c7a..91e655775 100644 --- a/include/dns.h +++ b/include/dns.h @@ -78,6 +78,9 @@ public: * and returns true if the lookup was successfully initiated. */ bool ForwardLookup(std::string host); + /** Used by modules to perform a dns lookup but have the socket engine poll a module, instead of the dns object directly. + */ + bool ForwardLookupWithFD(std::string host, int &fd); /** This method will return true when the lookup is completed. It uses poll internally * to determine the status of the socket. */ diff --git a/include/socket.h b/include/socket.h index 287726a0c..e8eec405c 100644 --- a/include/socket.h +++ b/include/socket.h @@ -26,12 +26,12 @@ /** * States which a socket may be in */ -enum InspSocketState { I_DISCONNECTED, I_CONNECTING, I_CONNECTED, I_LISTENING, I_ERROR }; +enum InspSocketState { I_DISCONNECTED, I_RESOLVING, I_CONNECTING, I_CONNECTED, I_LISTENING, I_ERROR }; /** * Error types which a socket may exhibit */ -enum InspSocketError { I_ERR_TIMEOUT, I_ERR_SOCKET, I_ERR_CONNECT, I_ERR_BIND }; +enum InspSocketError { I_ERR_TIMEOUT, I_ERR_SOCKET, I_ERR_CONNECT, I_ERR_BIND, I_ERR_RESOLVE }; /** * InspSocket is an extendable socket class which modules @@ -53,6 +53,11 @@ private: */ int fd; + /** + * The resolver for this socket + */ + DNS dns; + /** * The hostname connected to */ @@ -308,6 +313,8 @@ public: * used for this socket. */ virtual ~InspSocket(); + + virtual DoResolve(); }; #endif -- cgit v1.2.3