summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaelSnoyman <>2012-11-09 10:23:57 (GMT)
committerhdiff <hdiff@luite.com>2012-11-09 10:23:57 (GMT)
commit26708e9026aec5bb8e07a9c6a0800e8cfc1b2475 (patch)
treec7580bf04732780ce379828e90053b5f02c802f3
parent8900dc1e66d61e1f85efded81f48bfe33e19128d (diff)
version 1.8.2.11.8.2.1
-rw-r--r--Network/HTTP/Conduit/Manager.hs12
-rw-r--r--http-conduit.cabal2
2 files changed, 11 insertions, 3 deletions
diff --git a/Network/HTTP/Conduit/Manager.hs b/Network/HTTP/Conduit/Manager.hs
index 6da5049..86a4143 100644
--- a/Network/HTTP/Conduit/Manager.hs
+++ b/Network/HTTP/Conduit/Manager.hs
@@ -150,11 +150,19 @@ addToList now maxCount x l@(Cons _ currCount _ _)
-- | Create a 'Manager'. You must manually call 'closeManager' to shut it down.
newManager :: ManagerSettings -> IO Manager
newManager ms = do
- certStore <- managerCertStore ms
+ icertStore <- I.newIORef Nothing
+ let getCertStore = do
+ mcertStore <- I.readIORef icertStore
+ case mcertStore of
+ Nothing -> do
+ certStore <- managerCertStore ms
+ I.writeIORef icertStore $ Just certStore
+ return certStore
+ Just x -> return x
mapRef <- I.newIORef (Just Map.empty)
certCache <- I.newIORef Map.empty
_ <- forkIO $ reap mapRef certCache
- return $ Manager mapRef (managerConnCount ms) (managerCheckCerts ms $ certStore) certCache
+ return $ Manager mapRef (managerConnCount ms) (\x y -> getCertStore >>= \cs -> managerCheckCerts ms cs x y) certCache
-- | Collect and destroy any stale connections.
reap :: I.IORef (Maybe (Map.Map ConnKey (NonEmptyList ConnInfo)))
diff --git a/http-conduit.cabal b/http-conduit.cabal
index 741024a..3bb6daa 100644
--- a/http-conduit.cabal
+++ b/http-conduit.cabal
@@ -1,5 +1,5 @@
name: http-conduit
-version: 1.8.2
+version: 1.8.2.1
license: BSD3
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>