diff options
author | joe <joe@jerkface.net> | 2017-10-31 00:10:07 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-10-31 00:10:07 -0400 |
commit | 602b042d3f121b295e7886befdfb06805df519c1 (patch) | |
tree | dd85569710794139560b7e8e65388673e36af65d /src/Network/BitTorrent/MainlineDHT.hs | |
parent | 9e691f4f4848262807445cef14cafb5baeb10ca3 (diff) |
Revised interface to addHandler:
Pass only a parse-error handler, not bunch of unneeded methods.
Diffstat (limited to 'src/Network/BitTorrent/MainlineDHT.hs')
-rw-r--r-- | src/Network/BitTorrent/MainlineDHT.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Network/BitTorrent/MainlineDHT.hs b/src/Network/BitTorrent/MainlineDHT.hs index c0413322..c9abf003 100644 --- a/src/Network/BitTorrent/MainlineDHT.hs +++ b/src/Network/BitTorrent/MainlineDHT.hs | |||
@@ -583,8 +583,11 @@ newClient swarms addr = do | |||
583 | gen :: Word16 -> (TransactionId, Word16) | 583 | gen :: Word16 -> (TransactionId, Word16) |
584 | gen cnt = (TransactionId $ S.encode cnt, cnt+1) | 584 | gen cnt = (TransactionId $ S.encode cnt, cnt+1) |
585 | 585 | ||
586 | ignoreParseError :: String -> IO () | ||
587 | ignoreParseError _ = return () | ||
588 | |||
586 | client = Client | 589 | client = Client |
587 | { clientNet = addHandler ignoreErrors (handleMessage client) net | 590 | { clientNet = addHandler ignoreParseError (handleMessage client) net |
588 | , clientDispatcher = dispatch | 591 | , clientDispatcher = dispatch |
589 | , clientErrorReporter = ignoreErrors -- printErrors stderr | 592 | , clientErrorReporter = ignoreErrors -- printErrors stderr |
590 | , clientPending = map_var | 593 | , clientPending = map_var |