http:request returns {error, session_remotly_closed}

Michael McDaniel erlang@REDACTED
Sun Feb 26 19:51:43 CET 2006


On Sun, Feb 26, 2006 at 09:15:32AM -0800, Soren Gronvald wrote:
> hi,
>  
> I have a problem with http:request that I think could
> be a bug (but of course it could be due to ignorance
> on my part).
<znip>  
> I am using erlang R10B-9 on Windows XP SP2
> professional edition with all updates applied. I have
> downloaded the precompiled version from erlang.org.
>  
> Best regards 
> Gronvald
>  
> I have included program examples below
>  
> this erlang program shows the problem
>  
> % this works 
> testurl(1) ->
>  U =
> "http://finance.yahoo.com/d/quotes.csv?s=IBM,GE,GM&f=sl1d1t1c1baphgvn&e=.csv",
>  geturl(U);
>  
> % this exits
> testurl(2) ->
>  U =
> "http://finance.yahoo.com/d/quotes.csv?s=IBM,GE,GM,F,PKD,GW&f=sl1d1t1c1baphgvn&e=.csv",
>  geturl(U).
>  
> geturl(Url) ->
>  application:start(inets),
>  X = http:request(Url),
>  case X of
>   {ok, { {_Version, 200, _ReasonPhrase}, _Headers,
> Body} } ->
>    Body;
>   _ -> X
>  end.
> 
<znip>  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I cut/pasted your code and compiled on R10B-9 on my Linux system.

$ uname -a
Linux delora 2.6.12-9-386 #1 Mon Oct 10 13:14:36 BST 2005 i686 GNU/Linux
$ erl -sname del
Erlang (BEAM) emulator version 5.4.12 [source] [hipe]

Eshell V5.4.12  (abort with ^G)
(del@REDACTED)1> c(foo).
{ok,foo}
(del@REDACTED)2> foo:testurl(1).
"\"IBM\",80.10,\"2/24/2006\",\"4:00pm\",-0.10,N/A,N/A,80.20,80.65,79.85,3904100,\"INTL BUSINESS MAC\"\r\n\"GE\",33.14,\"2/24/2006\",\"4:01pm\",-0.12,N/A,N/A,33.26,33.305,33.02,18275300,\"GEN ELECTRIC CO\"\r\n\"GM\",19.99,\"2/24/2006\",\"4:00pm\",-0.60,N/A,N/A,20.59,20.68,19.99,10019600,\"GEN MOTORS\"\r\n"
(del@REDACTED)3> foo:testurl(2).
"\"IBM\",80.10,\"2/24/2006\",\"4:00pm\",-0.10,N/A,N/A,80.20,80.65,79.85,3904100,\"INTL BUSINESS MAC\"\r\n\"GE\",33.14,\"2/24/2006\",\"4:01pm\",-0.12,N/A,N/A,33.26,33.305,33.02,18275300,\"GEN ELECTRIC CO\"\r\n\"GM\",19.99,\"2/24/2006\",\"4:00pm\",-0.60,N/A,N/A,20.59,20.68,19.99,10019600,\"GEN MOTORS\"\r\n\"F\",8.10,\"2/24/2006\",\"4:01pm\",-0.07,N/A,N/A,8.17,8.21,8.06,12347100,\"FORD MOTOR CO\"\r\n\"PKD\",9.78,\"2/24/2006\",\"4:01pm\",+0.21,N/A,N/A,9.57,9.91,9.66,934600,\"PARKER DRILLING C\"\r\n\"GW\",7.14,\"2/24/2006\",\"4:03pm\",-0.05,N/A,N/A,7.19,7.29,7.10,5966300,\"GREY WOLF INC\"\r\n"
(del@REDACTED)4>

Sorry that I have no further help to provide in the Windows world, though
you now know your code is ok.


~Michael
P.S. test Linux is Debian, flavor Ubuntu rel 5.10



More information about the erlang-questions mailing list