merged RC_1_1 into master

This commit is contained in:
arvidn 2017-09-16 21:07:29 +02:00
commit 240b5f73b1
3 changed files with 39 additions and 15 deletions

View File

@ -79,6 +79,7 @@
1.1.5 release
* fix uTP path MTU discovery issue on windows (DF bit was not set correctly)
* fix python binding for torrent_handle, to be hashable
* fix IPv6 tracker support by performing the second announce in more cases
* fix utf-8 encoding check in torrent parser

View File

@ -897,10 +897,11 @@ namespace libtorrent {
piece_index_t const piece_index;
};
// The ``storage_moved_alert`` is generated when all the disk IO has completed and the
// files have been moved, as an effect of a call to ``torrent_handle::move_storage``. This
// is useful to synchronize with the actual disk. The ``path`` member is the new path of
// the storage.
// The ``storage_moved_alert`` is generated when all the disk IO has
// completed and the files have been moved, as an effect of a call to
// ``torrent_handle::move_storage``. This is useful to synchronize with the
// actual disk. The ``storage_path()`` member return the new path of the
// storage.
struct TORRENT_EXPORT storage_moved_alert final : torrent_alert
{
// internal

View File

@ -160,26 +160,24 @@ namespace libtorrent {
#endif
#ifdef TORRENT_HAS_DONT_FRAGMENT
// the order of these preprocessor tests matters. Windows defines both
// IP_DONTFRAGMENT and IP_MTU_DISCOVER, but the latter is not supported
// in general, the simple option of just setting the DF bit is preferred, if
// it's available
#if defined IP_DONTFRAG || defined IP_DONTFRAGMENT
struct dont_fragment
{
explicit dont_fragment(bool val)
#ifdef IP_PMTUDISCOVER_DO
: m_value(val ? IP_PMTUDISC_DO : IP_PMTUDISC_DONT) {}
#else
: m_value(val) {}
#endif
explicit dont_fragment(bool val) : m_value(val) {}
template<class Protocol>
int level(Protocol const&) const { return IPPROTO_IP; }
template<class Protocol>
int name(Protocol const&) const
#if defined IP_DONTFRAG
{ return IP_DONTFRAG; }
#elif defined IP_MTU_DISCOVER
{ return IP_MTU_DISCOVER; }
#elif defined IP_DONTFRAGMENT
#else // defined IP_DONTFRAGMENT
{ return IP_DONTFRAGMENT; }
#else
{}
#endif
template<class Protocol>
int const* data(Protocol const&) const { return &m_value; }
@ -187,6 +185,30 @@ namespace libtorrent {
size_t size(Protocol const&) const { return sizeof(m_value); }
int m_value;
};
#else
// this is the fallback mechanism using the IP_MTU_DISCOVER option, which
// does a little bit more than we want, it makes the kernel track an estimate
// of the MTU and rejects packets immediately if they are believed to exceed
// it.
struct dont_fragment
{
explicit dont_fragment(bool val)
: m_value(val ? IP_PMTUDISC_DO : IP_PMTUDISC_DONT) {}
template<class Protocol>
int level(Protocol const&) const { return IPPROTO_IP; }
template<class Protocol>
int name(Protocol const&) const { return IP_MTU_DISCOVER; }
template<class Protocol>
int const* data(Protocol const&) const { return &m_value; }
template<class Protocol>
size_t size(Protocol const&) const { return sizeof(m_value); }
int m_value;
};
#endif // IP_DONTFRAG vs. IP_MTU_DISCOVER
#endif // TORRENT_HAS_DONT_FRAGMENT
}