Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many requests are made for metadata #41

Open
Aaron1011 opened this issue Apr 22, 2014 · 0 comments
Open

Too many requests are made for metadata #41

Aaron1011 opened this issue Apr 22, 2014 · 0 comments

Comments

@Aaron1011
Copy link
Contributor

Currently, Taipei-Torrent checks if a peer has advertised metadata support here. If the peer has, it kicks off the metadata-request processing by asking for the first piece of the metadata.

Whenever Taipei-Torrent receives a metadata response, DoMetadata. The problem is that each time DoMetadata is called with a metadata response, it attempts to fetch all missing metadata pieces.

Consider this scenario:

  1. The client connects to a peer advertising metadata support, and requests the first piece of the metadata (piece 0).
  2. The client receives piece 0 from the peer, and requests all of the missing pieces (in this case, 10).
  3. The peer sends back metadata piece 1. However, since none of the other metadata pieces have been received, the client will send another request for every piece besides 0 and 1, even though requests for those pieces are already in-flight.
  4. Step 3 continues for each received piece, until the client has all of the pieces (after issuing many duplicate requests).

I believe a good solution is to poll the peer for a piece if a response for it is not received, similar to how a tracker is polled for a response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant