]> www.average.org Git - pdns-pipe-nmc.git/blobdiff - pdns-pipe-nmc.hs
set line-buffered mode
[pdns-pipe-nmc.git] / pdns-pipe-nmc.hs
index 82c320d63936a94883b7a776d24e76d66f4e695f..304e049a9280467234768e5a21b742c63b148a0a 100644 (file)
@@ -2,6 +2,7 @@
 
 module Main where
 
+import System.IO
 import Control.Monad
 import qualified Data.ByteString.Char8 as C (pack, unpack)
 import qualified Data.ByteString.Lazy.Char8 as L (pack, unpack)
@@ -55,8 +56,6 @@ qRsp rsp =
 
 -- NMC interface
 
-descend subdom dom = dom --FIXME
-
 queryNmc :: Manager -> Config -> String -> String
          -> IO (Either String NmcDom)
 queryNmc mgr cfg fqdn qid = do
@@ -66,7 +65,7 @@ queryNmc mgr cfg fqdn qid = do
              httpLbs (qReq cfg (L.pack ("d/" ++ dn)) (L.pack qid)) mgr
       return $ case qRsp rsp of
         Left  err -> Left err
-        Right dom -> Right $ descend xs dom
+        Right dom -> Right $ descendNmc xs dom
     _           ->
       return $ Left "Only \".bit\" domain is supported"
 
@@ -76,6 +75,8 @@ main = do
 
   cfg <- readConfig confFile
 
+  hSetBuffering stdin  LineBuffering
+  hSetBuffering stdout LineBuffering
   ver <- do
     let
       loopErr e = forever $ do