@@ -62,33 +62,18 @@ namespace RabbitMQ.Client.Impl
62
62
{
63
63
public abstract class ContentHeaderBase : IContentHeader
64
64
{
65
- public static uint MaximumPermittedReceivableBodySize = 32 * 1048576 ; // FIXME: configurable
66
-
67
65
public abstract int ProtocolClassId { get ; }
68
66
public abstract string ProtocolClassName { get ; }
69
67
public abstract void ReadPropertiesFrom ( ContentHeaderPropertyReader reader ) ;
70
68
public abstract void WritePropertiesTo ( ContentHeaderPropertyWriter writer ) ;
71
69
public abstract void AppendPropertyDebugStringTo ( System . Text . StringBuilder sb ) ;
72
70
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 )
85
74
{
86
75
reader . ReadUInt16 ( ) ; // weight - not currently used
87
76
ulong bodySize = reader . ReadUInt64 ( ) ;
88
- if ( bodySize > MaximumPermittedReceivableBodySize )
89
- {
90
- throw new BodyTooLongException ( channelNumber , bodySize ) ;
91
- }
92
77
ReadPropertiesFrom ( new ContentHeaderPropertyReader ( reader ) ) ;
93
78
return bodySize ;
94
79
}
0 commit comments