summaryrefslogtreecommitdiff
path: root/src/Network
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network')
-rw-r--r--src/Network/BitTorrent/Tracker/RPC.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Network/BitTorrent/Tracker/RPC.hs b/src/Network/BitTorrent/Tracker/RPC.hs
index 48048964..0ffb2017 100644
--- a/src/Network/BitTorrent/Tracker/RPC.hs
+++ b/src/Network/BitTorrent/Tracker/RPC.hs
@@ -122,9 +122,10 @@ withManager opts info = bracket (newManager opts info) closeManager
122-- TODO Catch IO exceptions on rpc calls (?) 122-- TODO Catch IO exceptions on rpc calls (?)
123 123
124data RpcException 124data RpcException
125 = UdpException UDP.RpcException -- ^ 125 = UdpException UDP.RpcException -- ^ UDP RPC driver failure;
126 | HttpException HTTP.RpcException -- ^ 126 | HttpException HTTP.RpcException -- ^ HTTP RPC driver failure;
127 | UnknownProtocol String -- ^ unknown tracker protocol scheme 127 | UnrecognizedProtocol String -- ^ unsupported scheme in announce URI;
128 | GenericException String -- ^ for furter extensibility.
128 deriving (Show, Typeable) 129 deriving (Show, Typeable)
129 130
130instance Exception RpcException 131instance Exception RpcException
@@ -141,7 +142,7 @@ dispatch :: URI -> IO a -> IO a -> IO a
141dispatch URI {..} http udp 142dispatch URI {..} http udp
142 | uriScheme == "http:" = packException HttpException http 143 | uriScheme == "http:" = packException HttpException http
143 | uriScheme == "udp:" = packException UdpException udp 144 | uriScheme == "udp:" = packException UdpException udp
144 | otherwise = throwIO $ UnknownProtocol uriScheme 145 | otherwise = throwIO $ UnrecognizedProtocol uriScheme
145 146
146announce :: Manager -> URI -> SAnnounceQuery -> IO AnnounceInfo 147announce :: Manager -> URI -> SAnnounceQuery -> IO AnnounceInfo
147announce Manager {..} uri simpleQuery 148announce Manager {..} uri simpleQuery