Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix http downloads for Windows #1080

Closed
jgm opened this issue Dec 9, 2013 · 3 comments
Closed

Fix http downloads for Windows #1080

jgm opened this issue Dec 9, 2013 · 3 comments

Comments

@jgm
Copy link
Owner

jgm commented Dec 9, 2013

From the http-conduit documentation:

Any network code on Windows requires some initialization, and the network library provides withSocketsDo to perform it. Therefore, proper usage of this library will always involve calling that function at some point. The best approach is to simply call them at the beginning of your main function, such as:

 import Network.HTTP.Conduit
 import qualified Data.ByteString.Lazy as L
 import Network (withSocketsDo)

 main = withSocketsDo
      $ simpleHttp "http://www.haskell.org/" >>= L.putStr

This is probably what is causing reports of Result: "InternalIOException getAddrInfo: does not exist (error 10093)" in pandoc 1.12.2. (See report on pandoc-discuss.)

@jgm
Copy link
Owner Author

jgm commented Dec 9, 2013

While we're at it, let's make sure it works with the new http-conduit 2.0.

jgm pushed a commit that referenced this issue Dec 10, 2013
This should address #1080, but further testing on Windows is needed
before we can close the bug.
@dchaumette
Copy link

I've tested the patch on my Windows machine, as per below.
I don't get getAddrInfo error messages any more, and the output files are as they should be, so as far as I'm concerned the fix did the trick.

C:\Temp>pandoc -s -r html http://www.gnu.org/software/make/ -o example12.text

C:\Temp>pandoc -s -r markdown_github https://raw.github.com/ys/chekku/master/README.md -o example123.text
tls-extra:Network.TLS.Extra.Certificate
****************** certificate verify chain doesn't yet work on your platform **********************
please consider contributing to the certificate package to fix this issue

@jgm jgm closed this as completed Dec 10, 2013
@jgm
Copy link
Owner Author

jgm commented Dec 10, 2013

Excellent.

+++ Damien Chaumette [Dec 10 13 04:25 ]:

I've tested the patch on my Windows machine, as per below.
I don't get getAddrInfo error messages any more, and the output files
are as they should be, so as far as I'm concerned the fix did the
trick.
C:\Temp>pandoc -s -r html http://www.gnu.org/software/make/ -o example12.text

C:\Temp>pandoc -s -r markdown_github https://raw.github.com/ys/chekku/master/REA
DME.md -o example123.text
tls-extra:Network.TLS.Extra.Certificate
****************** certificate verify chain doesn't yet work on your platform **


please consider contributing to the certificate package to fix this issue


Reply to this email directly or [1]view it on GitHub.
[xJAuenYDiIoVt3LF3y6840VfZMr7cVcHNeAIU9nTyH8Fxw9_WX3fPJ2_qX1oiUwE.gif]

References

  1. Fix http downloads for Windows #1080 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants