allow WITH_HOST setting too
This commit is contained in:
parent
ecea2b19cf
commit
dd63cbb7bc
1 changed files with 6 additions and 0 deletions
|
@ -31,12 +31,14 @@ import Data.Maybe
|
|||
import ADNS.Resolver
|
||||
import Data.Either
|
||||
#else
|
||||
#ifndef WITH_HOST
|
||||
#ifdef WITH_DNS
|
||||
import qualified Network.DNS.Lookup as DNS
|
||||
import Network.DNS.Resolver
|
||||
import qualified Data.ByteString.UTF8 as B8
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
newtype SRV = SRV String
|
||||
deriving (Show, Eq)
|
||||
|
@ -62,6 +64,9 @@ lookupSRV (SRV srv) = initResolver [] $ \resolver -> do
|
|||
resolveSRV resolver srv
|
||||
return $ either (\_ -> []) id r
|
||||
#else
|
||||
#ifdef WITH_HOST
|
||||
lookupSRV = lookupSRVHost
|
||||
#else
|
||||
#ifdef WITH_DNS
|
||||
lookupSRV (SRV srv) = do
|
||||
seed <- makeResolvSeed defaultResolvConf
|
||||
|
@ -78,6 +83,7 @@ lookupSRV (SRV srv) = do
|
|||
lookupSRV = lookupSRVHost
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
lookupSRVHost :: SRV -> IO [HostPort]
|
||||
lookupSRVHost (SRV srv)
|
||||
|
|
Loading…
Reference in a new issue