diff options
author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-06-16 13:28:39 +0100 |
---|---|---|
committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-06-16 13:28:39 +0100 |
commit | 4626253f57570a8d8fd6adc569b4794d89c6c800 (patch) | |
tree | c64c8cb4b3933f1bce206ab3b03572c94fa23497 | |
parent | d1e0cee435ef648514626187c99929278357b2e2 (diff) | |
download | rabbitmq-server-bug21848.tar.gz |
simplified Channel.Close codebug21848
-rw-r--r-- | src/rabbit_reader.erl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index 282fd12d..bb880dad 100644 --- a/src/rabbit_reader.erl +++ b/src/rabbit_reader.erl @@ -371,7 +371,7 @@ close_connection(State = #v1{connection = #connection{ State#v1{connection_state = closed}. close_channel(Channel, State) -> - put({channel, Channel}, {closing, get({channel, Channel})}), + put({channel, Channel}, closing), State. handle_channel_exit(Channel, Reason, State) -> @@ -483,7 +483,7 @@ handle_frame(Type, Channel, Payload, State) -> end, ok = rabbit_framing_channel:process(ChPid, AnalyzedFrame), State; - {closing, {chpid, ChPid}} -> + closing -> %% According to the spec, after sending a %% channel.close we must ignore all frames except %% channel.close and channel.close_ok. In the @@ -493,8 +493,11 @@ handle_frame(Type, Channel, Payload, State) -> {method, 'channel.close_ok', _} -> erase({channel, Channel}); {method, 'channel.close', _} -> - erase({channel, Channel}), - ok = rabbit_framing_channel:process(ChPid, AnalyzedFrame); + %% We're already closing this channel, so + %% there's no cleanup to do (notify + %% queues, etc.) + ok = rabbit_writer:send_command(State#v1.sock, + #'channel.close_ok'{}); _ -> ok end, State; |