fixed test_transfer

This commit is contained in:
Arvid Norberg 2013-08-01 03:50:57 +00:00
parent 63cce14cf9
commit 0acd1200f3
3 changed files with 16 additions and 11 deletions

View File

@ -638,7 +638,7 @@ void on_udp_receive(error_code const& ec, size_t bytes_transferred, udp::endpoin
{
if (ec)
{
fprintf(stderr, "UDP tracker, read failed: %s\n", ec.message().c_str());
fprintf(stderr, "%s: UDP tracker, read failed: %s\n", time_now_string(), ec.message().c_str());
return;
}
@ -646,7 +646,7 @@ void on_udp_receive(error_code const& ec, size_t bytes_transferred, udp::endpoin
if (bytes_transferred < 16)
{
fprintf(stderr, "UDP message too short\n");
fprintf(stderr, "%s: UDP message too short\n", time_now_string());
return;
}
@ -999,7 +999,7 @@ void web_server_thread(int* port, bool ssl, bool chunked)
ios.reset();
if (stop_thread || ios.run_one(e) == 0)
{
fprintf(stderr, "io_service stopped: %s\n", e.message().c_str());
fprintf(stderr, "%s: io_service stopped: %s\n", time_now_string(), e.message().c_str());
break;
}
}
@ -1007,20 +1007,20 @@ void web_server_thread(int* port, bool ssl, bool chunked)
if (ec)
{
fprintf(stderr, "accept failed: %s\n", ec.message().c_str());
fprintf(stderr, "%s: accept failed: %s\n", time_now_string(), ec.message().c_str());
return;
}
DLOG(stderr, "accepting incoming connection\n");
DLOG(stderr, "%s: accepting incoming connection\n", time_now_string());
if (!s.is_open())
{
fprintf(stderr, "incoming connection closed\n");
fprintf(stderr, "%s: incoming connection closed\n", time_now_string());
continue;
}
#ifdef TORRENT_USE_OPENSSL
if (ssl)
{
DLOG(stderr, "SSL handshake\n");
DLOG(stderr, "%s: SSL handshake\n", time_now_string());
s.get<ssl_stream<stream_socket> >()->accept_handshake(ec);
if (ec)
{
@ -1146,7 +1146,7 @@ void web_server_thread(int* port, bool ssl, bool chunked)
}
std::string path = p.path();
fprintf(stderr, "%s\n", path.c_str());
fprintf(stderr, "%s: %s\n", time_now_string(), path.c_str());
if (path == "/redirect")
{
@ -1318,7 +1318,7 @@ void web_server_thread(int* port, bool ssl, bool chunked)
}
web_ios = 0;
fprintf(stderr, "exiting web server thread\n");
fprintf(stderr, "%s: exiting web server thread\n", time_now_string());
}

View File

@ -164,7 +164,7 @@ void test_ssl(int test_idx)
<< std::endl;
}
if (peer_disconnects == 2) break;
if (peer_disconnects >= 2) break;
if (st2.is_finished) break;

View File

@ -59,6 +59,8 @@ bool predicate(alert* a)
{
if (alert_cast<peer_disconnected_alert>(a))
++peer_disconnects;
else if (alert_cast<peer_error_alert>(a))
++peer_disconnects;
return false;
}
@ -398,6 +400,9 @@ void test_transfer(int proxy_type, bool test_disk_full = false, bool test_allowe
test_disk_full = false;
((test_storage*)tor2.get_storage_impl())->m_limit = 16 * 1024 * 1024;
tor2.set_upload_mode(false);
fprintf(stderr, "%s: discovered disk full mode. Raise limit and disable upload-mode\n", time_now_string());
peer_disconnects = 0;
test_sleep(100);
continue;
}
@ -417,7 +422,7 @@ void test_transfer(int proxy_type, bool test_disk_full = false, bool test_allowe
|| st2.state == torrent_status::checking_resume_data
|| (test_disk_full && !st2.error.empty()));
if (peer_disconnects == 2) break;
if (!test_disk_full && peer_disconnects >= 2) break;
test_sleep(100);
}