diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-11-30 16:40:34 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-11-30 16:40:34 +0400 |
commit | 58ea9495514fa90cdd0c53a5628372d370a6bd0c (patch) | |
tree | f1f78c1ec2263af198aefef60e28d4747d610b81 /src/Network/BitTorrent/Tracker/RPC/HTTP.hs | |
parent | baff7fbe8a491ce743b3fe2eef0e00ee37ee5c98 (diff) |
Add tests for http tracker protocol
Diffstat (limited to 'src/Network/BitTorrent/Tracker/RPC/HTTP.hs')
-rw-r--r-- | src/Network/BitTorrent/Tracker/RPC/HTTP.hs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Network/BitTorrent/Tracker/RPC/HTTP.hs b/src/Network/BitTorrent/Tracker/RPC/HTTP.hs index 81208590..2006ae70 100644 --- a/src/Network/BitTorrent/Tracker/RPC/HTTP.hs +++ b/src/Network/BitTorrent/Tracker/RPC/HTTP.hs | |||
@@ -51,8 +51,15 @@ data Connection = Connection | |||
51 | putConnection :: Connection -> IO () | 51 | putConnection :: Connection -> IO () |
52 | putConnection = undefined | 52 | putConnection = undefined |
53 | 53 | ||
54 | connect :: URI -> IO Connection | 54 | -- TODO share manager between several threads |
55 | connect = undefined | 55 | connect :: URI -> ResourceT IO Connection |
56 | connect uri = do | ||
57 | (_, m) <- allocate (newManager def) closeManager | ||
58 | return Connection | ||
59 | { announceURI = uri | ||
60 | , manager = m | ||
61 | , connProxy = Nothing | ||
62 | } | ||
56 | 63 | ||
57 | setSimpleQuery :: SimpleQuery -> Request m -> Request m | 64 | setSimpleQuery :: SimpleQuery -> Request m -> Request m |
58 | setSimpleQuery q r = r | 65 | setSimpleQuery q r = r |