summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Tracker/RPC
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent/Tracker/RPC')
-rw-r--r--src/Network/BitTorrent/Tracker/RPC/HTTP.hs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/Network/BitTorrent/Tracker/RPC/HTTP.hs b/src/Network/BitTorrent/Tracker/RPC/HTTP.hs
index 81199921..cc5bd318 100644
--- a/src/Network/BitTorrent/Tracker/RPC/HTTP.hs
+++ b/src/Network/BitTorrent/Tracker/RPC/HTTP.hs
@@ -74,24 +74,24 @@ packHttpException m = try m >>= either (throwIO . RequestFailed) return
74-- | HTTP tracker specific RPC options. 74-- | HTTP tracker specific RPC options.
75data Options = Options 75data Options = Options
76 { -- | Global HTTP announce query preferences. 76 { -- | Global HTTP announce query preferences.
77 optAnnounceExt :: !AnnounceQueryExt 77 optAnnouncePrefs :: !AnnouncePrefs
78 78
79 -- | Whether to use HTTP proxy for HTTP tracker requests. 79 -- | Whether to use HTTP proxy for HTTP tracker requests.
80 , optHttpProxy :: !(Maybe Proxy) 80 , optHttpProxy :: !(Maybe Proxy)
81 81
82 -- | Value to put in HTTP user agent header. 82 -- | Value to put in HTTP user agent header.
83 , optUserAgent :: !BS.ByteString 83 , optUserAgent :: !BS.ByteString
84 84
85 -- | HTTP manager options. 85 -- | HTTP manager options.
86 , optHttpOptions :: !ManagerSettings 86 , optHttpOptions :: !ManagerSettings
87 } 87 }
88 88
89instance Default Options where 89instance Default Options where
90 def = Options 90 def = Options
91 { optAnnounceExt = def 91 { optAnnouncePrefs = def
92 , optHttpProxy = Nothing 92 , optHttpProxy = Nothing
93 , optUserAgent = BC.pack libUserAgent 93 , optUserAgent = BC.pack libUserAgent
94 , optHttpOptions = defaultManagerSettings 94 , optHttpOptions = defaultManagerSettings
95 } 95 }
96 96
97-- | HTTP tracker manager. 97-- | HTTP tracker manager.
@@ -148,8 +148,8 @@ announce :: Manager -> URI -> AnnounceQuery -> IO AnnounceInfo
148announce mgr uri q = httpTracker mgr uri (renderAnnounceRequest uriQ) 148announce mgr uri q = httpTracker mgr uri (renderAnnounceRequest uriQ)
149 where 149 where
150 uriQ = AnnounceRequest 150 uriQ = AnnounceRequest
151 { announceQuery = q 151 { announceQuery = q
152 , announceAdvises = optAnnounceExt (options mgr) 152 , announcePrefs = optAnnouncePrefs (options mgr)
153 } 153 }
154 154
155-- | Trying to convert /announce/ URL to /scrape/ URL. If 'scrapeURL' 155-- | Trying to convert /announce/ URL to /scrape/ URL. If 'scrapeURL'