From 6c8fb0bf44f74e9fc82f64949aba0bae8309fc88 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Fri, 30 Apr 2010 12:00:00 +0200 Subject: inets: Patch 1115 OTP-8542 [httpc] Memory leak plugged. The profile manager never cleaned up in its handler database. This meant that with each new request handler, another entry was created that was never deleted. Eventually the request id counter (used as a key) would wrap, but the machine would most likely run out of memory before that happened. OTP-8607 [httpc] https requests with default port not handled properly. Jebu Ittiachen. --- lib/inets/src/http_client/httpc_handler.erl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/inets/src/http_client/httpc_handler.erl') diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl index 695ff9cf82..5e79d874fb 100644 --- a/lib/inets/src/http_client/httpc_handler.erl +++ b/lib/inets/src/http_client/httpc_handler.erl @@ -1424,14 +1424,16 @@ try_to_enable_pipeline_or_keep_alive( State#state{status = close} end. -answer_request(Request, Msg, #state{timers = Timers} = State) -> +answer_request(#request{id = RequestId, from = From} = Request, Msg, + #state{timers = Timers, profile_name = ProfileName} = State) -> ?hcrt("answer request", [{request, Request}]), - httpc_response:send(Request#request.from, Msg), + httpc_response:send(From, Msg), RequestTimers = Timers#timers.request_timers, TimerRef = - proplists:get_value(Request#request.id, RequestTimers, undefined), - Timer = {Request#request.id, TimerRef}, + proplists:get_value(RequestId, RequestTimers, undefined), + Timer = {RequestId, TimerRef}, cancel_timer(TimerRef, {timeout, Request#request.id}), + httpc_manager:request_done(RequestId, ProfileName), State#state{request = Request#request{from = answer_sent}, timers = Timers#timers{request_timers = -- cgit v1.2.3