aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-12-09 22:35:22 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-12-09 22:35:57 -0800
commit142f81889b6ede73f965afa01ac67427e1335e9d (patch)
treeee00455d4ac0b9a7f5169e35f2ec34298190e8d3 /src/Text/Pandoc
parentafa88b4a25d43746de1536fae55e6d872960856a (diff)
downloadpandoc-142f81889b6ede73f965afa01ac67427e1335e9d.tar.gz
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.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Shared.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 7592b7659..ce71881e6 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -121,6 +121,7 @@ import Data.ByteString.Lazy (toChunks)
import Network.HTTP.Conduit (httpLbs, parseUrl, withManager,
responseBody, responseHeaders)
import Network.HTTP.Types.Header ( hContentType)
+import Network (withSocketsDo)
#else
import Network.URI (parseURI)
import Network.HTTP (findHeader, rspBody,
@@ -644,7 +645,7 @@ openURL u
contents = B8.pack $ unEscapeString $ drop 1 $ dropWhile (/=',') u
in return $ Right (decodeLenient contents, Just mime)
#ifdef HTTP_CONDUIT
- | otherwise = E.try $ do
+ | otherwise = withSocketsDo $ E.try $ do
req <- parseUrl u
resp <- withManager $ httpLbs req
return (BS.concat $ toChunks $ responseBody resp,