From 58ea9495514fa90cdd0c53a5628372d370a6bd0c Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Sat, 30 Nov 2013 16:40:34 +0400 Subject: Add tests for http tracker protocol --- src/Network/BitTorrent/Tracker/RPC/HTTP.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/Network/BitTorrent/Tracker/RPC/HTTP.hs') 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 putConnection :: Connection -> IO () putConnection = undefined -connect :: URI -> IO Connection -connect = undefined +-- TODO share manager between several threads +connect :: URI -> ResourceT IO Connection +connect uri = do + (_, m) <- allocate (newManager def) closeManager + return Connection + { announceURI = uri + , manager = m + , connProxy = Nothing + } setSimpleQuery :: SimpleQuery -> Request m -> Request m setSimpleQuery q r = r -- cgit v1.2.3