load 3 lines before parsing

This commit is contained in:
Evgeny Poberezkin
2020-10-17 17:29:23 +01:00
parent 3255682bf2
commit 98a85ddf5d
2 changed files with 13 additions and 15 deletions
+1 -2
View File
@@ -5,7 +5,6 @@ module SMPClient where
import Control.Monad.IO.Unlift
import Crypto.Random
import Data.Maybe
import Network.Socket
import Numeric.Natural
import Server
@@ -44,4 +43,4 @@ smpServerTest :: [RawTransmission] -> IO [RawTransmission]
smpServerTest commands = runSmpTest \h -> mapM (sendReceive h) commands
where
sendReceive :: Handle -> RawTransmission -> IO RawTransmission
sendReceive h t = tPutRaw h t >> fromJust <$> tGetRaw h
sendReceive h t = tPutRaw h t >> either (error "bad transmission") id <$> tGetRaw h