diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-24 16:49:58 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-24 16:49:58 +0400 |
commit | b2b8874245a7169cb3982ac6c338eb8fa6ed36bc (patch) | |
tree | 02dd0325865577eadf8470a244d576fc59bb066c /src | |
parent | 2c7eb149a09df0349137dc518569310d8dea1461 (diff) |
Add instance Eq for ConnectionPrefs
Diffstat (limited to 'src')
-rw-r--r-- | src/Network/BitTorrent/Exchange/Wire.hs | 8 |
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 | ||
396 | instance 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. |
397 | instance Default FloodDetector where | 401 | instance 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 | ||
741 | instance Default ConnectionPrefs where | 745 | instance Default ConnectionPrefs where |
742 | def = ConnectionPrefs | 746 | def = ConnectionPrefs |