mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
lt sync 2969
This commit is contained in:
parent
16934c8f6a
commit
4bfd5646ad
10 changed files with 43 additions and 22 deletions
|
@ -155,9 +155,9 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
for (directory_iterator i(f), end; i != end; ++i)
|
for (directory_iterator i(f), end; i != end; ++i)
|
||||||
#if BOOST_VERSION < 103600
|
#if BOOST_VERSION < 103600
|
||||||
add_files_impl(fs, p, l / i->leaf(), pred);
|
add_files_impl(fs, p, l / i->path().leaf(), pred);
|
||||||
#else
|
#else
|
||||||
add_files_impl(fs, p, l / i->filename(), pred);
|
add_files_impl(fs, p, l / i->path().filename(), pred);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -179,7 +179,11 @@ namespace libtorrent
|
||||||
|
|
||||||
inline void add_files(file_storage& fs, boost::filesystem::path const& file)
|
inline void add_files(file_storage& fs, boost::filesystem::path const& file)
|
||||||
{
|
{
|
||||||
|
#if BOOST_VERSION < 103600
|
||||||
detail::add_files_impl(fs, complete(file).branch_path(), file.leaf(), detail::default_pred);
|
detail::add_files_impl(fs, complete(file).branch_path(), file.leaf(), detail::default_pred);
|
||||||
|
#else
|
||||||
|
detail::add_files_impl(fs, complete(file).parent_path(), file.filename(), detail::default_pred);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Fun>
|
template <class Fun>
|
||||||
|
|
|
@ -143,6 +143,7 @@ namespace libtorrent
|
||||||
, min_announce_interval(5 * 60)
|
, min_announce_interval(5 * 60)
|
||||||
, prioritize_partial_pieces(false)
|
, prioritize_partial_pieces(false)
|
||||||
, auto_manage_startup(120)
|
, auto_manage_startup(120)
|
||||||
|
, rate_limit_ip_overhead(true)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// this is the user agent that will be sent to the tracker
|
// this is the user agent that will be sent to the tracker
|
||||||
|
@ -450,6 +451,11 @@ namespace libtorrent
|
||||||
// inactive until they have a fair chance to
|
// inactive until they have a fair chance to
|
||||||
// start downloading.
|
// start downloading.
|
||||||
int auto_manage_startup;
|
int auto_manage_startup;
|
||||||
|
|
||||||
|
// if set to true, the estimated TCP/IP overhead is
|
||||||
|
// drained from the rate limiters, to avoid exceeding
|
||||||
|
// the limits with the total traffic
|
||||||
|
bool rate_limit_ip_overhead;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_DHT
|
#ifndef TORRENT_DISABLE_DHT
|
||||||
|
|
|
@ -36,6 +36,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#define LIBTORRENT_VERSION_MAJOR 0
|
#define LIBTORRENT_VERSION_MAJOR 0
|
||||||
#define LIBTORRENT_VERSION_MINOR 14
|
#define LIBTORRENT_VERSION_MINOR 14
|
||||||
|
|
||||||
#define LIBTORRENT_VERSION "0.14.0.0"
|
#define LIBTORRENT_VERSION "0.14.1.0"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1010,7 +1010,7 @@ namespace libtorrent
|
||||||
if (!allocate_disk_receive_buffer(packet_size() - 9))
|
if (!allocate_disk_receive_buffer(packet_size() - 9))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TORRENT_ASSERT(has_disk_receive_buffer());
|
TORRENT_ASSERT(has_disk_receive_buffer() || packet_size() == 9);
|
||||||
|
|
||||||
// classify the received data as protocol chatter
|
// classify the received data as protocol chatter
|
||||||
// or data payload for the statistics
|
// or data payload for the statistics
|
||||||
|
|
|
@ -171,9 +171,9 @@ namespace libtorrent
|
||||||
#ifdef TORRENT_WINDOWS
|
#ifdef TORRENT_WINDOWS
|
||||||
|
|
||||||
#ifdef UNICODE
|
#ifdef UNICODE
|
||||||
std::wstring file_path(safe_convert(path.native_file_string()));
|
std::wstring file_path(safe_convert(path.external_file_string()));
|
||||||
#else
|
#else
|
||||||
std::string file_path = utf8_native(path.native_file_string());
|
std::string file_path = utf8_native(path.external_file_string());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_file_handle = CreateFile(
|
m_file_handle = CreateFile(
|
||||||
|
@ -205,7 +205,7 @@ namespace libtorrent
|
||||||
| S_IRGRP | S_IWGRP
|
| S_IRGRP | S_IWGRP
|
||||||
| S_IROTH | S_IWOTH;
|
| S_IROTH | S_IWOTH;
|
||||||
|
|
||||||
m_fd = ::open(path.native_file_string().c_str()
|
m_fd = ::open(path.external_file_string().c_str()
|
||||||
, map_open_mode(mode.m_mask), permissions);
|
, map_open_mode(mode.m_mask), permissions);
|
||||||
|
|
||||||
if (m_fd == -1)
|
if (m_fd == -1)
|
||||||
|
|
|
@ -1665,7 +1665,7 @@ namespace libtorrent
|
||||||
if (t->alerts().should_post<peer_error_alert>())
|
if (t->alerts().should_post<peer_error_alert>())
|
||||||
{
|
{
|
||||||
t->alerts().post_alert(peer_error_alert(t->get_handle(), m_remote
|
t->alerts().post_alert(peer_error_alert(t->get_handle(), m_remote
|
||||||
, m_peer_id, "peer sent 0 length piece"));
|
, m_peer_id, "peer sent 0 length piece"));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1107,9 +1107,12 @@ namespace aux {
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
// drain the IP overhead from the bandwidth limiters
|
if (m_settings.rate_limit_ip_overhead)
|
||||||
m_download_channel.drain(m_stat.download_ip_overhead());
|
{
|
||||||
m_upload_channel.drain(m_stat.upload_ip_overhead());
|
// drain the IP overhead from the bandwidth limiters
|
||||||
|
m_download_channel.drain(m_stat.download_ip_overhead());
|
||||||
|
m_upload_channel.drain(m_stat.upload_ip_overhead());
|
||||||
|
}
|
||||||
|
|
||||||
m_stat.second_tick(tick_interval);
|
m_stat.second_tick(tick_interval);
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ namespace
|
||||||
// First create branch, by calling ourself recursively
|
// First create branch, by calling ourself recursively
|
||||||
create_directories_win(ph.branch_path());
|
create_directories_win(ph.branch_path());
|
||||||
// Now that parent's path exists, create the directory
|
// Now that parent's path exists, create the directory
|
||||||
std::wstring wph(safe_convert(ph.native_directory_string()));
|
std::wstring wph(safe_convert(ph.external_directory_string()));
|
||||||
CreateDirectory(wph.c_str(), 0);
|
CreateDirectory(wph.c_str(), 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ namespace
|
||||||
std::time_t last_write_time_win( const fs::path & ph )
|
std::time_t last_write_time_win( const fs::path & ph )
|
||||||
{
|
{
|
||||||
struct _stat path_stat;
|
struct _stat path_stat;
|
||||||
std::wstring wph(safe_convert(ph.native_file_string()));
|
std::wstring wph(safe_convert(ph.external_file_string()));
|
||||||
if ( ::_wstat( wph.c_str(), &path_stat ) != 0 )
|
if ( ::_wstat( wph.c_str(), &path_stat ) != 0 )
|
||||||
boost::throw_exception( filesystem_error(
|
boost::throw_exception( filesystem_error(
|
||||||
"boost::filesystem::last_write_time",
|
"boost::filesystem::last_write_time",
|
||||||
|
@ -272,9 +272,9 @@ namespace libtorrent
|
||||||
for (basic_directory_iterator<Path> i(old_path), end; i != end; ++i)
|
for (basic_directory_iterator<Path> i(old_path), end; i != end; ++i)
|
||||||
{
|
{
|
||||||
#if BOOST_VERSION < 103600
|
#if BOOST_VERSION < 103600
|
||||||
recursive_copy(i->path(), new_path / i->leaf(), ec);
|
recursive_copy(i->path(), new_path / i->path().leaf(), ec);
|
||||||
#else
|
#else
|
||||||
recursive_copy(i->path(), new_path / i->filename(), ec);
|
recursive_copy(i->path(), new_path / i->path().filename(), ec);
|
||||||
#endif
|
#endif
|
||||||
if (ec) return;
|
if (ec) return;
|
||||||
}
|
}
|
||||||
|
@ -390,7 +390,7 @@ namespace libtorrent
|
||||||
|| (!compact_mode && size < s->first))
|
|| (!compact_mode && size < s->first))
|
||||||
{
|
{
|
||||||
if (error) *error = "filesize mismatch for file '"
|
if (error) *error = "filesize mismatch for file '"
|
||||||
+ i->path.native_file_string()
|
+ i->path.external_file_string()
|
||||||
+ "', size: " + boost::lexical_cast<std::string>(size)
|
+ "', size: " + boost::lexical_cast<std::string>(size)
|
||||||
+ ", expected to be " + boost::lexical_cast<std::string>(s->first)
|
+ ", expected to be " + boost::lexical_cast<std::string>(s->first)
|
||||||
+ " bytes";
|
+ " bytes";
|
||||||
|
@ -403,7 +403,7 @@ namespace libtorrent
|
||||||
(!compact_mode && (time > s->second + 5 * 60) || time < s->second - 1))
|
(!compact_mode && (time > s->second + 5 * 60) || time < s->second - 1))
|
||||||
{
|
{
|
||||||
if (error) *error = "timestamp mismatch for file '"
|
if (error) *error = "timestamp mismatch for file '"
|
||||||
+ i->path.native_file_string()
|
+ i->path.external_file_string()
|
||||||
+ "', modification date: " + boost::lexical_cast<std::string>(time)
|
+ "', modification date: " + boost::lexical_cast<std::string>(time)
|
||||||
+ ", expected to have modification date "
|
+ ", expected to have modification date "
|
||||||
+ boost::lexical_cast<std::string>(s->second);
|
+ boost::lexical_cast<std::string>(s->second);
|
||||||
|
@ -821,7 +821,7 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
if (i->size != fs->first)
|
if (i->size != fs->first)
|
||||||
{
|
{
|
||||||
error = "file size for '" + i->path.native_file_string()
|
error = "file size for '" + i->path.external_file_string()
|
||||||
+ "' was expected to be "
|
+ "' was expected to be "
|
||||||
+ boost::lexical_cast<std::string>(i->size) + " bytes";
|
+ boost::lexical_cast<std::string>(i->size) + " bytes";
|
||||||
return false;
|
return false;
|
||||||
|
@ -847,7 +847,7 @@ namespace libtorrent
|
||||||
save_path = complete(save_path);
|
save_path = complete(save_path);
|
||||||
|
|
||||||
#if defined(_WIN32) && defined(UNICODE) && BOOST_VERSION < 103400
|
#if defined(_WIN32) && defined(UNICODE) && BOOST_VERSION < 103400
|
||||||
std::wstring wsave_path(safe_convert(save_path.native_file_string()));
|
std::wstring wsave_path(safe_convert(save_path.external_file_string()));
|
||||||
if (!exists_win(save_path))
|
if (!exists_win(save_path))
|
||||||
CreateDirectory(wsave_path.c_str(), 0);
|
CreateDirectory(wsave_path.c_str(), 0);
|
||||||
else if ((GetFileAttributes(wsave_path.c_str()) & FILE_ATTRIBUTE_DIRECTORY) == 0)
|
else if ((GetFileAttributes(wsave_path.c_str()) & FILE_ATTRIBUTE_DIRECTORY) == 0)
|
||||||
|
|
|
@ -750,7 +750,7 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
m_error = j.str;
|
m_error = j.str;
|
||||||
pause();
|
pause();
|
||||||
m_ses.done_checking(shared_from_this());
|
if (!m_abort) m_ses.done_checking(shared_from_this());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -903,8 +903,16 @@ void upnp::on_upnp_xml(error_code const& e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.url_base.empty()) d.control_url = s.control_url;
|
if (!s.url_base.empty())
|
||||||
else d.control_url = s.url_base + s.control_url;
|
{
|
||||||
|
// avoid double slashes in path
|
||||||
|
if (s.url_base[s.url_base.size()-1] == '/'
|
||||||
|
&& !s.control_url.empty()
|
||||||
|
&& s.control_url[0] == '/')
|
||||||
|
s.url_base.erase(s.url_base.end()-1);
|
||||||
|
d.control_url = s.url_base + s.control_url;
|
||||||
|
}
|
||||||
|
else d.control_url = s.control_url;
|
||||||
|
|
||||||
std::string protocol;
|
std::string protocol;
|
||||||
std::string auth;
|
std::string auth;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue