www_tools http client

Shawn Pearce <>
Tue Jan 14 22:53:04 CET 2003

Ok, new info:

I was calling it with:

url:raw_get_url("http://xenon:80)/", 6000).

This was giving me a problem as IIS (the webserver at xenon, port 80)
was responding with "400 Bad Request".  Turns out the request line
looked like:

	Cmd=["GET ",[]," HTTP/1.0\r\n\r\n"]

bug in the URL parser?

So I tried:

49> url:raw_get_url("http://xenon:80/index",6000).
Cmd=["GET ","index"," HTTP/1.0\r\n\r\n"]
url_server: fetching "xenon" 80 "index"

Which is also illegal, as "index" is missing the leading /.  Turns
out this works:

50> url:raw_get_url("http://xenon:80//index",6000).
Cmd=["GET ","/index"," HTTP/1.0\r\n\r\n"]
url_server: fetching "xenon" 80 "/index"
Socket = #Port<0.130>
What the? {error,closed}

And gen_tcp provides the closed message, I just didn't handle it.

So somehow IIS is killing the socket on me and as a result is making
Erts think the socket is no longer a socket, and therefore we can't
close it...  odd..


More information about the erlang-questions mailing list