Use zlibFormat
authorunc0rr
Thu, 23 Jan 2014 13:24:28 +0400
changeset 10060 bcf2e1ca2971
parent 10059 015ed10e7e66
child 10061 b7161f00a6ca
Use zlibFormat
gameServer/EngineInteraction.hs
--- a/gameServer/EngineInteraction.hs	Wed Jan 22 23:52:21 2014 +0100
+++ b/gameServer/EngineInteraction.hs	Thu Jan 23 13:24:28 2014 +0400
@@ -14,7 +14,6 @@
 import Data.Bits
 import Control.Arrow
 import Data.Maybe
-import Codec.Compression.Zlib as Z
 -------------
 import CoreTypes
 import Utils
@@ -25,11 +24,11 @@
 -}
 import qualified Codec.Compression.Zlib.Internal as Z
 
-decompressWithoutExceptions :: BL.ByteString -> Either Z.DecompressError BL.ByteString
+decompressWithoutExceptions :: BL.ByteString -> Either String BL.ByteString
 decompressWithoutExceptions = finalise
                             . Z.foldDecompressStream cons nil err
-                            . Z.decompressWithErrors Z.gzipFormat Z.defaultDecompressParams
-  where err errorCode _ = Left errorCode
+                            . Z.decompressWithErrors Z.zlibFormat Z.defaultDecompressParams
+  where err errorCode msg = Left msg
         nil = Right []
         cons chunk = right (chunk :)
         finalise = right BL.fromChunks