THRIFT-2704 - compiler: T_ONEWAY type used for oneway methods instead of T_CALL
Patch: Konrad Grochowski
This closes #216
diff --git a/lib/hs/src/Thrift/Protocol/Compact.hs b/lib/hs/src/Thrift/Protocol/Compact.hs
index c3bd22d..a329f4e 100644
--- a/lib/hs/src/Thrift/Protocol/Compact.hs
+++ b/lib/hs/src/Thrift/Protocol/Compact.hs
@@ -60,6 +60,7 @@
version = 0x01
versionMask = 0x1f -- 0001 1111
typeMask = 0xe0 -- 1110 0000
+typeBits = 0x07 -- 0000 0111
typeShiftAmount :: Int
typeShiftAmount = 5
@@ -81,7 +82,7 @@
w <- fromIntegral <$> P.anyWord8
let ver = w .&. versionMask
when (ver /= version) $ error "Bad Protocol version"
- let typ = (w `shiftR` typeShiftAmount) .&. 0x03
+ let typ = (w `shiftR` typeShiftAmount) .&. typeBits
seqId <- parseVarint zigZagToI32
TString name <- parseCompactValue T_STRING
return (decodeUtf8 name, toEnum $ fromIntegral $ typ, seqId)