diff options
author | Micael Karlberg <[email protected]> | 2010-04-21 13:20:38 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-04-21 13:20:38 +0000 |
commit | 91c89d54d45989a85367f10d5902b9b508754a49 (patch) | |
tree | e3f3a5183766bb4cd11875fe4cfcca811f418b79 /lib/inets | |
parent | 08225797f7ef943d0c82a1d9dd6650d94ca2580d (diff) | |
download | otp-91c89d54d45989a85367f10d5902b9b508754a49.tar.gz otp-91c89d54d45989a85367f10d5902b9b508754a49.tar.bz2 otp-91c89d54d45989a85367f10d5902b9b508754a49.zip |
OTP-8542: Merge from dev-branch.
Diffstat (limited to 'lib/inets')
-rw-r--r-- | lib/inets/doc/src/notes.xml | 45 | ||||
-rw-r--r-- | lib/inets/src/http_client/httpc_handler.erl | 10 | ||||
-rw-r--r-- | lib/inets/src/http_client/httpc_manager.erl | 18 | ||||
-rw-r--r-- | lib/inets/src/inets_app/inets.appup.src | 18 | ||||
-rw-r--r-- | lib/inets/vsn.mk | 8 |
5 files changed, 91 insertions, 8 deletions
diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml index 762c2c84c5..09a81122c2 100644 --- a/lib/inets/doc/src/notes.xml +++ b/lib/inets/doc/src/notes.xml @@ -32,6 +32,51 @@ <file>notes.xml</file> </header> + <section><title>Inets 5.3.2</title> + + <section><title>Improvements and New Features</title> + <p>-</p> + +<!-- + <list> + <item> + <p>[httpc] - Allow users to pass socket options to the transport + module when making requests. </p> + <p>See the <c>socket_opts</c> option in the + <seealso marker="httpc#request2">request/4</seealso> or + <seealso marker="httpc#set_options">set_options/1,2</seealso> + for more info, </p> + <p>Own Id: OTP-8352</p> + </item> + + </list> +--> + </section> + + <section><title>Fixed Bugs and Malfunctions</title> + +<!-- + <p>-</p> +--> + + <list> + <item> + <p>[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.</p> + <p>Own Id: OTP-8542</p> + <p>Lev Walkin</p> + </item> + + </list> + </section> + + </section> <!-- 5.3.2 --> + + <section><title>Inets 5.3.1</title> <section><title>Improvements and New Features</title> 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 = diff --git a/lib/inets/src/http_client/httpc_manager.erl b/lib/inets/src/http_client/httpc_manager.erl index f3cd81f4a7..b278077a66 100644 --- a/lib/inets/src/http_client/httpc_manager.erl +++ b/lib/inets/src/http_client/httpc_manager.erl @@ -30,6 +30,7 @@ request/2, cancel_request/2, request_canceled/2, + request_done/2, retry_request/2, redirect_request/2, insert_session/2, @@ -171,6 +172,18 @@ request_canceled(RequestId, ProfileName) -> %%-------------------------------------------------------------------- +%% Function: request_done(RequestId, ProfileName) -> ok +%% RequestId - ref() +%% ProfileName = atom() +%% +%% Description: Inform tha manager that a request has been completed. +%%-------------------------------------------------------------------- + +request_done(RequestId, ProfileName) -> + cast(ProfileName, {request_done, RequestId}). + + +%%-------------------------------------------------------------------- %% Function: insert_session(Session, ProfileName) -> _ %% Session - #tcp_session{} %% ProfileName - atom() @@ -486,6 +499,11 @@ handle_cast({request_canceled, RequestId}, State) -> {noreply, State} end; +handle_cast({request_done, RequestId}, State) -> + ?hcrv("request done", [{request_id, RequestId}]), + ets:delete(State#state.handler_db, RequestId), + {noreply, State}; + handle_cast({set_options, Options}, State = #state{options = OldOptions}) -> ?hcrv("set options", [{options, Options}, {old_options, OldOptions}]), NewOptions = diff --git a/lib/inets/src/inets_app/inets.appup.src b/lib/inets/src/inets_app/inets.appup.src index ba1dc8ccdb..7e2306d0c6 100644 --- a/lib/inets/src/inets_app/inets.appup.src +++ b/lib/inets/src/inets_app/inets.appup.src @@ -18,9 +18,16 @@ {"%VSN%", [ + {"5.3.1", + [ + {update, httpc_handler, soft, soft_purge, soft_purge, [httpc_manager]}, + {update, httpc_manager, soft, soft_purge, soft_purge, []} + ] + }, {"5.3", [ - {update, httpc_handler, soft, soft_purge, soft_purge, [mod_esi]}, + {update, httpc_handler, soft, soft_purge, soft_purge, [httpc_manager]}, + {update, httpc_manager, soft, soft_purge, soft_purge, []}, {load_module, mod_esi, soft_purge, soft_purge, []} ] }, @@ -41,9 +48,16 @@ } ], [ + {"5.3.1", + [ + {update, httpc_handler, soft, soft_purge, soft_purge, [httpc_manager]}, + {update, httpc_manager, soft, soft_purge, soft_purge, []} + ] + }, {"5.3", [ - {update, httpc_handler, soft, soft_purge, soft_purge, [mod_esi]}, + {update, httpc_handler, soft, soft_purge, soft_purge, [httpc_manager]}, + {update, httpc_manager, soft, soft_purge, soft_purge, []}, {load_module, mod_esi, soft_purge, soft_purge, []} ] }, diff --git a/lib/inets/vsn.mk b/lib/inets/vsn.mk index 401bf4d37d..ba808a2415 100644 --- a/lib/inets/vsn.mk +++ b/lib/inets/vsn.mk @@ -18,11 +18,15 @@ # %CopyrightEnd% APPLICATION = inets -INETS_VSN = 5.3.1 +INETS_VSN = 5.3.2 PRE_VSN = APP_VSN = "$(APPLICATION)-$(INETS_VSN)$(PRE_VSN)" -TICKETS = OTP-8508 OTP-8509 +TICKETS = OTP-8542 + +TICKETS_5_3_1 = \ + OTP-8508 \ + OTP-8509 TICKETS_5_3 = \ OTP-8016 \ |