diff --git a/ChangeLog b/ChangeLog index 568e7e89b..e772b0abe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,7 @@ 1.0.3 release + * fix link order bug in makefile for python binding * fix bug in interest calculation, causing premature disconnects * tweak flag_override_resume_data semantics to make more sense (breaks backwards compatibility of edge-cases) diff --git a/bindings/python/link_flags.in b/bindings/python/link_flags.in index 0ffdde79c..102fc5478 100644 --- a/bindings/python/link_flags.in +++ b/bindings/python/link_flags.in @@ -1 +1 @@ -@LDFLAGS@ -L@top_builddir@/src/.libs +-L@top_builddir@/src/.libs @LDFLAGS@ diff --git a/bindings/python/setup.py b/bindings/python/setup.py index 8050de0bb..2264bfb30 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -53,7 +53,8 @@ packages = None if '--bjam' in sys.argv or ldflags == None or extra_cmd == None: - del sys.argv[sys.argv.index('--bjam')] + if '--bjam' in sys.argv: + del sys.argv[sys.argv.index('--bjam')] if not '--help' in sys.argv \ and not '--help-commands' in sys.argv: diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 58f7e0e33..301fa21f9 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -1889,15 +1889,6 @@ namespace libtorrent ++m_remote_pieces_dled; } - // it's important to update whether we're intersted in this peer before - // calling disconnect_if_redundant, otherwise we may disconnect even if - // we are interested - if (!t->has_piece_passed(index) - && !t->is_seed() - && !is_interesting() - && (!t->has_picker() || t->picker().piece_priority(index) != 0)) - t->peer_is_interesting(*this); - // it's important to not disconnect before we have // updated the piece picker, otherwise we will incorrectly // decrement the piece count without first incrementing it @@ -1919,10 +1910,20 @@ namespace libtorrent if (t && t->has_picker()) t->picker().check_peer_invariant(m_have_piece, this); #endif - disconnect_if_redundant(); - if (is_disconnecting()) return; } + // it's important to update whether we're intersted in this peer before + // calling disconnect_if_redundant, otherwise we may disconnect even if + // we are interested + if (!t->has_piece_passed(index) + && !t->is_seed() + && !is_interesting() + && (!t->has_picker() || t->picker().piece_priority(index) != 0)) + t->peer_is_interesting(*this); + + disconnect_if_redundant(); + if (is_disconnecting()) return; + // if we're super seeding, this might mean that somebody // forwarded this piece. In which case we need to give // a new piece to that peer