]> git.rkrishnan.org Git - functorrent.git/blobdiff - src/FuncTorrent/Tracker/Udp.hs
more hlint cleanups
[functorrent.git] / src / FuncTorrent / Tracker / Udp.hs
index ae7ad1e72b56166a80616c592c1cf05270e1d002..de99ce2721519d57f860a1ca2095e7e963822cd3 100644 (file)
@@ -96,7 +96,7 @@ instance Binary UDPRequest where
     putWord32be 0
     putWord32be 10
     putWord16be $ fromIntegral port
-  put (ScrapeReq _ _ _) = undefined
+  put ScrapeReq {} = undefined
   get = undefined
 
 instance Binary UDPResponse where
@@ -189,7 +189,7 @@ getIPPortPairs = do
     ip <- toIP <$> getByteString 4
     port <- toPort <$> getByteString 2
     ipportpairs <- getIPPortPairs
-    return $ (Peer ip port) : ipportpairs
+    return $ Peer ip port : ipportpairs
 
 startSession :: String -> Port -> IO UDPTrackerHandle
 startSession host port = do
@@ -198,7 +198,7 @@ startSession host port = do
   let (SockAddrInet p ip) = addrAddress $ head addrinfos
   putStrLn "connected to tracker"
   return UDPTrackerHandle { sock = s
-                          , addr = (SockAddrInet (fromIntegral port) ip) }
+                          , addr = SockAddrInet (fromIntegral port) ip }
   
 closeSession :: UDPTrackerHandle -> IO ()
 closeSession (UDPTrackerHandle s _) = close s
@@ -229,5 +229,4 @@ trackerLoop url sport peerId infohash fschan tstate = forever $ do
       t1 <- connectRequest
       cid <- connectResponse t1
       t2 <- announceRequest cid infohash peerId (fromIntegral up) (fromIntegral down) (fromIntegral (left tstate)) (fromIntegral sport)
-      stats <- announceResponse t2
-      return stats
+      announceResponse t2