attempt to make setup_transfer more reliable by waiting for torrents to transition to downloading state before connecting peers
This commit is contained in:
parent
bd2bcf12bc
commit
c1913a97f3
|
@ -795,13 +795,7 @@ setup_transfer(lt::session* ses1, lt::session* ses2, lt::session* ses3
|
||||||
|
|
||||||
if (connect_peers)
|
if (connect_peers)
|
||||||
{
|
{
|
||||||
std::auto_ptr<alert> a;
|
wait_for_downloading(*ses2, "ses2");
|
||||||
/* do
|
|
||||||
{
|
|
||||||
a = wait_for_alert(*ses2, state_changed_alert::alert_type, "ses2");
|
|
||||||
} while (static_cast<state_changed_alert*>(a.get())->state != torrent_status::downloading);
|
|
||||||
*/
|
|
||||||
// wait_for_alert(*ses1, torrent_finished_alert::alert_type, "ses1");
|
|
||||||
|
|
||||||
error_code ec;
|
error_code ec;
|
||||||
int port = 0;
|
int port = 0;
|
||||||
|
@ -821,6 +815,8 @@ setup_transfer(lt::session* ses1, lt::session* ses2, lt::session* ses3
|
||||||
// give the other peers some time to get an initial
|
// give the other peers some time to get an initial
|
||||||
// set of pieces before they start sharing with each-other
|
// set of pieces before they start sharing with each-other
|
||||||
|
|
||||||
|
wait_for_downloading(*ses3, "ses3");
|
||||||
|
|
||||||
port = 0;
|
port = 0;
|
||||||
int port2 = 0;
|
int port2 = 0;
|
||||||
if (use_ssl_ports)
|
if (use_ssl_ports)
|
||||||
|
|
|
@ -511,33 +511,37 @@ void test_remap_files_prio(storage_mode_t storage_mode = storage_mode_sparse)
|
||||||
p2 = ses2.abort();
|
p2 = ses2.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using namespace libtorrent;
|
||||||
|
|
||||||
TORRENT_TEST(remap_files)
|
TORRENT_TEST(remap_files)
|
||||||
{
|
{
|
||||||
using namespace libtorrent;
|
|
||||||
|
|
||||||
error_code ec;
|
|
||||||
|
|
||||||
remove_all("tmp1_remap", ec);
|
|
||||||
remove_all("tmp2_remap", ec);
|
|
||||||
|
|
||||||
test_remap_files_gather();
|
test_remap_files_gather();
|
||||||
|
|
||||||
|
error_code ec;
|
||||||
remove_all("tmp1_remap", ec);
|
remove_all("tmp1_remap", ec);
|
||||||
remove_all("tmp2_remap", ec);
|
remove_all("tmp2_remap", ec);
|
||||||
remove_all("tmp1_remap2", ec);
|
remove_all("tmp1_remap2", ec);
|
||||||
remove_all("tmp2_remap2", ec);
|
remove_all("tmp2_remap2", ec);
|
||||||
|
}
|
||||||
|
|
||||||
|
TORRENT_TEST(scatter)
|
||||||
|
{
|
||||||
test_remap_files_scatter();
|
test_remap_files_scatter();
|
||||||
|
|
||||||
remove_all("tmp1_remap", ec);
|
error_code ec;
|
||||||
remove_all("tmp2_remap", ec);
|
remove_all("tmp1_remap", ec);
|
||||||
remove_all("tmp1_remap2", ec);
|
remove_all("tmp2_remap", ec);
|
||||||
remove_all("tmp2_remap2", ec);
|
remove_all("tmp1_remap2", ec);
|
||||||
remove_all("tmp1_remap3", ec);
|
remove_all("tmp2_remap2", ec);
|
||||||
remove_all("tmp2_remap3", ec);
|
remove_all("tmp1_remap3", ec);
|
||||||
|
remove_all("tmp2_remap3", ec);
|
||||||
test_remap_files_prio();
|
}
|
||||||
|
|
||||||
|
TORRENT_TEST(prio)
|
||||||
|
{
|
||||||
|
test_remap_files_prio();
|
||||||
|
|
||||||
|
error_code ec;
|
||||||
remove_all("tmp1_remap", ec);
|
remove_all("tmp1_remap", ec);
|
||||||
remove_all("tmp2_remap", ec);
|
remove_all("tmp2_remap", ec);
|
||||||
remove_all("tmp1_remap2", ec);
|
remove_all("tmp1_remap2", ec);
|
||||||
|
|
Loading…
Reference in New Issue