diff options
| author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-06-15 14:28:38 +0100 |
|---|---|---|
| committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-06-15 14:28:38 +0100 |
| commit | c984186f18facb467d28f49dfdf7b3afc17090b1 (patch) | |
| tree | 50501c7ef665810aff6088ab8b48eb0061c791c0 | |
| parent | 916e35763a4c5e0149bdb1987c220b2f3201c7ce (diff) | |
| download | rabbitmq-server-git-c984186f18facb467d28f49dfdf7b3afc17090b1.tar.gz | |
server implements 0.9.1 channel shutdown protocol
| -rw-r--r-- | src/rabbit_reader.erl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index 8e7cd39f8a..282fd12d46 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), + put({channel, Channel}, {closing, get({channel, Channel})}), State. handle_channel_exit(Channel, Reason, State) -> @@ -483,13 +483,18 @@ handle_frame(Type, Channel, Payload, State) -> end, ok = rabbit_framing_channel:process(ChPid, AnalyzedFrame), State; - closing -> + {closing, {chpid, ChPid}} -> %% According to the spec, after sending a %% channel.close we must ignore all frames except + %% channel.close and channel.close_ok. In the + %% event of a channel.close, we should send back a %% channel.close_ok. case AnalyzedFrame of {method, 'channel.close_ok', _} -> erase({channel, Channel}); + {method, 'channel.close', _} -> + erase({channel, Channel}), + ok = rabbit_framing_channel:process(ChPid, AnalyzedFrame); _ -> ok end, State; |
