import Thrift.Transport
import Control.Monad (liftM)
+import Data.Int (Int32)
import Data.Monoid (mappend, mempty)
import Control.Concurrent.MVar
import qualified Data.Binary as B
tFlush trans = do
bs <- flushBuf (writeBuffer trans)
- let szBs = B.encode $ LBS.length bs
+ let szBs = B.encode $ (fromIntegral $ LBS.length bs :: Int32)
tWrite (wrappedTrans trans) szBs
tWrite (wrappedTrans trans) bs
tFlush (wrappedTrans trans)
readFrame trans = do
-- Read and decode the frame size.
szBs <- tRead (wrappedTrans trans) 4
- let sz = B.decode szBs
+ let sz = fromIntegral (B.decode szBs :: Int32)
-- Read the frame and stuff it into the read buffer.
bs <- tRead (wrappedTrans trans) sz