darcs patch: Fallback onto simpleHTTP when Network.Browser fails
Sat Oct 11 11:45:25 EDT 2008 Stephen Hicks <sdh33@cornell.edu> * Fallback onto simpleHTTP when Network.Browser fails
Er, I forgot to --edit-description, nor did I provide a long description. Basically, I've seen a ton of complaints (and no solutions) over the mailing list and IRC about this "recv: resource vanished (Connection reset by peer)" error when attempting to 'cabal update'. I tracked it down to a bug in Network.Browser that causes it to fail when behind a NAT-based router. On the other hand, Network.HTTP.simpleHTTP, while being less feature-rich, doesn't seem to have a problem with NAT. I've submitted a bug report to the maintainer of Network.HTTP, but for the time being, I think it's also prudent to include this simple (pun intended) workaround in cabal install as well. -steve On Sat, Oct 11, 2008 at 11:48 AM, Stephen Hicks <sdh33@cornell.edu> wrote:
Sat Oct 11 11:45:25 EDT 2008 Stephen Hicks <sdh33@cornell.edu> * Fallback onto simpleHTTP when Network.Browser fails
_______________________________________________ cabal-devel mailing list cabal-devel@haskell.org http://www.haskell.org/mailman/listinfo/cabal-devel
On Sat, 2008-10-11 at 11:52 -0400, Stephen Hicks wrote:
Er, I forgot to --edit-description, nor did I provide a long description. Basically, I've seen a ton of complaints (and no solutions) over the mailing list and IRC about this "recv: resource vanished (Connection reset by peer)" error when attempting to 'cabal update'. I tracked it down to a bug in Network.Browser that causes it to fail when behind a NAT-based router. On the other hand, Network.HTTP.simpleHTTP, while being less feature-rich, doesn't seem to have a problem with NAT. I've submitted a bug report to the maintainer of Network.HTTP, but for the time being, I think it's also prudent to include this simple (pun intended) workaround in cabal install as well.
Thanks for looking into this Stephen. Do you have the details on the bug in Network.Browser? We can get that fixed. The current maintainer is happy for us to fix stuff if it's clear what needs to be done. I'd much rather do that than switch to the simpleHTTP which does not support redirects or proxies, both of which we need. Duncan
On Sat, Oct 11, 2008 at 1:51 PM, Duncan Coutts <duncan.coutts@worc.ox.ac.uk> wrote:
Thanks for looking into this Stephen. Do you have the details on the bug in Network.Browser? We can get that fixed. The current maintainer is happy for us to fix stuff if it's clear what needs to be done. I'd much rather do that than switch to the simpleHTTP which does not support redirects or proxies, both of which we need.
I'll forward the email I sent to Bjorn. The patch I submitted to cabal install still attempts to use the redirects and proxies - it only changes behavior in the case of failure. I couldn't make heads or tails of the Browser module, other than the fact that it doesn't seem to work for me. ---------- Forwarded message ---------- From: Stephen Hicks <sdh33@cornell.edu> Date: Sat, Oct 11, 2008 at 11:40 AM Subject: Bug with Network.Browser To: bjorn@bringert.net Hi, I've been experiencing problems with cabal update - particularly that whenever I'm behind NAT, I always get the error recv: resource vanished (Connection reset by peer) I tracked this bug down to the use of (browse . request) in Cabal's source. Replacing it with Network.HTTP.simpleHTTP (with appropriate transformations to the output) fixes the problem. But this sounds to me like a bug in Network.Browser, so I'm reporting it to you. I'm attaching at the bottom of this message a simple example. Here's the output I get from behind a NAT router: ===BEGIN OUTPUT=== simpleHTTP: success Sending: GET http://www.google.com/ HTTP/1.1 Creating new connection to www.google.com browser: failure: recv: resource vanished (Connection reset by peer) ===END OUTPUT=== The same error arises from the example found on http://homepages.paradise.net.nz/warrickg/haskell/http/#browser, though I didn't fully understand it, so I constructed my own example. Regards, steve hicks sdh33@cornell.edu ===BEGIN CODE=== import Network.URI import Network.HTTP import Network.Browser import Data.Maybe (fromJust) req = Request{ rqURI = fromJust $ parseURI "http://www.google.com/", rqMethod = GET, rqHeaders = [], rqBody = "" } main1 = simpleHTTP req main2 = browse $ request req try s f = catch (f >>= (\x -> seq x $ putStrLn $ s++": success")) (\e -> putStrLn $ s++": failure: "++show e) main = try "simpleHTTP" main1 >> try "browser" main2 ===END CODE===
On Sat, 2008-10-11 at 11:52 -0400, Stephen Hicks wrote:
Er, I forgot to --edit-description, nor did I provide a long description. Basically, I've seen a ton of complaints (and no solutions) over the mailing list and IRC about this "recv: resource vanished (Connection reset by peer)" error when attempting to 'cabal update'. I tracked it down to a bug in Network.Browser that causes it to fail when behind a NAT-based router. On the other hand, Network.HTTP.simpleHTTP, while being less feature-rich, doesn't seem to have a problem with NAT. I've submitted a bug report to the maintainer of Network.HTTP, but for the time being, I think it's also prudent to include this simple (pun intended) workaround in cabal install as well.
If you have a moment, could you check if this bug is fixed in the HTTP-4000.x release? Or send us the bug report you previously sent to the maintainer. The maintainer switched of course so I'm not sure if any reports got dropped in between. The current plan is to use HTTP-4000.x for cabal-install, so we want to make sure it is working as well as possible. Duncan
participants (2)
-
Duncan Coutts -
Stephen Hicks