summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Exchange/Wire.hs
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-02-24 16:49:58 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-02-24 16:49:58 +0400
commitb2b8874245a7169cb3982ac6c338eb8fa6ed36bc (patch)
tree02dd0325865577eadf8470a244d576fc59bb066c /src/Network/BitTorrent/Exchange/Wire.hs
parent2c7eb149a09df0349137dc518569310d8dea1461 (diff)
Add instance Eq for ConnectionPrefs
Diffstat (limited to 'src/Network/BitTorrent/Exchange/Wire.hs')
-rw-r--r--src/Network/BitTorrent/Exchange/Wire.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Network/BitTorrent/Exchange/Wire.hs b/src/Network/BitTorrent/Exchange/Wire.hs
index d1bed146..4ddade66 100644
--- a/src/Network/BitTorrent/Exchange/Wire.hs
+++ b/src/Network/BitTorrent/Exchange/Wire.hs
@@ -393,6 +393,10 @@ data FloodDetector = FloodDetector
393 , floodPredicate :: Detector ConnectionStats 393 , floodPredicate :: Detector ConnectionStats
394 } deriving Show 394 } deriving Show
395 395
396instance Eq FloodDetector where
397 a == b = floodFactor a == floodFactor b
398 && floodThreshold a == floodThreshold b
399
396-- | Flood detector with very permissive options. 400-- | Flood detector with very permissive options.
397instance Default FloodDetector where 401instance Default FloodDetector where
398 def = FloodDetector 402 def = FloodDetector
@@ -444,7 +448,7 @@ data Options = Options
444 -- 'ExtendedMetadata' for more info. 448 -- 'ExtendedMetadata' for more info.
445 -- 449 --
446 , maxInfoDictSize :: {-# UNPACK #-} !Int 450 , maxInfoDictSize :: {-# UNPACK #-} !Int
447 } deriving Show 451 } deriving (Show, Eq)
448 452
449-- | Permissive default parameters, most likely you don't need to 453-- | Permissive default parameters, most likely you don't need to
450-- change them. 454-- change them.
@@ -736,7 +740,7 @@ data ConnectionPrefs = ConnectionPrefs
736 , prefProtocol :: !ProtocolName 740 , prefProtocol :: !ProtocolName
737 , prefCaps :: !Caps 741 , prefCaps :: !Caps
738 , prefExtCaps :: !ExtendedCaps 742 , prefExtCaps :: !ExtendedCaps
739 } 743 } deriving (Show, Eq)
740 744
741instance Default ConnectionPrefs where 745instance Default ConnectionPrefs where
742 def = ConnectionPrefs 746 def = ConnectionPrefs