summaryrefslogtreecommitdiff
path: root/freedomain/Lookup.hs
diff options
context:
space:
mode:
Diffstat (limited to 'freedomain/Lookup.hs')
-rw-r--r--freedomain/Lookup.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/freedomain/Lookup.hs b/freedomain/Lookup.hs
index ecaba49..413f80b 100644
--- a/freedomain/Lookup.hs
+++ b/freedomain/Lookup.hs
@@ -82,14 +82,16 @@ domainChecker :: [String -> IO Bool] -> MVar [String] -> MVar [(Bool,String)]
domainChecker chk mvin mvout cache =
nxtDom >>= \dom -> when (dom/="") $ do
c<-readMVar cache
- r<-case M.lookup dom c of
- Just xx-> return xx
+ (r,ch)<-case M.lookup dom c of
+ Just xx-> return (xx,True)
Nothing-> do x<-multiCheck chk dom
addCache x dom
- return x
+ return (x,False)
outDom r dom
- putStrLn $ dom ++ " " ++ (if r then "[\ESC[31m\STXTaken\ESC[m\STX]" else "[\ESC[32m\STXFree\ESC[m\STX]")
+ putStrLn $ dom ++ " "
+ ++ (if r then "[\ESC[31m\STXTaken\ESC[m\STX]" else "[\ESC[32m\STXFree\ESC[m\STX]")
+ ++ (if ch then " (\ESC[34m\STXcache hit\ESC[m\STX)" else "")
domainChecker chk mvin mvout cache
where outDom res dom =modifyMVar mvout $ \d ->