[Haskell-cafe] HTTP package freezes on Windows 7

Jason Dagit dagit at codersbase.com
Sat Mar 20 01:24:30 EDT 2010


On Tue, Mar 16, 2010 at 3:12 PM, Phil <phil.beadling at googlemail.com> wrote:

>  On 16/03/2010 01:05, Phil wrote:
>
> Scrap my original query - the problem isn't as black & white as I thought.
>
> The below works fine - I've changed the response type from json to xml....
> strange, but for some reason downloading json doesn't work.... it's fine on
> Linux.
>
> I'm guessing this is more likely to be a Windows issue rather than a
> Haskell issue - any ideas?
>
>
> A bit more testing - this is not a Windows issue per se.  It seems to be a
> limitation of the HTTP library running on Windows.
>
> I've ran what I consider to be identical commands (in terms of functional
> use, both perform a HTTP GET on the location given) in Haskell and Python
> from each of their consoles on the same computer.  The Python one correctly
> returns exactly what the Haskell one does on Linux.  The Haskell on Windows
> just hangs.....
>
> However as mentioned earlier SOME http requests do work from Haskell so I
> don't think it's a problem with my build of HTTP or Network libs.  The
> simplest example is to replace 'json' with 'xml' in the below query.  The
> best guess I can make is that XML is deemed renderable, but for some reason
> JSON is considered to be binary/file data?
>

If you check the type of:
simpleHTTP (getRequest "
http://maps.google.com/maps/api/geocode/json?address=London&sensor=false")

You'll see that it is, :: IO (Network.Stream.Result (Response String))

In other words, I think the HTTP request is going to return the literal text
of the request.  I think this means you're just getting an arbitrary chunk
of text back as far as it's concerned.

I started looking through the source to see if this is true. You can get to
it from the haddocks:
http://hackage.haskell.org/package/HTTP-4000.0.9

I found this:
http://hackage.haskell.org/packages/archive/HTTP/4000.0.9/doc/html/src/Network-HTTP-HandleStream.html#sendMain

Looks like some versions of HTTP could wait forever with bad servers.  I
think it's a red herring though.  That code looks to be disabled.

What I would suggest next for you, is to sniff the network traffic.  Find
out if it's spinning but not doing any IO or maybe it's making many requests
that come back with 100 Continue and it's doing just that.


>
> Can anyone confirm this behaviour.... I only have one 1 Windows PC, so I
> can't test on another machine.  If it is a wide problem, I reckon it
> warrants a bug ticket on the library.....
>

I tried it on OSX 10.5.8 and it behaved correctly here.

Do you have any sort of interesting proxies or otherwise non-vanilla setup?
 Is it possible that Windows access controls are blocking it?  Firewall
software?

Good luck!
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100320/9280f124/attachment.html


More information about the Haskell-Cafe mailing list