]> git.rkrishnan.org Git - functorrent.git/blobdiff - src/FuncTorrent/Network.hs
Misc fixes to http tracker.
[functorrent.git] / src / FuncTorrent / Network.hs
index 8998bae98b46a26ed40e722355e52c664859244e..ca4b6d9f8fe6bd02aba6db0b88df38743304e6de 100644 (file)
@@ -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]