diff options
author | Kirilll Zaborsky <[email protected]> | 2015-07-01 15:29:12 +0300 |
---|---|---|
committer | Zandra Hird <[email protected]> | 2015-07-16 10:32:38 +0200 |
commit | 860dd9e5f5f009db0c249ebd3deeb219bec394d9 (patch) | |
tree | 2078f0e7e0ffc501d6aa84551449d8313df37b3e /lib | |
parent | 745563e98f6993e279703dc1ad1e9a2c38dfac28 (diff) | |
download | otp-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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/inets/src/http_client/httpc_handler.erl | 10 |
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), |