[erlang-bugs] error headers cause httpc:request hang forever

cao xu <>
Thu Jan 17 03:46:47 CET 2013


Hi

	I did the following test on R15B and also R1304 from the erlang shell :

Request1= {"http://www.google.com",[{"cookie",undefined}, {"test",123}],"application/x-www-form-urlencoded; charset=utf-8", <<"">>}.
httpc:request(post, Request1, [{timeout,1000}], []).

	You can find the following error messages on R13:

=ERROR REPORT==== 17-Jan-2013::10:22:07 ===
** Generic server <0.50.0> terminating 
** Last message in was {connect_and_send,
                           {request,#Ref<0.0.0.39>,<0.35.0>,0,http,
                               {"www.sina.com.cn",80},
                       ...
** Reason for termination == 
** {badarg,[{erlang,'++',[123,"\r\n"]},
            {http_request,headers_other,2},
            {http_request,http_headers,1},
            {httpc_request,send,4},
            {httpc_handler,connect_and_send_first_request,3},
            {httpc_handler,handle_call,3},
            {gen_server,handle_msg,5},
            {proc_lib,init_p_do_apply,3}]}


	It's obvious that the error headers which contained value other than string caused the httpc_handler exited. But after that, the caller hung at  the 'receive'  in httpc:handle_answer/3 forever since no message was sent to the caller. 
	It seemed like a bug to me. I think  it  would be better if the handler could send the error back to the caller no matter what kind of error it is, otherwise there would be  a memory leak.
	Hoping for your reply.
	Sincerely.




More information about the erlang-bugs mailing list