Skip to content

Commit

Permalink
Merge pull request #232 from gdamjan/fix-manager
Browse files Browse the repository at this point in the history
Fix 2 manager bugs
  • Loading branch information
benoitc committed Aug 22, 2015
2 parents 1b9ffdb + e594b88 commit 899476c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/hackney_client/hackney_manager.erl
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ handle_call({stop_async_response, Ref, To}, _From, State) ->
[] -> {reply, {ok, Ref}, State};
[{Ref, {_Owner, nil, _Info}}] ->
%% there is no async request to handle, just return
{ok, Ref};
{reply, {ok, Ref}, State};
[{Ref, {Owner, Stream, Info}}] ->
%% tell to the stream to stop
Stream ! {Ref, stop_async, self()},
Expand All @@ -370,9 +370,7 @@ handle_call({stop_async_response, Ref, To}, _From, State) ->
dict:erase(Owner, Pids1))
end,

{reply, {ok, Ref}, State#mstate{pids=Pids2}};
Error ->
{reply, Error, State}
{reply, {ok, Ref}, State#mstate{pids=Pids2}}
after 5000 ->
{reply, {error, timeout}, State}
end
Expand Down

0 comments on commit 899476c

Please sign in to comment.