Skip to content

Commit 0dcd73a

Browse files
committed
s/EmptyContentBodyFrameSize/EmptyFrameSize
more accurate and matching the naming in the server
1 parent 0780ef3 commit 0dcd73a

File tree

1 file changed

+9
-9
lines changed
  • projects/client/RabbitMQ.Client/src/client/impl

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,28 @@ namespace RabbitMQ.Client.Impl {
5656
public class Command {
5757
private static readonly byte[] m_emptyByteArray = new byte[0];
5858

59-
// EmptyContentBodyFrameSize, 8 = 1 + 2 + 4 + 1
59+
// EmptyFrameSize, 8 = 1 + 2 + 4 + 1
6060
// - 1 byte of frame type
6161
// - 2 bytes of channel number
6262
// - 4 bytes of frame payload length
6363
// - 1 byte of payload trailer FrameEnd byte
64-
public const int EmptyContentBodyFrameSize = 8;
64+
public const int EmptyFrameSize = 8;
6565

6666
static Command() {
67-
CheckEmptyContentBodyFrameSize();
67+
CheckEmptyFrameSize();
6868
}
6969

70-
public static void CheckEmptyContentBodyFrameSize() {
70+
public static void CheckEmptyFrameSize() {
7171
Frame f = new Frame(CommonFraming.Constants.FrameBody, 0, m_emptyByteArray);
7272
MemoryStream stream = new MemoryStream();
7373
NetworkBinaryWriter writer = new NetworkBinaryWriter(stream);
7474
f.WriteTo(writer);
7575
long actualLength = stream.Length;
7676

77-
if (EmptyContentBodyFrameSize != actualLength) {
78-
string message =
79-
string.Format("EmptyContentBodyFrameSize is incorrect - defined as {0} where the computed value is in fact {1}.",
80-
EmptyContentBodyFrameSize,
77+
if (EmptyFrameSize != actualLength) {
78+
string message =
79+
string.Format("EmptyFrameSize is incorrect - defined as {0} where the computed value is in fact {1}.",
80+
EmptyFrameSize,
8181
actualLength);
8282
throw new ProtocolViolationException(message);
8383
}
@@ -159,7 +159,7 @@ public void Transmit(int channelNumber, ConnectionBase connection) {
159159
int frameMax = (int) Math.Min(int.MaxValue, connection.FrameMax);
160160
int bodyPayloadMax = (frameMax == 0)
161161
? body.Length
162-
: frameMax - EmptyContentBodyFrameSize;
162+
: frameMax - EmptyFrameSize;
163163
for (int offset = 0; offset < body.Length; offset += bodyPayloadMax) {
164164
int remaining = body.Length - offset;
165165

0 commit comments

Comments
 (0)