if _, ok := t.webSeeds[url]; ok {
return
}
- const maxRequests = 10
+ // I don't think Go http supports pipelining requests. However we can have more ready to go
+ // right away. This value should be some multiple of the number of connections to a host. I
+ // would expect that double maxRequests plus a bit would be appropriate.
+ const maxRequests = 32
ws := webseedPeer{
peer: Peer{
t: t,
outgoing: true,
Network: "http",
reconciledHandshakeStats: true,
- // TODO: Raise this limit, and instead limit concurrent fetches.
- PeerMaxRequests: 32,
+ // This should affect how often we have to recompute requests for this peer. Note that
+ // because we can request more than 1 thing at a time over HTTP, we will hit the low
+ // requests mark more often, so recomputation is probably sooner than with regular peer
+ // conns. ~4x maxRequests would be about right.
+ PeerMaxRequests: 128,
RemoteAddr: remoteAddrFromUrl(url),
callbacks: t.callbacks(),
},