fix build with haskell DNS 1.0.0
This commit is contained in:
parent
634132c64b
commit
26baae8967
1 changed files with 7 additions and 1 deletions
|
@ -67,8 +67,14 @@ lookupSRV (SRV srv) = initResolver [] $ \resolver -> do
|
|||
lookupSRV (SRV srv) = do
|
||||
seed <- makeResolvSeed defaultResolvConf
|
||||
r <- withResolver seed $ flip DNS.lookupSRV $ B8.fromString srv
|
||||
return $ maybe [] (orderHosts . map tohosts) r
|
||||
return $
|
||||
#if MIN_VERSION_dns(1,0,0)
|
||||
either (const []) use r
|
||||
#else
|
||||
maybe [] use r
|
||||
#endif
|
||||
where
|
||||
use = orderHosts . map tohosts
|
||||
tohosts (priority, weight, port, hostname) =
|
||||
( (priority, weight)
|
||||
, (B8.toString hostname, PortNumber $ fromIntegral port)
|
||||
|
|
Loading…
Reference in a new issue