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

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


	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,
** Reason for termination == 
** {badarg,[{erlang,'++',[123,"\r\n"]},

	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.

More information about the erlang-bugs mailing list