X-Git-Url: https://git.rkrishnan.org/?p=functorrent.git;a=blobdiff_plain;f=src%2FFuncTorrent%2FNetwork.hs;h=ca4b6d9f8fe6bd02aba6db0b88df38743304e6de;hp=8998bae98b46a26ed40e722355e52c664859244e;hb=a533e0ed9679e77a3e50eb1786dbe3017a4e9928;hpb=386df507252c466f486f3b1570a885d597487469 diff --git a/src/FuncTorrent/Network.hs b/src/FuncTorrent/Network.hs index 8998bae..ca4b6d9 100644 --- a/src/FuncTorrent/Network.hs +++ b/src/FuncTorrent/Network.hs @@ -38,7 +38,8 @@ mkParams params = BC.intercalate "&" [concat [pack f, "=", s] | (f,s) <- params] sendGetRequest :: String -> [(String, ByteString)] -> IO ByteString sendGetRequest url args = simpleHTTP (defaultGETRequest_ url') >>= getResponseBody - where url' = case parseURI $ unpack $ concat [pack url, "?", qstr] of + where url' = case parseURI url'' of Just x -> x - _ -> error "Bad tracker URL" + _ -> error $ "Bad tracker URL: " ++ (show url'') qstr = mkParams args + url'' = unpack $ concat [pack url, "?", qstr]