diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-01 12:32:49 -0800 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-01 12:32:49 -0800 |
commit | f4fcc6c1970ec8d63e185e49dff65a6bd77011ad (patch) | |
tree | 5472de9cdb8afd6b15752f796ece829bf9e0316a /src/Network/BitTorrent | |
parent | 2749007675a6ff28979fa793b48ffe910635c708 (diff) | |
parent | 5dc7a19e42da1ee1cc3570ca74a55c32d7d243e0 (diff) |
Merge pull request #2 from DanielG/master
Fix building with aeson >= 0.6.2.0
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r-- | src/Network/BitTorrent/Core/PeerAddr.hs | 2 | ||||
-rw-r--r-- | src/Network/BitTorrent/Core/PeerId.hs | 4 | ||||
-rw-r--r-- | src/Network/BitTorrent/Exchange/Status.hs | 2 | ||||
-rw-r--r-- | src/Network/BitTorrent/Tracker/RPC/Message.hs | 8 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/Network/BitTorrent/Core/PeerAddr.hs b/src/Network/BitTorrent/Core/PeerAddr.hs index e58aaa89..ed2dc672 100644 --- a/src/Network/BitTorrent/Core/PeerAddr.hs +++ b/src/Network/BitTorrent/Core/PeerAddr.hs | |||
@@ -62,7 +62,7 @@ data PeerAddr = PeerAddr { | |||
62 | , peerPort :: {-# UNPACK #-} !PortNumber | 62 | , peerPort :: {-# UNPACK #-} !PortNumber |
63 | } deriving (Show, Eq, Ord, Typeable) | 63 | } deriving (Show, Eq, Ord, Typeable) |
64 | 64 | ||
65 | $(deriveJSON (L.map toLower . L.dropWhile isLower) ''PeerAddr) | 65 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''PeerAddr) |
66 | 66 | ||
67 | -- | The tracker "announce query" compatible encoding. | 67 | -- | The tracker "announce query" compatible encoding. |
68 | instance BEncode PeerAddr where | 68 | instance BEncode PeerAddr where |
diff --git a/src/Network/BitTorrent/Core/PeerId.hs b/src/Network/BitTorrent/Core/PeerId.hs index 148f550d..1b4409a8 100644 --- a/src/Network/BitTorrent/Core/PeerId.hs +++ b/src/Network/BitTorrent/Core/PeerId.hs | |||
@@ -74,8 +74,8 @@ peerIdLen :: Int | |||
74 | peerIdLen = 20 | 74 | peerIdLen = 20 |
75 | 75 | ||
76 | instance Hashable PeerId where | 76 | instance Hashable PeerId where |
77 | hash = hash . getPeerId | 77 | hashWithSalt = hashUsing getPeerId |
78 | {-# INLINE hash #-} | 78 | {-# INLINE hashWithSalt #-} |
79 | 79 | ||
80 | instance Serialize PeerId where | 80 | instance Serialize PeerId where |
81 | put = putByteString . getPeerId | 81 | put = putByteString . getPeerId |
diff --git a/src/Network/BitTorrent/Exchange/Status.hs b/src/Network/BitTorrent/Exchange/Status.hs index 7920f2a1..03a71bbe 100644 --- a/src/Network/BitTorrent/Exchange/Status.hs +++ b/src/Network/BitTorrent/Exchange/Status.hs | |||
@@ -35,7 +35,7 @@ data PeerStatus = PeerStatus { | |||
35 | } deriving (Show, Eq) | 35 | } deriving (Show, Eq) |
36 | 36 | ||
37 | $(makeLenses ''PeerStatus) | 37 | $(makeLenses ''PeerStatus) |
38 | $(deriveJSON L.tail ''PeerStatus) | 38 | $(deriveJSON defaultOptions { fieldLabelModifier = L.tail } ''PeerStatus) |
39 | 39 | ||
40 | instance Default PeerStatus where | 40 | instance Default PeerStatus where |
41 | def = PeerStatus True False | 41 | def = PeerStatus True False |
diff --git a/src/Network/BitTorrent/Tracker/RPC/Message.hs b/src/Network/BitTorrent/Tracker/RPC/Message.hs index cec68169..213f1e83 100644 --- a/src/Network/BitTorrent/Tracker/RPC/Message.hs +++ b/src/Network/BitTorrent/Tracker/RPC/Message.hs | |||
@@ -93,7 +93,7 @@ data Event = Started | |||
93 | -- ^ To be sent when the peer completes a download. | 93 | -- ^ To be sent when the peer completes a download. |
94 | deriving (Show, Read, Eq, Ord, Enum, Bounded, Typeable) | 94 | deriving (Show, Read, Eq, Ord, Enum, Bounded, Typeable) |
95 | 95 | ||
96 | $(deriveJSON (L.map toLower . L.dropWhile isLower) ''Event) | 96 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''Event) |
97 | 97 | ||
98 | -- | HTTP tracker protocol compatible encoding. | 98 | -- | HTTP tracker protocol compatible encoding. |
99 | instance QueryValueLike Event where | 99 | instance QueryValueLike Event where |
@@ -163,7 +163,7 @@ data AnnounceQuery = AnnounceQuery | |||
163 | , reqEvent :: Maybe Event | 163 | , reqEvent :: Maybe Event |
164 | } deriving (Show, Eq, Typeable) | 164 | } deriving (Show, Eq, Typeable) |
165 | 165 | ||
166 | $(deriveJSON (L.map toLower . L.dropWhile isLower) ''AnnounceQuery) | 166 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''AnnounceQuery) |
167 | 167 | ||
168 | -- | UDP tracker protocol compatible encoding. | 168 | -- | UDP tracker protocol compatible encoding. |
169 | instance Serialize AnnounceQuery where | 169 | instance Serialize AnnounceQuery where |
@@ -386,7 +386,7 @@ data AnnounceInfo = | |||
386 | , respWarning :: !(Maybe Text) | 386 | , respWarning :: !(Maybe Text) |
387 | } deriving (Show, Typeable) | 387 | } deriving (Show, Typeable) |
388 | 388 | ||
389 | $(deriveJSON (L.map toLower . L.dropWhile isLower) ''AnnounceInfo) | 389 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''AnnounceInfo) |
390 | 390 | ||
391 | -- | HTTP tracker protocol compatible encoding. | 391 | -- | HTTP tracker protocol compatible encoding. |
392 | instance BEncode AnnounceInfo where | 392 | instance BEncode AnnounceInfo where |
@@ -524,7 +524,7 @@ data ScrapeEntry = ScrapeEntry { | |||
524 | , siName :: !(Maybe Text) | 524 | , siName :: !(Maybe Text) |
525 | } deriving (Show, Eq, Typeable) | 525 | } deriving (Show, Eq, Typeable) |
526 | 526 | ||
527 | $(deriveJSON (L.map toLower . L.dropWhile isLower) ''ScrapeEntry) | 527 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''ScrapeEntry) |
528 | 528 | ||
529 | -- | HTTP tracker protocol compatible encoding. | 529 | -- | HTTP tracker protocol compatible encoding. |
530 | instance BEncode ScrapeEntry where | 530 | instance BEncode ScrapeEntry where |