summaryrefslogtreecommitdiff
path: root/Utility/SRV.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Utility/SRV.hs')
-rw-r--r--Utility/SRV.hs15
1 files changed, 1 insertions, 14 deletions
diff --git a/Utility/SRV.hs b/Utility/SRV.hs
index b6d57dea5..991f3a3d6 100644
--- a/Utility/SRV.hs
+++ b/Utility/SRV.hs
@@ -1,7 +1,6 @@
{- SRV record lookup
-
- - Uses either the ADNS Haskell library, or the standalone Haskell DNS
- - package, or the host command.
+ - Uses either the the standalone Haskell DNS package, or the host command.
-
- Copyright 2012 Joey Hess <id@joeyh.name>
-
@@ -29,16 +28,11 @@ import Data.Maybe
import Control.Applicative
import Prelude
-#ifdef WITH_ADNS
-import ADNS.Resolver
-import Data.Either
-#else
#ifdef WITH_DNS
import qualified Network.DNS.Lookup as DNS
import Network.DNS.Resolver
import qualified Data.ByteString.UTF8 as B8
#endif
-#endif
newtype SRV = SRV String
deriving (Show, Eq)
@@ -58,12 +52,6 @@ mkSRVTcp = mkSRV "tcp"
-
- On error, returns an empty list. -}
lookupSRV :: SRV -> IO [HostPort]
-#ifdef WITH_ADNS
-lookupSRV (SRV srv) = initResolver [] $ \resolver -> do
- r <- catchDefaultIO (Right []) $
- resolveSRV resolver srv
- return $ either (\_ -> []) id r
-#else
#ifdef WITH_DNS
lookupSRV (SRV srv) = do
seed <- makeResolvSeed defaultResolvConf
@@ -83,7 +71,6 @@ lookupSRV (SRV srv) = do
#else
lookupSRV = lookupSRVHost
#endif
-#endif
lookupSRVHost :: SRV -> IO [HostPort]
lookupSRVHost (SRV srv) = catchDefaultIO [] $