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

SAM connection shall stay open even if some peer failed to resolve #3

Closed
mlt opened this issue Jun 13, 2015 · 4 comments
Closed

SAM connection shall stay open even if some peer failed to resolve #3

mlt opened this issue Jun 13, 2015 · 4 comments

Comments

@mlt
Copy link
Contributor

mlt commented Jun 13, 2015

Currently if INVALID_KEY is returned, the connection is getting closed by handle_error. Thus other peer addresses aren't even attempted to resolve... actually they fail with 10009 (The file handle supplied is not valid.)

mlt added a commit to mlt/libtorrent that referenced this issue Jun 15, 2015
mlt added a commit to mlt/libtorrent that referenced this issue Jun 15, 2015
@arvidn
Copy link
Owner

arvidn commented Jun 16, 2015

do you intend to issue a pull request for this patch? it looks reasonable as far as I can tell

@mlt
Copy link
Contributor Author

mlt commented Jun 16, 2015

I was planning to test this and that before submitting a pull request. Hence I called the branch work in progress to solicit comments. I'm not sure if the patch is enough. Eventually, I'd clean it up for a pull request. If you'd rather prefer a few shorter pull request, I'll do that.
There are quite a few (~3) assertions that still fail, e.g.

  1. deletion of a peer that failed to handshake on time (on second_tick) fails TORRENT_ASSERT(p->in_use); @ peer_list::connection_closed
  2. http_connection::on_connect often fails with m_connecting being false. Missing assignment at the end of http_connection::on_i2p_resolve ?
  3. TORRENT_ASSERT(pp->prev_amount_upload == 0); in torrent::remove_peer.I'm not sure yet when this happens.

Also I'm somewhat puzzled as how to reestablish connection, e.g. when i2p router died. It doesn't look like there is a provision to reestablish SAM connection.

mlt added a commit to mlt/libtorrent that referenced this issue Jun 16, 2015
@arvidn
Copy link
Owner

arvidn commented Jun 17, 2015

one pull requests is fine. either way

@arvidn arvidn closed this as completed in #5 Jun 17, 2015
@arvidn
Copy link
Owner

arvidn commented Jun 17, 2015

as for number 3, when a peer connects, it takes the upload/download stats from the torrent_peer object and stores it in the peer_connection. It's supposed to set the fields in torrent_peer to 0 when it does this. Then as it uploads and downloads more bytes it increments those counters in peer_connection. When it disconnects, it puts back the stats. If the counters in torrent_peer are non-zero, that implies that either some other peer_connection was connected as the same peer, or it got disconnected so quickly after connecting that it never had time to zero those counters out (and perhaps not pick up the stats either)

mlt added a commit to mlt/libtorrent that referenced this issue Jun 25, 2015
Propagate i2p result code, related to arvidn#3
mlt added a commit to mlt/libtorrent that referenced this issue Jun 27, 2015
Propagate i2p result code, related to arvidn#3
mlt added a commit to mlt/libtorrent that referenced this issue Jun 27, 2015
Propagate i2p result code, related to arvidn#3
mlt added a commit to mlt/libtorrent that referenced this issue Jul 14, 2015
Propagate i2p result code, related to arvidn#3
mlt added a commit to mlt/libtorrent that referenced this issue Jul 14, 2015
Propagate i2p result code, related to arvidn#3
mlt added a commit to mlt/libtorrent that referenced this issue Jul 14, 2015
Propagate i2p result code, related to arvidn#3
@ghost ghost mentioned this issue Jan 29, 2018
arvidn pushed a commit that referenced this issue Feb 25, 2019
remove two repeated subexpressions when calculating piece index and block index
@southernedge southernedge mentioned this issue Sep 27, 2020
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

2 participants