diff options
author | Joe Crayne <joe@jerkface.net> | 2019-07-02 03:58:27 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-07-02 03:58:27 -0400 |
commit | 75aeff50b20f0bf08cfcda371c6323b73fe73a23 (patch) | |
tree | 3d3972fd4a91ede3c9c4bb42242e1576a9834800 /lib/KeyRing | |
parent | e69f4750ceb30ba6e1953ce746d00ad4bc89145f (diff) |
Decode packets individually.
Diffstat (limited to 'lib/KeyRing')
-rw-r--r-- | lib/KeyRing/BuildKeyDB.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/KeyRing/BuildKeyDB.hs b/lib/KeyRing/BuildKeyDB.hs index bae2538..ad47ed0 100644 --- a/lib/KeyRing/BuildKeyDB.hs +++ b/lib/KeyRing/BuildKeyDB.hs | |||
@@ -40,6 +40,7 @@ import qualified Data.ByteString.Lazy as L (ByteString, concat, empty, | |||
40 | fromChunks, hGetContents, | 40 | fromChunks, hGetContents, |
41 | null, readFile, toChunks) | 41 | null, readFile, toChunks) |
42 | import Data.Char | 42 | import Data.Char |
43 | import Data.Function | ||
43 | import Data.List | 44 | import Data.List |
44 | import qualified Data.Map as Map | 45 | import qualified Data.Map as Map |
45 | import Data.Maybe | 46 | import Data.Maybe |
@@ -302,13 +303,13 @@ readPacketsFromFile ctx fname = do | |||
302 | -- warn $ fname ++ ": reading..." | 303 | -- warn $ fname ++ ": reading..." |
303 | input <- readInputFileL ctx fname | 304 | input <- readInputFileL ctx fname |
304 | #if MIN_VERSION_binary(0,7,0) | 305 | #if MIN_VERSION_binary(0,7,0) |
305 | return $ | 306 | return $ Message $ flip fix input $ \again some -> |
306 | case decodeOrFail input of | 307 | case decodeOrFail some of |
307 | Right (_,_,msg ) -> msg | 308 | Right (more,_,msg ) -> msg : again more |
308 | Left (_,_,_) -> | 309 | Left (_,_,_) -> |
309 | -- FIXME | 310 | -- FIXME |
310 | -- trace (fname++": read fail") $ | 311 | -- trace (fname++": read fail") $ |
311 | Message [] | 312 | [] |
312 | #else | 313 | #else |
313 | return $ decode input | 314 | return $ decode input |
314 | #endif | 315 | #endif |