diff options
author | Sam T <sta.cs.vsu@gmail.com> | 2013-04-07 21:38:01 +0400 |
---|---|---|
committer | Sam T <sta.cs.vsu@gmail.com> | 2013-04-07 21:38:01 +0400 |
commit | 8853d0fa11db7ef39e2a6b4b8132ebe844a52c19 (patch) | |
tree | 1046749c290f693515be0e102b37da5de42761c5 | |
parent | 196ce36ef8b2a6183e06f4ef7b8f2706db1e9455 (diff) |
rename THP to Tracker
-rw-r--r-- | network-bittorrent.cabal | 5 | ||||
-rw-r--r-- | src/Network/Torrent.hs | 4 | ||||
-rw-r--r-- | src/Network/Torrent/Tracker.hs (renamed from src/Network/Torrent/THP.hs) | 8 | ||||
-rw-r--r-- | src/Network/Torrent/Tracker/Scrape.hs | 8 |
4 files changed, 18 insertions, 7 deletions
diff --git a/network-bittorrent.cabal b/network-bittorrent.cabal index 4aa6123f..50ff549f 100644 --- a/network-bittorrent.cabal +++ b/network-bittorrent.cabal | |||
@@ -19,7 +19,8 @@ source-repository head | |||
19 | library | 19 | library |
20 | exposed-modules: Data.Torrent | 20 | exposed-modules: Data.Torrent |
21 | , Network.Torrent | 21 | , Network.Torrent |
22 | , Network.Torrent.THP | 22 | , Network.Torrent.Tracker |
23 | , Network.Torrent.Tracker.Scrape | ||
23 | , Network.Torrent.PeerWire | 24 | , Network.Torrent.PeerWire |
24 | , Network.Torrent.PeerID | 25 | , Network.Torrent.PeerID |
25 | , Network.Torrent.Handshake | 26 | , Network.Torrent.Handshake |
@@ -71,7 +72,7 @@ executable client | |||
71 | 72 | ||
72 | 73 | ||
73 | 74 | ||
74 | test-suite info-hash.hs | 75 | test-suite info-hash |
75 | type: exitcode-stdio-1.0 | 76 | type: exitcode-stdio-1.0 |
76 | main-is: info-hash.hs | 77 | main-is: info-hash.hs |
77 | hs-source-dirs: tests | 78 | hs-source-dirs: tests |
diff --git a/src/Network/Torrent.hs b/src/Network/Torrent.hs index 30d19424..a9194d3e 100644 --- a/src/Network/Torrent.hs +++ b/src/Network/Torrent.hs | |||
@@ -1,11 +1,11 @@ | |||
1 | module Network.Torrent | 1 | module Network.Torrent |
2 | ( module Network.Torrent.PeerID | 2 | ( module Network.Torrent.PeerID |
3 | , module Network.Torrent.THP | 3 | , module Network.Torrent.Tracker |
4 | , module Network.Torrent.PeerWire | 4 | , module Network.Torrent.PeerWire |
5 | , module Network.Torrent.Handshake | 5 | , module Network.Torrent.Handshake |
6 | ) where | 6 | ) where |
7 | 7 | ||
8 | import Network.Torrent.PeerID | 8 | import Network.Torrent.PeerID |
9 | import Network.Torrent.THP | 9 | import Network.Torrent.Tracker |
10 | import Network.Torrent.PeerWire | 10 | import Network.Torrent.PeerWire |
11 | import Network.Torrent.Handshake | 11 | import Network.Torrent.Handshake |
diff --git a/src/Network/Torrent/THP.hs b/src/Network/Torrent/Tracker.hs index e584ead1..72fbcb44 100644 --- a/src/Network/Torrent/THP.hs +++ b/src/Network/Torrent/Tracker.hs | |||
@@ -1,12 +1,15 @@ | |||
1 | {-# OPTIONS -fno-warn-orphans #-} | 1 | {-# OPTIONS -fno-warn-orphans #-} |
2 | {-# LANGUAGE OverloadedStrings #-} | 2 | {-# LANGUAGE OverloadedStrings #-} |
3 | module Network.Torrent.THP | 3 | module Network.Torrent.Tracker |
4 | ( Peer(..), Event(..), TRequest(..), TResponse(..) | 4 | ( module Network.Torrent.Tracker.Scrape |
5 | , Peer(..), Event(..), TRequest(..), TResponse(..) | ||
5 | , defaultRequest, defaultPorts | 6 | , defaultRequest, defaultPorts |
6 | , sendRequest | 7 | , sendRequest |
7 | ) | 8 | ) |
8 | where | 9 | where |
9 | 10 | ||
11 | import Network.Torrent.Tracker.Scrape | ||
12 | |||
10 | import Control.Applicative | 13 | import Control.Applicative |
11 | import Data.Char as Char | 14 | import Data.Char as Char |
12 | import Data.Word (Word32) | 15 | import Data.Word (Word32) |
@@ -188,7 +191,6 @@ defaultRequest announce hash pid = | |||
188 | , reqEvent = Just Started | 191 | , reqEvent = Just Started |
189 | } | 192 | } |
190 | 193 | ||
191 | |||
192 | -- | TODO rename to ask for peers | 194 | -- | TODO rename to ask for peers |
193 | -- | 195 | -- |
194 | sendRequest :: TRequest -> IO (Result TResponse) | 196 | sendRequest :: TRequest -> IO (Result TResponse) |
diff --git a/src/Network/Torrent/Tracker/Scrape.hs b/src/Network/Torrent/Tracker/Scrape.hs new file mode 100644 index 00000000..2d1dec07 --- /dev/null +++ b/src/Network/Torrent/Tracker/Scrape.hs | |||
@@ -0,0 +1,8 @@ | |||
1 | module Network.Torrent.Tracker.Scrape | ||
2 | ( | ||
3 | ) where | ||
4 | |||
5 | import Network.URI | ||
6 | |||
7 | scrapeURL :: URI -> Maybe URI | ||
8 | scrapeURL = undefined | ||