summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2019-07-08 18:01:49 -0400
committerAndrew Cady <d@jerkface.net>2019-07-08 18:01:49 -0400
commite7373bc2114179db99dd53009b11c1c3b96c7d8e (patch)
treeefa488e7dfb2c940b1f48d0c923b612ff3626e64
parent0efeea061f1aaad7ee60162f0502c4e445489d3b (diff)
use a type for outgoing_names
-rw-r--r--lib/KeyRing.hs4
-rw-r--r--lib/KeyRing/BuildKeyDB.hs7
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/KeyRing.hs b/lib/KeyRing.hs
index 8b041f1..f8e2290 100644
--- a/lib/KeyRing.hs
+++ b/lib/KeyRing.hs
@@ -583,9 +583,9 @@ writeHostsFiles
583 [Hosts.Hosts], 583 [Hosts.Hosts],
584 Hosts.Hosts, 584 Hosts.Hosts,
585 [Hostnames], 585 [Hostnames],
586 [SockAddr]) 586 IPsToWriteToHostsFile)
587 -> IO [(FilePath, KikiReportAction)] 587 -> IO [(FilePath, KikiReportAction)]
588writeHostsFiles krd ctx (hostdbs0,hostdbs,u1,gpgnames,outgoing_names) = do 588writeHostsFiles krd ctx (hostdbs0,hostdbs,u1,gpgnames,IPsToWriteToHostsFile outgoing_names) = do
589 let hns = files isMutableHosts 589 let hns = files isMutableHosts
590 isMutableHosts stream | KF_None <- fill stream = False 590 isMutableHosts stream | KF_None <- fill stream = False
591 isMutableHosts stream | Hosts <- typ stream = True 591 isMutableHosts stream | Hosts <- typ stream = True
diff --git a/lib/KeyRing/BuildKeyDB.hs b/lib/KeyRing/BuildKeyDB.hs
index 6e62e70..a2fdfd2 100644
--- a/lib/KeyRing/BuildKeyDB.hs
+++ b/lib/KeyRing/BuildKeyDB.hs
@@ -121,6 +121,7 @@ import GnuPGAgent
121import ByteStringUtil 121import ByteStringUtil
122import Text.XXD 122import Text.XXD
123 123
124newtype IPsToWriteToHostsFile = IPsToWriteToHostsFile [SockAddr]
124-- | buildKeyDB 125-- | buildKeyDB
125-- 126--
126-- merge all keyrings, PEM files, and wallets into process memory. 127-- merge all keyrings, PEM files, and wallets into process memory.
@@ -133,7 +134,7 @@ buildKeyDB :: InputFileContext -> Maybe String -> KeyRingOperation
133 {- hostdbs -}[Hosts.Hosts], 134 {- hostdbs -}[Hosts.Hosts],
134 {- u1 -}Hosts.Hosts, 135 {- u1 -}Hosts.Hosts,
135 {- gpgnames -}[Hostnames], 136 {- gpgnames -}[Hostnames],
136 {- outgoing_names -}[SockAddr]) 137 {- outgoing_names -}IPsToWriteToHostsFile)
137 ,{- accs -} Map.Map InputFile Access 138 ,{- accs -} Map.Map InputFile Access
138 ,{- transcode -} PacketTranscoder 139 ,{- transcode -} PacketTranscoder
139 ,{- unspilled -} Map.Map InputFile Message 140 ,{- unspilled -} Map.Map InputFile Message
@@ -565,7 +566,7 @@ mergeHostFiles :: KeyRingOperation -> KeyDB -> InputFileContext
565 , [Hosts.Hosts] 566 , [Hosts.Hosts]
566 , Hosts.Hosts 567 , Hosts.Hosts
567 , [Hostnames] 568 , [Hostnames]
568 , [SockAddr])) 569 , IPsToWriteToHostsFile))
569 , [(FilePath,KikiReportAction)])) 570 , [(FilePath,KikiReportAction)]))
570mergeHostFiles krd db ctx = do 571mergeHostFiles krd db ctx = do
571 let hns = files ishosts 572 let hns = files ishosts
@@ -619,7 +620,7 @@ mergeHostFiles krd db ctx = do
619 -- forM use_db 620 -- forM use_db
620 db' <- Traversable.mapM (setHostnames outgoing_names u1) db 621 db' <- Traversable.mapM (setHostnames outgoing_names u1) db
621 622
622 return $ KikiSuccess ((db',(hostdbs0,hostdbs,u1,gpgnames,outgoing_names)),[]) 623 return $ KikiSuccess ((db',(hostdbs0,hostdbs,u1,gpgnames,IPsToWriteToHostsFile outgoing_names)),[])
623 624
624readInputFileL :: InputFileContext -> InputFile -> IO L.ByteString 625readInputFileL :: InputFileContext -> InputFile -> IO L.ByteString
625readInputFileL ctx (Pipe fd _) = fdToHandle fd >>= L.hGetContents 626readInputFileL ctx (Pipe fd _) = fdToHandle fd >>= L.hGetContents