From 948363a78875fdb0fb2da7d3b50f90f55acb44a3 Mon Sep 17 00:00:00 2001 From: mbays Date: Tue, 4 Jul 2023 00:00:00 +0000 Subject: [PATCH] use lazy IO for certificate store and marks dir reading --- diohsc.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/diohsc.hs b/diohsc.hs index 5b40d5e..f0aea0d 100644 --- a/diohsc.hs +++ b/diohsc.hs @@ -30,6 +30,7 @@ import System.Environment import System.Exit import System.FilePath import System.IO +import System.IO.Unsafe (unsafeInterleaveIO) import qualified BStack @@ -102,8 +103,8 @@ main = do (listToMaybe [ h | SocksHost h <- opts ]) . fromMaybe "1080" $ listToMaybe [ p | SocksPort p <- opts ] - requestContext <- initRequestContext callbacks userDataDir ghost socksProxy - marks <- loadMarks marksPath + requestContext <- unsafeInterleaveIO $ initRequestContext callbacks userDataDir ghost socksProxy + marks <- unsafeInterleaveIO $ loadMarks marksPath let hlSettings = (HL.defaultSettings::HL.Settings ClientM) { HL.complete = HL.noCompletion , HL.historyFile = if ghost then Nothing else Just cmdHistoryPath -- 2.11.4.GIT