remove unused support for ADNS library
This commit is contained in:
parent
b4c9460467
commit
36e05945b8
1 changed files with 1 additions and 14 deletions
|
@ -1,7 +1,6 @@
|
||||||
{- SRV record lookup
|
{- SRV record lookup
|
||||||
-
|
-
|
||||||
- Uses either the ADNS Haskell library, or the standalone Haskell DNS
|
- Uses either the the standalone Haskell DNS package, or the host command.
|
||||||
- package, or the host command.
|
|
||||||
-
|
-
|
||||||
- Copyright 2012 Joey Hess <id@joeyh.name>
|
- Copyright 2012 Joey Hess <id@joeyh.name>
|
||||||
-
|
-
|
||||||
|
@ -29,16 +28,11 @@ import Data.Maybe
|
||||||
import Control.Applicative
|
import Control.Applicative
|
||||||
import Prelude
|
import Prelude
|
||||||
|
|
||||||
#ifdef WITH_ADNS
|
|
||||||
import ADNS.Resolver
|
|
||||||
import Data.Either
|
|
||||||
#else
|
|
||||||
#ifdef WITH_DNS
|
#ifdef WITH_DNS
|
||||||
import qualified Network.DNS.Lookup as DNS
|
import qualified Network.DNS.Lookup as DNS
|
||||||
import Network.DNS.Resolver
|
import Network.DNS.Resolver
|
||||||
import qualified Data.ByteString.UTF8 as B8
|
import qualified Data.ByteString.UTF8 as B8
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
newtype SRV = SRV String
|
newtype SRV = SRV String
|
||||||
deriving (Show, Eq)
|
deriving (Show, Eq)
|
||||||
|
@ -58,12 +52,6 @@ mkSRVTcp = mkSRV "tcp"
|
||||||
-
|
-
|
||||||
- On error, returns an empty list. -}
|
- On error, returns an empty list. -}
|
||||||
lookupSRV :: SRV -> IO [HostPort]
|
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
|
#ifdef WITH_DNS
|
||||||
lookupSRV (SRV srv) = do
|
lookupSRV (SRV srv) = do
|
||||||
seed <- makeResolvSeed defaultResolvConf
|
seed <- makeResolvSeed defaultResolvConf
|
||||||
|
@ -83,7 +71,6 @@ lookupSRV (SRV srv) = do
|
||||||
#else
|
#else
|
||||||
lookupSRV = lookupSRVHost
|
lookupSRV = lookupSRVHost
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
lookupSRVHost :: SRV -> IO [HostPort]
|
lookupSRVHost :: SRV -> IO [HostPort]
|
||||||
lookupSRVHost (SRV srv) = catchDefaultIO [] $
|
lookupSRVHost (SRV srv) = catchDefaultIO [] $
|
||||||
|
|
Loading…
Reference in a new issue