package torrent
+import (
+ "github.com/anacrolix/torrent/webseed"
+)
+
// Deprecated: The names doesn't reflect the actual behaviour. You can only add sources. Use
// AddSources instead.
func (t *Torrent) UseSources(sources []string) {
t.AddSources(sources)
}
+
+// Deprecated: Max requests are done Client-wide by host or cost-function applied to the webseed
+// URL. Max concurrent requests to a WebSeed for a given torrent. This could easily be reimplemented
+// by not assigning requests to a (Torrent, webseed URL) tuple keyed component in the webseed plan.
+func WebSeedTorrentMaxRequests(maxRequests int) AddWebSeedsOpt {
+ return func(c *webseed.Client) {
+ c.MaxRequests = maxRequests
+ }
+}
// TODO: Add a webseed http.Client option.
-// Max concurrent requests to a WebSeed for a given torrent.
-func WebSeedTorrentMaxRequests(maxRequests int) AddWebSeedsOpt {
- return func(c *webseed.Client) {
- c.MaxRequests = maxRequests
- }
-}
-
// Sets the WebSeed trailing path escaper for a webseed.Client.
func WebSeedPathEscaper(custom webseed.PathEscaper) AddWebSeedsOpt {
return func(c *webseed.Client) {
// number is based on keeping at least one connection actively downloading while another request
// is fired off, and ensuring race detection works. Downloading Sintel
// (08ada5a7a6183aae1e09d831df6748d566095a10) from "https://webtorrent.io/torrents/" is a good
- // test.
+ // test. Note since per-Torrent max requests for webseeds is not active, this doesn't do
+ // anything.
const defaultMaxRequests = 2
ws := webseedPeer{
peer: Peer{