Skip to content

Commit 8d9c236

Browse files
Resolve conflicts #16076 #16079 #16081
1 parent 55378d0 commit 8d9c236

File tree

1 file changed

+9
-32
lines changed

1 file changed

+9
-32
lines changed

deps/rabbit_common/src/rabbit_command_assembler.erl

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,9 @@
3333
{'content_body', binary()}.
3434

3535
-type state() ::
36-
<<<<<<< HEAD
3736
{'method', protocol()} |
3837
{'content_header', method(), class_id(), protocol()} |
39-
{'content_body', method(), body_size(), class_id(), protocol()}.
40-
=======
41-
'method' |
42-
{'content_header', method(), class_id()} |
43-
{'content_body', method(), body_size(), content()}.
44-
>>>>>>> f0155e674a (AMQP 0-9-1: refactor body size handling in command assembly)
38+
{'content_body', method(), body_size(), content(), protocol()}.
4539

4640
-spec analyze_frame(frame_type(), binary(), protocol()) ->
4741
frame() | 'heartbeat' | 'error'.
@@ -91,23 +85,17 @@ process({content_header, ClassId, 0, 0, PropertiesBin},
9185
Content = empty_content(ClassId, PropertiesBin, Protocol),
9286
{ok, Method, Content, {method, Protocol}};
9387
process({content_header, ClassId, 0, BodySize, PropertiesBin},
94-
<<<<<<< HEAD
95-
{content_header, Method, ClassId, Protocol}) ->
88+
{content_header, Method, ClassId, Protocol})
89+
when BodySize =< ?MAX_MSG_SIZE ->
9690
Content = empty_content(ClassId, PropertiesBin, Protocol),
9791
{ok, {content_body, Method, BodySize, Content, Protocol}};
98-
=======
99-
{content_header, Method, ClassId})
100-
when BodySize =< ?MAX_MSG_SIZE ->
101-
Content = empty_content(ClassId, PropertiesBin),
102-
{ok, {content_body, Method, BodySize, Content}};
10392
process({content_header, ClassId, 0, BodySize, _PropertiesBin},
104-
{content_header, Method, ClassId}) when BodySize > ?MAX_MSG_SIZE ->
93+
{content_header, Method, ClassId, _Protocol}) when BodySize > ?MAX_MSG_SIZE ->
10594
{error, rabbit_misc:amqp_error(
10695
frame_error,
10796
"content body size ~B exceeds maximum allowed size ~B",
10897
[BodySize, ?MAX_MSG_SIZE],
10998
rabbit_misc:method_record_type(Method))};
110-
>>>>>>> f0155e674a (AMQP 0-9-1: refactor body size handling in command assembly)
11199
process({content_header, HeaderClassId, 0, _BodySize, _PropertiesBin},
112100
{content_header, Method, ClassId, _Protocol}) ->
113101
unexpected_frame("expected content header for class ~w, "
@@ -118,33 +106,22 @@ process(_Frame, {content_header, Method, ClassId, _Protocol}) ->
118106
"got non content header frame instead", [ClassId], Method);
119107
process({content_body, FragmentBin},
120108
{content_body, Method, RemainingSize,
121-
<<<<<<< HEAD
122-
Content = #content{payload_fragments_rev = Fragments}, Protocol}) ->
123-
NewContent = Content#content{
124-
payload_fragments_rev = [FragmentBin | Fragments]},
125-
case RemainingSize - size(FragmentBin) of
126-
0 -> {ok, Method, NewContent, {method, Protocol}};
127-
Sz -> {ok, {content_body, Method, Sz, NewContent, Protocol}}
128-
end;
129-
process(_Frame, {content_body, Method, _RemainingSize, _Content, _Protocol}) ->
130-
=======
131-
Content = #content{payload_fragments_rev = Fragments}})
109+
Content = #content{payload_fragments_rev = Fragments}, Protocol})
132110
when byte_size(FragmentBin) =< RemainingSize ->
133111
NewContent = Content#content{
134112
payload_fragments_rev = [FragmentBin | Fragments]},
135113
case RemainingSize - byte_size(FragmentBin) of
136-
0 -> {ok, Method, NewContent, method};
137-
Sz -> {ok, {content_body, Method, Sz, NewContent}}
114+
0 -> {ok, Method, NewContent, {method, Protocol}};
115+
Sz -> {ok, {content_body, Method, Sz, NewContent, Protocol}}
138116
end;
139117
process({content_body, _FragmentBin},
140-
{content_body, Method, _RemainingSize, _Content}) ->
118+
{content_body, Method, _RemainingSize, _Content, _Protocol}) ->
141119
{error, rabbit_misc:amqp_error(
142120
frame_error,
143121
"content body frame exceeds remaining content size",
144122
[],
145123
rabbit_misc:method_record_type(Method))};
146-
process(_Frame, {content_body, Method, _RemainingSize, _Content}) ->
147-
>>>>>>> f0155e674a (AMQP 0-9-1: refactor body size handling in command assembly)
124+
process(_Frame, {content_body, Method, _RemainingSize, _Content, _Protocol}) ->
148125
unexpected_frame("expected content body, "
149126
"got non content body frame instead", [], Method).
150127

0 commit comments

Comments
 (0)