inets: request error on Windows XP

John Webb <>
Fri Apr 29 03:08:57 CEST 2005


Hello,

I am using R10B-4 and have run into a problem using http:request/4 on  
Windows XP (SP2). It seems that specifying a numeric IP address causes  
a badmatch error somewhere in the depths of inets. The same code runs  
fine on MAC OS. Has anyone else seen this problem or am I missing  
something on the windows side?

On MAC OS 10.3.9 built from the source distribution I get:

   Erlang (BEAM) emulator version 5.4.5 [source]

   Eshell V5.4.5  (abort with ^G)
   1> application:start(inets).
   ok
   2> {ok,  
{R1,_,_}}=http:request(get,{"http://www.google.com",[]},[],[]),R1.
   {"HTTP/1.1",200,"OK"}
   3> {ok,  
{R2,_,_}}=http:request(get,{"http://66.102.7.147",[]},[],[]),R2.
   {"HTTP/1.1",200,"OK"}
   4>

But on Windows XP (SP2) from the binary distribution I get:

   Erlang (BEAM) emulator version 5.4.5 [threads:0]

   Eshell V5.4.5  (abort with ^G)
   1> application:start(inets).
   ok
   2> {ok,  
{R1,_,_}}=http:request(get,{"http://www.google.com",[]},[],[]),R1.
   {"HTTP/1.1",200,"OK"}
   3> {ok,  
{R2,_,_}}=http:request(get,{"http://66.102.7.147",[]},[],[]),R2.
   ** exited: {{case_clause,{undefined,{error,
                                         {'EXIT',
                                             {{badmatch,{error,badarg}},
                                               
[{httpc_manager,start_handler,2},
                                                
{httpc_manager,handle_request,2},
                                                
{httpc_manager,handle_call,3},
                                               {gen_server,handle_msg,6},
                                               {proc_lib,init_p,5}]}}}}},
             [{http,handle_request,5},
              {erl_eval,do_apply,5},
              {erl_eval,expr,5},
              {shell,exprs,6},
              {shell,eval_loop,3}]} **
   4>
   =ERROR REPORT==== 29-Apr-2005::09:22:39 ===
   ** Generic server httpc_manager terminating
   ** Last message in was {request,{request,
                                     undefined,
                                     <0.29.0>,
                                     0,
                                     http,
                                     {"66.102.7.147",80},
                                     "/",
                                     [],
                                     get,
                                     {http_request_h,
                                         undefined,
                                         "keep-alive",
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         "66.102.7.147",
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         [],
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         "0",
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         undefined,
                                         []},
                                     {[],[]},
                                      
{http_options,infinity,true,[],false},
                                     "http://66.102.7.147"}}
   ** When Server state == {state,[],
                                14,
                                {undefined,15},
                                {options,{undefined,[]},0,2,2,disabled}}
   ** Reason for termination ==
   ** {'EXIT',{{badmatch,{error,badarg}},
             [{httpc_manager,start_handler,2},
              {httpc_manager,handle_request,2},
              {httpc_manager,handle_call,3},
              {gen_server,handle_msg,6},
              {proc_lib,init_p,5}]}}

   =ERROR REPORT==== 29-Apr-2005::09:22:40 ===
   Error in process <0.29.0> with exit value:  
{{case_clause,{undefined,{error,{'EX
    
T',{{badmatch,{error,badarg}},[{httpc_manager,start_handler,2},{httpc_ma 
nager,h
    
ndle_request,2},{httpc_manager,handle_call,3},{gen_server,handle_msg,6}, 
{proc_l
   b,init_p,5}]}}}}},[{http,...


Regards,
-jw




More information about the erlang-questions mailing list