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 | fc839abbcdb4e6b0f3f95a31df2deca51be447f7 (patch) | |
| tree | c64c8cb4b3933f1bce206ab3b03572c94fa23497 | |
| parent | c984186f18facb467d28f49dfdf7b3afc17090b1 (diff) | |
| download | rabbitmq-server-git-fc839abbcdb4e6b0f3f95a31df2deca51be447f7.tar.gz | |
simplified Channel.Close code
| -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 282fd12d46..bb880dad94 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; |
