X-Git-Url: https://git.rkrishnan.org/?a=blobdiff_plain;f=src%2FFuncTorrent%2FNetwork.hs;h=210c44319d75d651caa226ed467e86d1a0cb4e59;hb=1fee18c2a97de2e09a013e92d02778289590603b;hp=1a569a5737038bfa9437f711d61d51f90de8e290;hpb=cfd13b8f2f31f0273331c8209d410748cfb39dc8;p=functorrent.git diff --git a/src/FuncTorrent/Network.hs b/src/FuncTorrent/Network.hs index 1a569a5..210c443 100644 --- a/src/FuncTorrent/Network.hs +++ b/src/FuncTorrent/Network.hs @@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} module FuncTorrent.Network ( - httpget, + sendGetRequest, mkParams ) where @@ -17,8 +17,8 @@ import Network.URI (parseURI) mkParams :: [(String, ByteString)] -> ByteString mkParams params = BC.intercalate "&" [concat [pack f, "=", s] | (f,s) <- params] -httpget :: String -> [(String, ByteString)] -> IO ByteString -httpget url args = simpleHTTP (defaultGETRequest_ url') >>= getResponseBody +sendGetRequest :: String -> [(String, ByteString)] -> IO ByteString +sendGetRequest url args = simpleHTTP (defaultGETRequest_ url') >>= getResponseBody where url' = case parseURI $ unpack $ concat [pack url, "?", qstr] of Just x -> x _ -> error "Bad tracker URL"