psibi / download

High level download interface for Haskell
https://www.stackage.org/package/download
Other
10 stars 3 forks source link

Connection remains broken if it was broken once #11

Open thielema opened 7 years ago

thielema commented 7 years ago

Sorry, also no example here. :-( I wrote a web server and a web client. The server was written with happstack and client fetched web pages from the server via download. My observations: If I quit the server then the client could no longer connect. But if I restart the server the client still refuses to connect. I suspect that download keeps some global state that turns a temporarily broken connection into a permanently broken connection. After replacing download by HTTP:simpleHTTP the problem was gone.

psibi commented 7 years ago

I would love if you can send a PR for both of these issues. :) It may take a while for me to work on this.

benjaminselfridge commented 6 years ago

I am having this same problem. From GHCI:

openURIString "http://google.com"
Right "<!doctype html><html itemscope=\"\" itemtype=\"http://schema.org/WebPage\" lang=\"en\"> [... elided]
λ> openURIString "http://reddit.com/r/nfl"
Left "Failed to connect: Undefined error: 0"
λ> openURIString "http://google.com"
Left "Failed to connect: Undefined error: 0"