packages feed

dns 0.3.3 → 0.3.4

raw patch · 4 files changed

+61/−29 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Network/DNS/Decode.hs view
@@ -167,12 +167,11 @@ decodeDomain = do     pos <- getPosition     c <- getInt8-    if c == 0-      then return ""+    if c == 0 then+        return ""       else do         let n = getValue c-        if isPointer c-          then do+        if isPointer c then do             d <- getInt8             let offset = n * 256 + d             fromMaybe (error $ "decodeDomain: " ++ show offset) <$> pop offset
Network/DNS/Encode.hs view
@@ -4,6 +4,7 @@   , composeQuery   ) where +import qualified Blaze.ByteString.Builder as BB (toByteString, fromWrite, writeInt16be) import qualified Data.ByteString.Lazy.Char8 as BL (ByteString) import qualified Data.ByteString.Char8 as BS (length, null, break, drop) import Network.DNS.StateBinary@@ -104,9 +105,16 @@       , putInt16 (typeToInt rrtype)       , put16 1       , putInt32 rrttl-      , putInt16 rdlen-      , encodeRDATA rdata+      , rlenRDATA       ]+  where+    -- Encoding rdata without using rdlen+    rlenRDATA = do+        addPositionW 2 -- "simulate" putInt16+        rDataWrite <- encodeRDATA rdata+        let rdataLength = fromIntegral . BS.length . BB.toByteString . BB.fromWrite $ rDataWrite+        let rlenWrite = BB.writeInt16be rdataLength+        return rlenWrite +++ return rDataWrite  encodeRDATA :: RDATA -> SPut encodeRDATA rd = case rd of
Network/DNS/Resolver.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-|   DNS Resolver and lookup functions. @@ -41,6 +42,11 @@ import System.Random import System.Timeout +#if mingw32_HOST_OS == 1+import Network.Socket (send)+import qualified Data.ByteString.Lazy.Char8 as LB+import Control.Monad (when)+#endif ----------------------------------------------------------------  {-|@@ -152,9 +158,7 @@ lookup rlv dom typ = (>>= toRDATA) <$> lookupRaw rlv dom typ   where     {- CNAME hack-    dom' = if "." `isSuffixOf` dom-           then dom-           else dom ++ "."+    dom' = if "." `isSuffixOf` dom then dom else dom ++ "."     correct r = rrname r == dom' && rrtype r == typ     -}     correct r = rrtype r == typ@@ -177,6 +181,15 @@     q = makeQuestion dom typ     check seqno res = do         let hdr = header res-        if identifier hdr == seqno-            then Just res-            else Nothing+        if identifier hdr == seqno then+            Just res+          else+            Nothing++#if mingw32_HOST_OS == 1+    -- Windows does not support sendAll in Network.ByteString.Lazy.+    -- This implements sendAll with Haskell Strings.+    sendAll sock bs = do+	sent <- send sock (LB.unpack bs)+	when (sent < fromIntegral (LB.length bs)) $ sendAll sock (LB.drop (fromIntegral sent) bs)+#endif
dns.cabal view
@@ -1,5 +1,5 @@ Name:                   dns-Version:                0.3.3+Version:                0.3.4 Author:                 Kazu Yamamoto <kazu@iij.ad.jp> Maintainer:             Kazu Yamamoto <kazu@iij.ad.jp> License:                BSD3@@ -11,10 +11,7 @@ Build-Type:             Simple Extra-Source-Files:     Test.hs, TestProtocol.hs library-  if impl(ghc >= 6.12)-    GHC-Options:        -Wall -fno-warn-unused-do-bind-  else-    GHC-Options:        -Wall+  GHC-Options:          -Wall   Exposed-Modules:      Network.DNS                         Network.DNS.Lookup                         Network.DNS.Resolver@@ -24,19 +21,34 @@   Other-Modules:        Network.DNS.Internal                         Network.DNS.StateBinary   if impl(ghc >= 7)-    Build-Depends:      base >= 4 && < 5,-                        binary, iproute >= 1.2.4,-                        containers, mtl, bytestring, random,-                        network >= 2.3, blaze-builder,-                        attoparsec, enumerator, attoparsec-enumerator,-                        network-enumerator+    Build-Depends:      base >= 4 && < 5+                      , attoparsec+                      , attoparsec-enumerator+                      , binary+                      , blaze-builder+                      , bytestring+                      , containers+                      , enumerator+                      , iproute >= 1.2.4+                      , mtl+                      , network >= 2.3+                      , network-enumerator+                      , random   else-    Build-Depends:      base >= 4 && < 5,-                        binary, iproute >= 1.2.4,-                        containers, mtl, bytestring, random,-                        network, network-bytestring, blaze-builder,-                        attoparsec, enumerator, attoparsec-enumerator,-                        network-enumerator+    Build-Depends:      base >= 4 && < 5+                      , attoparsec+                      , attoparsec-enumerator+                      , binary+                      , blaze-builder+                      , bytestring+                      , containers+                      , enumerator+                      , iproute >= 1.2.4+                      , mtl+                      , network+                      , network-bytestring+                      , network-enumerator+                      , random Source-Repository head   Type:                 git   Location:             git://github.com/kazu-yamamoto/dns.git