merged changes from RC_1_0

This commit is contained in:
Arvid Norberg 2014-10-12 18:16:46 +00:00
parent 939411488e
commit 32d368e1ce
7 changed files with 26 additions and 16 deletions

View File

@ -31,6 +31,7 @@
* almost completely changed the storage interface (for custom storage)
* added support for hashing pieces in multiple threads
* fix protocol race-condition in super seeding mode
* support read-only DHT nodes
* remove unused partial hash DHT lookups
* remove potentially privacy leaking extension (non-anonymous mode)

View File

@ -250,6 +250,7 @@ namespace libtorrent
sha1_hash const& info_hash() const
{
TORRENT_ASSERT(m_torrent_file);
static sha1_hash empty;
return m_torrent_file ? m_torrent_file->info_hash() : empty;
}

View File

@ -823,6 +823,13 @@ namespace libtorrent
ptr += 20;
#ifdef TORRENT_VERBOSE_LOGGING
{
char hex_pid[41];
to_hex((char const*)&m_our_peer_id[0], 20, hex_pid);
hex_pid[40] = 0;
peer_log(">>> sent peer_id: %s client: %s"
, hex_pid, identify_client(m_our_peer_id).c_str());
}
peer_log("==> HANDSHAKE [ ih: %s ]", to_hex(ih.to_string()).c_str());
#endif
send_buffer(handshake, sizeof(handshake));
@ -3275,7 +3282,7 @@ namespace libtorrent
if (is_print(recv_buffer.begin[i])) ascii_pid[i] = recv_buffer.begin[i];
else ascii_pid[i] = '.';
}
peer_log("<<< received peer_id: %s client: %s\nas ascii: %s\n"
peer_log("<<< received peer_id: %s client: %s ascii: \"%s\""
, hex_pid, identify_client(peer_id(recv_buffer.begin)).c_str(), ascii_pid);
}
#endif

View File

@ -1905,13 +1905,6 @@ namespace libtorrent
TORRENT_ASSERT(t);
choke_this_peer();
if (t->super_seeding())
{
// maybe we need to try another piece, to see if the peer
// is interested in us then
superseed_piece(-1, t->get_piece_to_super_seed(m_have_piece));
}
}
void peer_connection::choke_this_peer()
@ -4787,6 +4780,15 @@ namespace libtorrent
send_block_requests();
}
if (t->super_seeding()
&& !m_peer_interested
&& m_became_uninterested + seconds(10) < now)
{
// maybe we need to try another piece, to see if the peer
// become interested in us then
superseed_piece(-1, t->get_piece_to_super_seed(m_have_piece));
}
on_tick();
if (is_disconnecting()) return;

View File

@ -4764,14 +4764,6 @@ namespace libtorrent
avail_vec.push_back(i);
}
if (min_availability > 1)
{
// if the minimum availability is 2 or more,
// we shouldn't be super seeding any more
super_seeding(false);
return -1;
}
return avail_vec[random() % avail_vec.size()];
}

View File

@ -146,6 +146,12 @@ void test_swarm(int flags)
torrent_status st2 = tor2.status();
torrent_status st3 = tor3.status();
if (flags & super_seeding)
{
TEST_CHECK(st1.is_seeding);
TEST_CHECK(st1.super_seeding);
}
if (st2.progress < 1.f && st2.progress > 0.5f)
{
sum_dl_rate2 += st2.download_payload_rate;

View File

@ -29,6 +29,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.hpp"
int EXPORT run_http_suite(int proxy, char const* protocol