forked from premiere/premiere-libtorrent
merged changes from RC_1_0
This commit is contained in:
parent
c6da211585
commit
42120014d0
|
@ -419,8 +419,13 @@ namespace libtorrent
|
|||
// called when an extended message is received. If returning true,
|
||||
// the message is not processed by any other plugin and if false
|
||||
// is returned the next plugin in the chain will receive it to
|
||||
// be able to handle it
|
||||
// this is not called for web seeds
|
||||
// be able to handle it. This is not called for web seeds.
|
||||
// thus function may be called more than once per incoming message, but
|
||||
// only the last of the calls will the ``body`` size equal the ``length``.
|
||||
// i.e. Every time another fragment of the message is received, this
|
||||
// function will be called, until finally the whole message has been
|
||||
// received. The purpose of this is to allow early disconnects for invalid
|
||||
// messages and for reporting progress of receiving large messages.
|
||||
virtual bool on_extended(int /*length*/, int /*msg*/,
|
||||
buffer::const_interval /*body*/)
|
||||
{ return false; }
|
||||
|
|
|
@ -698,10 +698,8 @@ namespace libtorrent
|
|||
int send_buffer_capacity() const
|
||||
{ return m_send_buffer.capacity(); }
|
||||
|
||||
void max_out_request_queue(int s)
|
||||
{ m_max_out_request_queue = s; }
|
||||
int max_out_request_queue() const
|
||||
{ return m_max_out_request_queue; }
|
||||
void max_out_request_queue(int s);
|
||||
int max_out_request_queue() const;
|
||||
|
||||
#ifdef TORRENT_DEBUG
|
||||
bool piece_failed;
|
||||
|
|
|
@ -1843,7 +1843,13 @@ namespace libtorrent
|
|||
if (!client_info.empty()) m_client_version = client_info;
|
||||
|
||||
int reqq = int(root.dict_find_int_value("reqq"));
|
||||
if (reqq > 0) max_out_request_queue(reqq);
|
||||
if (reqq > 0)
|
||||
{
|
||||
max_out_request_queue(reqq);
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
peer_log("*** MAX OUT REQUEST QUEUE [ %d ]", req);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (root.dict_find_int_value("upload_only", 0))
|
||||
set_upload_only(true);
|
||||
|
|
|
@ -4502,6 +4502,20 @@ namespace libtorrent
|
|||
m_superseed_piece[0] = new_piece;
|
||||
}
|
||||
|
||||
void peer_connection::max_out_request_queue(int s)
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
peer_log("*** MAX OUT QUEUE SIZE [ %d -> %d ]"
|
||||
, m_max_out_request_queue, s);
|
||||
#endif
|
||||
m_max_out_request_queue = s;
|
||||
}
|
||||
|
||||
int peer_connection::max_out_request_queue() const
|
||||
{
|
||||
return m_max_out_request_queue;
|
||||
}
|
||||
|
||||
void peer_connection::update_desired_queue_size()
|
||||
{
|
||||
TORRENT_ASSERT(is_single_thread());
|
||||
|
@ -4532,6 +4546,12 @@ namespace libtorrent
|
|||
m_desired_queue_size = m_max_out_request_queue;
|
||||
if (m_desired_queue_size < min_request_queue)
|
||||
m_desired_queue_size = min_request_queue;
|
||||
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
peer_log("*** UPDATE_QUEUE_SIZE [ dqs: %d max: %d dl: %d qt: %d snubbed: %d ]"
|
||||
, m_desired_queue_size, m_max_out_request_queue
|
||||
, download_rate, queue_time, int(m_snubbed));
|
||||
#endif
|
||||
}
|
||||
|
||||
void peer_connection::second_tick(int tick_interval_ms)
|
||||
|
@ -4956,6 +4976,12 @@ namespace libtorrent
|
|||
buffer_size_watermark = m_settings.get_int(settings_pack::send_buffer_watermark);
|
||||
}
|
||||
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
peer_log(">>> SEND_BUFFER_WATERMARK [ %d max: %d min: %d factor: %d ]"
|
||||
, buffer_size_watermark, m_ses.settings().send_buffer_watermark
|
||||
, m_ses.settings().send_buffer_low_watermark, m_ses.settings().send_buffer_watermark_factor);
|
||||
#endif
|
||||
|
||||
// don't just pop the front element here, since in seed mode one request may
|
||||
// be blocked because we have to verify the hash first, so keep going with the
|
||||
// next request. However, only let each peer have one hash verification outstanding
|
||||
|
|
Loading…
Reference in New Issue