git.iko.soy/typeable/pandoc
on master help sign in
Added `withSocketsDo` around http conduit code in `openURL`.

This should address #1080, but further testing on Windows is needed before we can close the bug.

commit142f81889b6ede73f965afa01ac67427e1335e9d authorJohn MacFarlane <fiddlosopher@gmail.com> dateMon 9 Dec 2013, 22:35 (13 years ago) parentafa88b4
1 file changed+2−1
src/Text/Pandoc/Shared.hs+2−1
src/Text/Pandoc/Shared.hs+2−1
@@ -121,6 +121,7 @@ import Data.ByteString.Lazy (toChunks)
121121import Network.HTTP.Conduit (httpLbs, parseUrl, withManager,
122122 responseBody, responseHeaders)
123123import Network.HTTP.Types.Header ( hContentType)
124+import Network (withSocketsDo)
124125#else
125126import Network.URI (parseURI)
126127import Network.HTTP (findHeader, rspBody,
@@ -644,7 +645,7 @@ openURL u
644645 contents = B8.pack $ unEscapeString $ drop 1 $ dropWhile (/=',') u
645646 in return $ Right (decodeLenient contents, Just mime)
646647#ifdef HTTP_CONDUIT
647− | otherwise = E.try $ do
648+ | otherwise = withSocketsDo $ E.try $ do
648649 req <- parseUrl u
649650 resp <- withManager $ httpLbs req
650651 return (BS.concat $ toChunks $ responseBody resp,