summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2010-08-05 10:29:32 +0100
committerSimon MacMullen <simon@rabbitmq.com>2010-08-05 10:29:32 +0100
commit17890fced8fab250c79fd49fe15522dd089a2fc5 (patch)
tree84ad50b22f3bf011c3a1b0e1d01c8dbe2bff5fe8 /src
parent19a317a25f2aaf55c0eb32f7a061688cecc7cb67 (diff)
parent8b1ea8d958d56e224a68757105b62c0999b05ce6 (diff)
downloadrabbitmq-server-git-17890fced8fab250c79fd49fe15522dd089a2fc5.tar.gz
Merge bug23060 into default.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_reader.erl17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index 532572fd00..4b612f2ad8 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -380,8 +380,14 @@ terminate(Explanation, State = #v1{connection_state = running}) ->
terminate(_Explanation, State) ->
{force, State}.
-close_connection(State = #v1{connection = #connection{
+close_connection(State = #v1{queue_collector = Collector,
+ connection = #connection{
timeout_sec = TimeoutSec}}) ->
+ %% The spec says "Exclusive queues may only be accessed by the
+ %% current connection, and are deleted when that connection
+ %% closes." This does not strictly imply synchrony, but in
+ %% practice it seems to be what people assume.
+ rabbit_queue_collector:delete_all(Collector),
%% We terminate the connection after the specified interval, but
%% no later than ?CLOSING_TIMEOUT seconds.
TimeoutMillisec =
@@ -457,18 +463,13 @@ wait_for_channel_termination(N, TimerRef) ->
end.
maybe_close(State = #v1{connection_state = closing,
- queue_collector = Collector,
connection = #connection{protocol = Protocol},
sock = Sock}) ->
case all_channels() of
[] ->
- %% Spec says "Exclusive queues may only be accessed by the current
- %% connection, and are deleted when that connection closes."
- %% This does not strictly imply synchrony, but in practice it seems
- %% to be what people assume.
- rabbit_queue_collector:delete_all(Collector),
+ NewState = close_connection(State),
ok = send_on_channel0(Sock, #'connection.close_ok'{}, Protocol),
- close_connection(State);
+ NewState;
_ -> State
end;
maybe_close(State) ->