From bdecc98839673136ab1d0695ab6497197f80f38e Mon Sep 17 00:00:00 2001 From: joe Date: Fri, 15 Sep 2017 05:22:35 -0400 Subject: Fixed haddock parse errors. --- src/Network/BitTorrent/MainlineDHT.hs | 1 - src/Network/Kademlia.hs | 24 ++++++++++++++++-------- src/Network/Tox/DHT/Handlers.hs | 4 ++-- src/Network/Tox/DHT/Transport.hs | 28 ++++++++++++++-------------- 4 files changed, 32 insertions(+), 25 deletions(-) (limited to 'src/Network') diff --git a/src/Network/BitTorrent/MainlineDHT.hs b/src/Network/BitTorrent/MainlineDHT.hs index 9d48c67b..6f03ef60 100644 --- a/src/Network/BitTorrent/MainlineDHT.hs +++ b/src/Network/BitTorrent/MainlineDHT.hs @@ -557,7 +557,6 @@ newClient swarms addr = do map_var <- atomically $ newTVar (0, mempty) let net = onInbound (updateRouting outgoingClient routing) $ layerTransport parsePacket encodePacket - -- $ addVerbosity $ udp -- Paranoid: It's safe to define /net/ and /client/ to be mutually diff --git a/src/Network/Kademlia.hs b/src/Network/Kademlia.hs index 53c37175..315cc652 100644 --- a/src/Network/Kademlia.hs +++ b/src/Network/Kademlia.hs @@ -52,15 +52,23 @@ data RoutingTransition ni = RoutingTransition deriving (Eq,Ord,Show,Read) data InsertionReporter ni = InsertionReporter - { -- | Called on every inbound packet. + { -- | Called on every inbound packet. Accepts: + -- + -- * Origin of packet. + -- + -- * List of nodes to be pinged as a result. reportArrival :: POSIXTime - -> ni -- ^ Origin of packet. - -> [ni] -- ^ These will be pinged as a result. + -> ni + -> [ni] -> IO () - -- | Called on every ping probe. + -- | Called on every ping probe. Accepts: + -- + -- * Who was pinged. + -- + -- * True Bool value if they ponged. , reportPingResult :: POSIXTime - -> ni -- ^ Who was pinged. - -> Bool -- ^ True if they ponged. + -> ni + -> Bool -> IO () } @@ -122,8 +130,8 @@ data Kademlia nid ni = Kademlia (InsertionReporter ni) -- more easily groked list of transitions. transition :: (ni,Maybe (t,ni)) -> [RoutingTransition ni] transition (x,m) = - -- | Just _ <- m = Node transition: Accepted --> Stranger - -- | Nothing <- m = Node transition: Applicant --> Stranger + -- Just _ <- m = Node transition: Accepted --> Stranger + -- Nothing <- m = Node transition: Applicant --> Stranger RoutingTransition x Stranger : maybeToList (accepted <$> m) diff --git a/src/Network/Tox/DHT/Handlers.hs b/src/Network/Tox/DHT/Handlers.hs index 901da99e..f22f9ffe 100644 --- a/src/Network/Tox/DHT/Handlers.hs +++ b/src/Network/Tox/DHT/Handlers.hs @@ -127,8 +127,8 @@ newRouting addr crypto update4 update6 = do let nobkts = R.defaultBucketCount :: Int tbl4 <- newTVar $ R.nullTable (comparing nodeId) (\s -> hashWithSalt s . nodeId) tentative_info4 nobkts tbl6 <- newTVar $ R.nullTable (comparing nodeId) (\s -> hashWithSalt s . nodeId) tentative_info6 nobkts - committee4 <- newTriadCommittee (update4 tbl4) -- $ updateIPVote tbl4 addr4 - committee6 <- newTriadCommittee (update6 tbl6) -- $ updateIPVote tbl6 addr6 + committee4 <- newTriadCommittee (update4 tbl4) -- updateIPVote tbl4 addr4 + committee6 <- newTriadCommittee (update6 tbl6) -- updateIPVote tbl6 addr6 sched4 <- newTVar Int.empty sched6 <- newTVar Int.empty return $ Routing tentative_info sched4 tbl4 committee4 sched6 tbl6 committee6 diff --git a/src/Network/Tox/DHT/Transport.hs b/src/Network/Tox/DHT/Transport.hs index 5a2d8a84..d7f8e0cd 100644 --- a/src/Network/Tox/DHT/Transport.hs +++ b/src/Network/Tox/DHT/Transport.hs @@ -146,21 +146,21 @@ noReplyAddr saddr = either (error . mappend "noReplyAddr: ") id $ nodeInfo zeroI data DHTRequest --- #### NAT ping request --- --- Length Contents --- :------- :------------------------- --- `1` `uint8_t` (0xfe) --- `1` `uint8_t` (0x00) --- `8` `uint64_t` random number + -- #### NAT ping request + -- + -- Length Contents + -- :------- :------------------------- + -- `1` `uint8_t` (0xfe) + -- `1` `uint8_t` (0x00) + -- `8` `uint64_t` random number = NATPing Nonce8 --- #### NAT ping response --- --- Length Contents --- :------- :----------------------------------------------------------------- --- `1` `uint8_t` (0xfe) --- `1` `uint8_t` (0x01) --- `8` `uint64_t` random number (the same that was received in request) + -- #### NAT ping response + -- + -- Length Contents + -- :------- :----------------------------------------------------------------- + -- `1` `uint8_t` (0xfe) + -- `1` `uint8_t` (0x01) + -- `8` `uint64_t` random number (the same that was received in request) | NATPong Nonce8 | DHTPK LongTermKeyWrap deriving Show -- cgit v1.2.3