aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirilll Zaborsky <[email protected]>2015-07-01 15:29:12 +0300
committerZandra Hird <[email protected]>2015-07-16 10:32:38 +0200
commit860dd9e5f5f009db0c249ebd3deeb219bec394d9 (patch)
tree2078f0e7e0ffc501d6aa84551449d8313df37b3e
parent745563e98f6993e279703dc1ad1e9a2c38dfac28 (diff)
downloadotp-860dd9e5f5f009db0c249ebd3deeb219bec394d9.tar.gz
otp-860dd9e5f5f009db0c249ebd3deeb219bec394d9.tar.bz2
otp-860dd9e5f5f009db0c249ebd3deeb219bec394d9.zip
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
-rw-r--r--lib/inets/src/http_client/httpc_handler.erl10
1 files changed, 10 insertions, 0 deletions
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),