http-conduit 1.8.2 → 1.8.2.1
raw patch · 2 files changed
+11/−3 lines, 2 files
Files
- Network/HTTP/Conduit/Manager.hs +10/−2
- http-conduit.cabal +1/−1
Network/HTTP/Conduit/Manager.hs view
@@ -150,11 +150,19 @@ -- | 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)))
http-conduit.cabal view
@@ -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>