From 860dd9e5f5f009db0c249ebd3deeb219bec394d9 Mon Sep 17 00:00:00 2001 From: Kirilll Zaborsky Date: Wed, 1 Jul 2015 15:29:12 +0300 Subject: inets: cancel for handler with no requests httpc_handler should react properly to cancel requests even when the request to be cancelled was already finished but httpc_manager did not get notified about that yet --- lib/inets/src/http_client/httpc_handler.erl | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/inets') diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl index 3f979de078..205348524a 100644 --- a/lib/inets/src/http_client/httpc_handler.erl +++ b/lib/inets/src/http_client/httpc_handler.erl @@ -421,6 +421,16 @@ handle_cast({cancel, RequestId}, {profile, ProfileName}, {canceled, Canceled}]), {noreply, State#state{canceled = [RequestId | Canceled]}}; +handle_cast({cancel, RequestId}, + #state{profile_name = ProfileName, + request = undefined, + canceled = Canceled} = State) -> + ?hcrv("cancel", [{request_id, RequestId}, + {curr_req_id, undefined}, + {profile, ProfileName}, + {canceled, Canceled}]), + {noreply, State}; + handle_cast(stream_next, #state{session = Session} = State) -> activate_once(Session), -- cgit v1.2.3