You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a result, the compressed flag can never be set. In addition, if the variable is set to YES, the value will interfere with the frameType section of the header.
This can easily be fixed, the line could simply be changed to:
Byte compressed = (self.compressed?1:0) << 3; // next 1 bit
The text was updated successfully, but these errors were encountered:
There is a very subtle bug in the
data
function for SDLV1ProtocolHeader and SDLV2ProtocolHeader:Because there are no parentheses around
self.compressed?1:0
, the bit shift is not evaluated on the result, but the0
.An equivalent
if
statement to this conditional would be:Rather than the intended behavior:
As a result, the compressed flag can never be set. In addition, if the variable is set to YES, the value will interfere with the
frameType
section of the header.This can easily be fixed, the line could simply be changed to:
The text was updated successfully, but these errors were encountered: