Skip to content

Commit 022c069

Browse files
committed
Fixed bug in SimplSocket regarding message length calculation
1 parent 861f84f commit 022c069

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Dache.CacheHost/Communication/SimplSockets/SimplSocket.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ private static void SetControlBytes(byte[] buffer, int threadId)
872872

873873
private static void ExtractControlBytes(byte[] buffer, int offset, out int messageLength, out int threadId)
874874
{
875-
messageLength = (buffer[offset + 3] << 24) | (buffer[offset + 2] << 16) | (buffer[offset + 1] << 8) | buffer[offset + 0] - _controlBytesPlaceholder.Length;
875+
messageLength = ((buffer[offset + 3] << 24) | (buffer[offset + 2] << 16) | (buffer[offset + 1] << 8) | buffer[offset + 0]) - _controlBytesPlaceholder.Length;
876876
threadId = (buffer[offset + 7] << 24) | (buffer[offset + 6] << 16) | (buffer[offset + 5] << 8) | buffer[offset + 4];
877877
}
878878

0 commit comments

Comments
 (0)