There's no point in closing the channel before we close the connection.

This commit is contained in:
Simon MacMullen 2012-10-12 13:41:04 +01:00
parent 68f6f5a726
commit 70e78721a0
1 changed files with 3 additions and 7 deletions

View File

@ -183,7 +183,7 @@ terminate(_Reason, {not_started, _}) ->
terminate(Reason, State = #state{downstream_channel = DCh,
downstream_connection = DConn,
connection = Conn}) ->
ensure_closed(DConn, DCh),
ensure_connection_closed(DConn),
ensure_connection_closed(Conn),
log_terminate(Reason, State),
ok.
@ -382,12 +382,12 @@ go(S0 = {not_started, {Upstream, DownXName =
catch exit:E ->
%% terminate/2 will not get this, as we
%% have not put them in our state yet
ensure_closed(DConn, DCh),
ensure_connection_closed(DConn),
ensure_connection_closed(Conn),
connection_error(remote, E, S0)
end;
E ->
ensure_closed(DConn, DCh),
ensure_connection_closed(DConn),
connection_error(remote, E, S0)
end;
E ->
@ -566,10 +566,6 @@ disposable_connection_call(Params, Method, ErrFun) ->
E
end.
ensure_closed(Conn, Ch) ->
ensure_channel_closed(Ch),
ensure_connection_closed(Conn).
ensure_channel_closed(Ch) -> catch amqp_channel:close(Ch).
ensure_connection_closed(Conn) ->