diff options
author | Zandra Hird <[email protected]> | 2015-07-30 10:14:54 +0200 |
---|---|---|
committer | Zandra Hird <[email protected]> | 2015-07-30 10:14:54 +0200 |
commit | 98647fcc1632f60871adee20031e294e5d5b6eb0 (patch) | |
tree | 2078f0e7e0ffc501d6aa84551449d8313df37b3e /lib/inets | |
parent | 745563e98f6993e279703dc1ad1e9a2c38dfac28 (diff) | |
parent | 860dd9e5f5f009db0c249ebd3deeb219bec394d9 (diff) | |
download | otp-98647fcc1632f60871adee20031e294e5d5b6eb0.tar.gz otp-98647fcc1632f60871adee20031e294e5d5b6eb0.tar.bz2 otp-98647fcc1632f60871adee20031e294e5d5b6eb0.zip |
Merge branch 'scrapinghub/cancel_httpc_handler_with_no_requests' into maint
OTP-12922
* scrapinghub/cancel_httpc_handler_with_no_requests:
inets: cancel for handler with no requests
Diffstat (limited to 'lib/inets')
-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), |