increase default connect speed. minor cleanup. add logging for short lived connections
This commit is contained in:
parent
6ab596be17
commit
b9ec183e24
|
@ -3461,7 +3461,7 @@ namespace libtorrent
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_LOGGING
|
#ifndef TORRENT_DISABLE_LOGGING
|
||||||
peer_log(peer_log_alert::incoming_message, "HANDSHAKE");
|
peer_log(peer_log_alert::incoming_message, "HANDSHAKE", "connection ready");
|
||||||
#endif
|
#endif
|
||||||
// consider this a successful connection, reset the failcount
|
// consider this a successful connection, reset the failcount
|
||||||
if (peer_info_struct())
|
if (peer_info_struct())
|
||||||
|
|
|
@ -3495,8 +3495,8 @@ namespace libtorrent
|
||||||
|
|
||||||
if (t->alerts().should_post<block_downloading_alert>())
|
if (t->alerts().should_post<block_downloading_alert>())
|
||||||
{
|
{
|
||||||
t->alerts().emplace_alert<block_downloading_alert>(t->get_handle(),
|
t->alerts().emplace_alert<block_downloading_alert>(t->get_handle()
|
||||||
remote(), pid(), block.block_index, block.piece_index);
|
, remote(), pid(), block.block_index, block.piece_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
pending_block pb(block);
|
pending_block pb(block);
|
||||||
|
@ -3643,6 +3643,8 @@ namespace libtorrent
|
||||||
TORRENT_ASSERT(is_single_thread());
|
TORRENT_ASSERT(is_single_thread());
|
||||||
INVARIANT_CHECK;
|
INVARIANT_CHECK;
|
||||||
|
|
||||||
|
TORRENT_ASSERT(!is_connecting());
|
||||||
|
|
||||||
if (m_choked)
|
if (m_choked)
|
||||||
{
|
{
|
||||||
TORRENT_ASSERT(m_peer_info == NULL
|
TORRENT_ASSERT(m_peer_info == NULL
|
||||||
|
@ -4082,6 +4084,15 @@ namespace libtorrent
|
||||||
, op, ec.message().c_str());
|
, op, ec.message().c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ec == error_code(boost::asio::error::eof
|
||||||
|
, boost::asio::error::get_misc_category())
|
||||||
|
&& !in_handshake()
|
||||||
|
&& !is_connecting()
|
||||||
|
&& clock_type::now() - connected_time() < seconds(15))
|
||||||
|
{
|
||||||
|
peer_log(peer_log_alert::info, "SHORT_LIVED_DISCONNECT", "");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((m_channel_state[upload_channel] & peer_info::bw_network) == 0)
|
if ((m_channel_state[upload_channel] & peer_info::bw_network) == 0)
|
||||||
|
@ -4955,8 +4966,8 @@ namespace libtorrent
|
||||||
boost::int64_t piece_size = t->torrent_file().piece_length();
|
boost::int64_t piece_size = t->torrent_file().piece_length();
|
||||||
|
|
||||||
if (m_remote_dl_rate > 0)
|
if (m_remote_dl_rate > 0)
|
||||||
m_remote_dl_rate = int((m_remote_dl_rate * 2 / 3) +
|
m_remote_dl_rate = int((m_remote_dl_rate * 2 / 3)
|
||||||
((boost::int64_t(m_remote_pieces_dled) * piece_size / 3) / 60));
|
+ ((boost::int64_t(m_remote_pieces_dled) * piece_size / 3) / 60));
|
||||||
else
|
else
|
||||||
m_remote_dl_rate = int(boost::int64_t(m_remote_pieces_dled)
|
m_remote_dl_rate = int(boost::int64_t(m_remote_pieces_dled)
|
||||||
* piece_size / 60);
|
* piece_size / 60);
|
||||||
|
@ -5980,8 +5991,11 @@ namespace libtorrent
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
|
TORRENT_ASSERT_VAL(error.value() != 0, error.value());
|
||||||
#ifndef TORRENT_DISABLE_LOGGING
|
#ifndef TORRENT_DISABLE_LOGGING
|
||||||
peer_log(peer_log_alert::info, "ERROR", "in peer_connection::on_receive_data_nb error: %s"
|
peer_log(peer_log_alert::info, "ERROR"
|
||||||
|
, "in peer_connection::on_receive_data_nb error: (%s:%d) %s"
|
||||||
|
, error.category().name(), error.value()
|
||||||
, error.message().c_str());
|
, error.message().c_str());
|
||||||
#endif
|
#endif
|
||||||
on_receive(error, bytes_transferred);
|
on_receive(error, bytes_transferred);
|
||||||
|
@ -6106,8 +6120,10 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
TORRENT_ASSERT(is_single_thread());
|
TORRENT_ASSERT(is_single_thread());
|
||||||
#ifndef TORRENT_DISABLE_LOGGING
|
#ifndef TORRENT_DISABLE_LOGGING
|
||||||
peer_log(peer_log_alert::incoming, "ON_RECEIVE_DATA", "bytes: %d error: %s"
|
peer_log(peer_log_alert::incoming, "ON_RECEIVE_DATA"
|
||||||
, int(bytes_transferred), error.message().c_str());
|
, "bytes: %d error: (%s:%d) %s"
|
||||||
|
, int(bytes_transferred), error.category().name(), error.value()
|
||||||
|
, error.message().c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// submit all disk jobs later
|
// submit all disk jobs later
|
||||||
|
|
|
@ -233,7 +233,7 @@ namespace libtorrent
|
||||||
SET(max_failcount, 3, &session_impl::update_max_failcount),
|
SET(max_failcount, 3, &session_impl::update_max_failcount),
|
||||||
SET(min_reconnect_time, 60, 0),
|
SET(min_reconnect_time, 60, 0),
|
||||||
SET(peer_connect_timeout, 15, 0),
|
SET(peer_connect_timeout, 15, 0),
|
||||||
SET(connection_speed, 6, &session_impl::update_connection_speed),
|
SET(connection_speed, 10, &session_impl::update_connection_speed),
|
||||||
SET(inactivity_timeout, 600, 0),
|
SET(inactivity_timeout, 600, 0),
|
||||||
SET(unchoke_interval, 15, 0),
|
SET(unchoke_interval, 15, 0),
|
||||||
SET(optimistic_unchoke_interval, 30, 0),
|
SET(optimistic_unchoke_interval, 30, 0),
|
||||||
|
|
Loading…
Reference in New Issue