Skip to content

Commit

Permalink
Support channel.close in the middle of a publish
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhoerberg committed May 10, 2024
1 parent 078f4b3 commit 3d8f76b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions deps/rabbit_common/src/rabbit_command_assembler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ process({method, MethodName, FieldsBin}, {method, Protocol}) ->
end
catch exit:#amqp_error{} = Reason -> {error, Reason}
end;
process({method, MethodName = 'channel.close', FieldsBin}, State = {content_header, _Method, _ClassId, Protocol}) ->
try
Method = Protocol:decode_method_fields(MethodName, FieldsBin),
{ok, Method, State}
catch exit:#amqp_error{} = Reason -> {error, Reason}
end;
process({method, MethodName = 'channel.close', FieldsBin}, State = {content_body, _Method, _RemainingSize, _Content, Protocol}) ->
try
Method = Protocol:decode_method_fields(MethodName, FieldsBin),
{ok, Method, State}
catch exit:#amqp_error{} = Reason -> {error, Reason}
end;
process(_Frame, {method, _Protocol}) ->
unexpected_frame("expected method frame, "
"got non method frame instead", [], none);
Expand Down

0 comments on commit 3d8f76b

Please sign in to comment.