diff options
-rw-r--r-- | bittorrent.cabal | 3 | ||||
-rw-r--r-- | src/Network/BitTorrent/Tracker/RPC/HTTP.hs | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/bittorrent.cabal b/bittorrent.cabal index ea87267c..92d626eb 100644 --- a/bittorrent.cabal +++ b/bittorrent.cabal | |||
@@ -156,7 +156,8 @@ library | |||
156 | , network >= 2.4 | 156 | , network >= 2.4 |
157 | , krpc >= 0.6.1 | 157 | , krpc >= 0.6.1 |
158 | , http-types >= 0.8 | 158 | , http-types >= 0.8 |
159 | , http-conduit >= 1.9 && < 2.0 | 159 | , http-client >= 0.2 |
160 | , http-conduit >= 2.0 | ||
160 | , iproute | 161 | , iproute |
161 | 162 | ||
162 | -- RNG/PRNG | 163 | -- RNG/PRNG |
diff --git a/src/Network/BitTorrent/Tracker/RPC/HTTP.hs b/src/Network/BitTorrent/Tracker/RPC/HTTP.hs index 32a5e79c..c5bf4e31 100644 --- a/src/Network/BitTorrent/Tracker/RPC/HTTP.hs +++ b/src/Network/BitTorrent/Tracker/RPC/HTTP.hs | |||
@@ -43,8 +43,9 @@ import Data.Typeable | |||
43 | import Network.URI | 43 | import Network.URI |
44 | import Network.HTTP.Conduit hiding | 44 | import Network.HTTP.Conduit hiding |
45 | (Manager, newManager, closeManager, withManager) | 45 | (Manager, newManager, closeManager, withManager) |
46 | import Network.HTTP.Client (defaultManagerSettings) | ||
47 | import Network.HTTP.Client.Internal (setUri) | ||
46 | import qualified Network.HTTP.Conduit as HTTP | 48 | import qualified Network.HTTP.Conduit as HTTP |
47 | import Network.HTTP.Conduit.Internal (setUri) | ||
48 | import Network.HTTP.Types.Header (hUserAgent) | 49 | import Network.HTTP.Types.Header (hUserAgent) |
49 | import Network.HTTP.Types.URI (SimpleQuery, renderSimpleQuery) | 50 | import Network.HTTP.Types.URI (SimpleQuery, renderSimpleQuery) |
50 | 51 | ||
@@ -92,7 +93,7 @@ instance Default Options where | |||
92 | { optAnnounceExt = def | 93 | { optAnnounceExt = def |
93 | , optHttpProxy = Nothing | 94 | , optHttpProxy = Nothing |
94 | , optUserAgent = BC.pack libUserAgent | 95 | , optUserAgent = BC.pack libUserAgent |
95 | , optHttpOptions = def | 96 | , optHttpOptions = defaultManagerSettings |
96 | } | 97 | } |
97 | 98 | ||
98 | -- | HTTP tracker manager. | 99 | -- | HTTP tracker manager. |
@@ -114,7 +115,7 @@ withManager opts = bracket (newManager opts) closeManager | |||
114 | -- Queries | 115 | -- Queries |
115 | -----------------------------------------------------------------------} | 116 | -----------------------------------------------------------------------} |
116 | 117 | ||
117 | fillRequest :: Options -> SimpleQuery -> Request m -> Request m | 118 | fillRequest :: Options -> SimpleQuery -> Request -> Request |
118 | fillRequest Options {..} q r = r | 119 | fillRequest Options {..} q r = r |
119 | { queryString = joinQuery (queryString r) (renderSimpleQuery False q) | 120 | { queryString = joinQuery (queryString r) (renderSimpleQuery False q) |
120 | , requestHeaders = (hUserAgent, optUserAgent) : requestHeaders r | 121 | , requestHeaders = (hUserAgent, optUserAgent) : requestHeaders r |