From 70e78721a0d97fce21fb37ddefc56d13f60cb987 Mon Sep 17 00:00:00 2001 From: Simon MacMullen Date: Fri, 12 Oct 2012 13:41:04 +0100 Subject: [PATCH] There's no point in closing the channel before we close the connection. --- .../rabbitmq_federation/src/rabbit_federation_link.erl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/deps/rabbitmq_federation/src/rabbit_federation_link.erl b/deps/rabbitmq_federation/src/rabbit_federation_link.erl index a275fa6179..ea7996beac 100644 --- a/deps/rabbitmq_federation/src/rabbit_federation_link.erl +++ b/deps/rabbitmq_federation/src/rabbit_federation_link.erl @@ -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) ->