Skip to content

Commit 31c35f3

Browse files
author
Stefán J. Sigurðarson
committed
Fixing bugs.
1 parent 40a42b6 commit 31c35f3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

projects/client/RabbitMQ.Client/src/client/content/StreamWireFormatting.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ public static object ReadObject(NetworkBinaryReader reader)
200200
{
201201
throw new EndOfStreamException("End of StreamMessage reached");
202202
}
203+
203204
switch ((StreamWireFormattingTag)typeTag)
204205
{
205206
case StreamWireFormattingTag.Bool:
@@ -439,7 +440,7 @@ public static void WriteUntypedString(NetworkBinaryWriter writer, string value)
439440
try
440441
{
441442
int bytesUsed = Encoding.UTF8.GetBytes(value, 0, value.Length, bytes, 0);
442-
bytes[bytesUsed + 1] = 0;
443+
bytes[bytesUsed] = 0;
443444
writer.Write(bytes, 0, bytesUsed + 1);
444445
}
445446
finally

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public static void WriteLongstr(NetworkBinaryWriter writer, byte[] val)
366366

367367
public static void WriteLongstr(NetworkBinaryWriter writer, byte[] val, int index, int count)
368368
{
369-
WriteLong(writer, (uint)val.Length);
369+
WriteLong(writer, (uint)count);
370370
writer.Write(val, index, count);
371371
}
372372

0 commit comments

Comments
 (0)