Skip to content

Commit

Permalink
remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezkin committed Jan 18, 2025
1 parent 61ca96d commit ce67e76
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 39 deletions.
2 changes: 0 additions & 2 deletions src/Simplex/FileTransfer/Protocol.hs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ deriving instance Show (FileCommandTag p)

data FileCmdTag = forall p. FilePartyI p => FCT (SFileParty p) (FileCommandTag p)

deriving instance Show FileCmdTag

instance FilePartyI p => Encoding (FileCommandTag p) where
smpEncode = \case
FNEW_ -> "FNEW"
Expand Down
2 changes: 0 additions & 2 deletions src/Simplex/Messaging/Notifications/Protocol.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ deriving instance Show (NtfCommandTag e)

data NtfCmdTag = forall e. NtfEntityI e => NCT (SNtfEntity e) (NtfCommandTag e)

deriving instance Show NtfCmdTag

instance NtfEntityI e => Encoding (NtfCommandTag e) where
smpEncode = \case
TNEW_ -> "TNEW"
Expand Down
18 changes: 2 additions & 16 deletions src/Simplex/Messaging/Protocol.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1695,26 +1695,12 @@ tPut th@THandle {params} = fmap concat . mapM tPutBatch . batchTransmissions (ba
TBTransmission s _ -> (: []) <$> tPutLog th s

tPutLog :: Transport c => THandle v c p -> ByteString -> IO (Either TransportError ())
tPutLog th@THandle {params} s = do
tPutLog th s = do
r <- tPutBlock th s
case r of
Left e -> putStrLn ("tPut error: " <> show e <> paramsStr)
Left e -> putStrLn ("tPut error: " <> show e)
_ -> pure ()
pure r
where
paramsStr =
", block size "
<> show (B.length s)
<> ", thServerVRange = "
<> show (thServerVRange params)
<> ", thVersion = "
<> show (thVersion params)
<> ", thAuth = "
<> show (isJust $ thAuth params)
<> ", implySessId = "
<> show (implySessId params)
<> ", encryptBlock = "
<> show (isJust $ encryptBlock params)

-- ByteString in TBTransmissions includes byte with transmissions count
data TransportBatch r = TBTransmissions ByteString Int [r] | TBTransmission ByteString r | TBError TransportError r
Expand Down
19 changes: 0 additions & 19 deletions src/Simplex/Messaging/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1217,25 +1217,6 @@ client
Right r -> PRES r <$ inc own pSuccesses
Left e -> ERR (smpProxyError e) <$ case e of
PCEProtocolError {} -> inc own pSuccesses
PCETransportError e' -> do
liftIO $ putStrLn $ "forwardSMPTransmission error: " <> show e' <> paramsStr
inc own pErrorsOther
where
THandleParams {thVersion = v'} = thParams'
EncTransmission s = encBlock
paramsStr =
", block size "
<> show (B.length s)
<> ", thServerVRange = "
<> show (thServerVRange thParams')
<> ", thVersion = "
<> show v'
<> ", thAuth = "
<> show (isJust $ thAuth thParams')
<> ", implySessId = "
<> show (implySessId thParams')
<> ", encryptBlock = "
<> show (isJust $ encryptBlock thParams')
_ -> inc own pErrorsOther
else Just (ERR $ transportErr TEVersion) <$ inc own pErrorsCompat
where
Expand Down

0 comments on commit ce67e76

Please sign in to comment.