Remove extra span (#922)
This commit is contained in:
parent
f71e31a1cd
commit
bcda95353e
|
|
@ -26,21 +26,18 @@ namespace Microsoft.AspNetCore.SignalR.Internal.Formatters
|
||||||
throw new FormatException("Messages over 2GB in size are not supported");
|
throw new FormatException("Messages over 2GB in size are not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip over the length
|
|
||||||
var remaining = buffer.Slice(sizeof(long));
|
|
||||||
|
|
||||||
// We don't have enough data
|
// We don't have enough data
|
||||||
while (remaining.Length < (int)length)
|
if (buffer.Length < (int)length + sizeof(long))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the payload
|
// Get the payload
|
||||||
payload = remaining.Slice(0, (int)length);
|
payload = buffer.Slice(sizeof(long), (int)length);
|
||||||
|
|
||||||
// Skip the payload
|
// Skip the payload
|
||||||
buffer = remaining.Slice((int)length);
|
buffer = buffer.Slice((int)length + sizeof(long));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue