@@ -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