summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Tracker
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent/Tracker')
-rw-r--r--src/Network/BitTorrent/Tracker/Message.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Network/BitTorrent/Tracker/Message.hs b/src/Network/BitTorrent/Tracker/Message.hs
index 046f7e57..9999d128 100644
--- a/src/Network/BitTorrent/Tracker/Message.hs
+++ b/src/Network/BitTorrent/Tracker/Message.hs
@@ -267,7 +267,7 @@ instance FromParam InfoHash where
267 fromParam = either (const Nothing) pure . safeConvert 267 fromParam = either (const Nothing) pure . safeConvert
268 268
269instance FromParam PeerId where 269instance FromParam PeerId where
270 fromParam = byteStringToPeerId 270 fromParam = either (const Nothing) pure . safeConvert
271 271
272instance FromParam Word32 where 272instance FromParam Word32 where
273 fromParam = readMaybe . BC.unpack 273 fromParam = readMaybe . BC.unpack
@@ -282,9 +282,9 @@ instance FromParam PortNumber where
282 fromParam bs = fromIntegral <$> (fromParam bs :: Maybe Word32) 282 fromParam bs = fromIntegral <$> (fromParam bs :: Maybe Word32)
283 283
284instance FromParam Event where 284instance FromParam Event where
285 fromParam bs = case BC.uncons bs of 285 fromParam bs = do
286 Nothing -> Nothing 286 (x, xs) <- BC.uncons bs
287 Just (x, xs) -> readMaybe $ BC.unpack $ BC.cons (Char.toUpper x) xs 287 readMaybe $ BC.unpack $ BC.cons (Char.toUpper x) xs
288 288
289type Result = Either ParamParseFailure 289type Result = Either ParamParseFailure
290 290