Skip to content

Commit f39fa5d

Browse files
author
Emile Joubert
committed
Scrap restriction on incoming message body size
1 parent 8dd50c4 commit f39fa5d

File tree

3 files changed

+4
-104
lines changed

3 files changed

+4
-104
lines changed

projects/client/RabbitMQ.Client/src/client/impl/BodyTooLongException.cs

Lines changed: 0 additions & 85 deletions
This file was deleted.

projects/client/RabbitMQ.Client/src/client/impl/CommandAssembler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public Command HandleFrame(Frame f)
142142
}
143143
NetworkBinaryReader reader = f.GetReader();
144144
m_command.m_header = m_protocol.DecodeContentHeaderFrom(reader);
145-
m_remainingBodyBytes = m_command.m_header.ReadFrom(f.Channel, reader);
145+
m_remainingBodyBytes = m_command.m_header.ReadFrom(reader);
146146
UpdateContentBodyState();
147147
return CompletedCommand();
148148
}

projects/client/RabbitMQ.Client/src/client/impl/ContentHeaderBase.cs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,33 +62,18 @@ namespace RabbitMQ.Client.Impl
6262
{
6363
public abstract class ContentHeaderBase : IContentHeader
6464
{
65-
public static uint MaximumPermittedReceivableBodySize = 32 * 1048576; // FIXME: configurable
66-
6765
public abstract int ProtocolClassId { get; }
6866
public abstract string ProtocolClassName { get; }
6967
public abstract void ReadPropertiesFrom(ContentHeaderPropertyReader reader);
7068
public abstract void WritePropertiesTo(ContentHeaderPropertyWriter writer);
7169
public abstract void AppendPropertyDebugStringTo(System.Text.StringBuilder sb);
7270

73-
///<summary>Fill this instance from the given byte buffer
74-
///stream. Throws BodyTooLongException, which is the reason
75-
///for the channelNumber parameter.</summary>
76-
///<remarks>
77-
///<para>
78-
/// It might be better to do the body length check in our
79-
/// caller, currently CommandAssembler, which would avoid
80-
/// passing in the otherwise unrequired channelNumber
81-
/// parameter.
82-
///</para>
83-
///</remarks>
84-
public ulong ReadFrom(int channelNumber, NetworkBinaryReader reader)
71+
///<summary>Fill this instance from the given byte buffer stream.
72+
///</summary>
73+
public ulong ReadFrom(NetworkBinaryReader reader)
8574
{
8675
reader.ReadUInt16(); // weight - not currently used
8776
ulong bodySize = reader.ReadUInt64();
88-
if (bodySize > MaximumPermittedReceivableBodySize)
89-
{
90-
throw new BodyTooLongException(channelNumber, bodySize);
91-
}
9277
ReadPropertiesFrom(new ContentHeaderPropertyReader(reader));
9378
return bodySize;
9479
}

0 commit comments

Comments
 (0)