peer_connection.hpp | peer_connection.hpp | |||
---|---|---|---|---|
skipping to change at line 1068 | skipping to change at line 1068 | |||
template <class A0, class A1, class A2> | template <class A0, class A1, class A2> | |||
void operator()(A0 const& a0, A1 const& a1, A2 const & a2) const | void operator()(A0 const& a0, A1 const& a1, A2 const & a2) const | |||
{ | { | |||
handler(a0, a1, a2); | handler(a0, a1, a2); | |||
} | } | |||
friend void* asio_handler_allocate( | friend void* asio_handler_allocate( | |||
std::size_t size, allocating_handler<Handler, Si ze>* ctx) | std::size_t size, allocating_handler<Handler, Si ze>* ctx) | |||
{ | { | |||
assert(size <= Size); | TORRENT_ASSERT(size <= Size); | |||
#ifdef TORRENT_DEBUG | #ifdef TORRENT_DEBUG | |||
assert(!ctx->storage.used); | TORRENT_ASSERT(!ctx->storage.used); | |||
ctx->storage.used = true; | ctx->storage.used = true; | |||
#endif | #endif | |||
return &ctx->storage.bytes; | return &ctx->storage.bytes; | |||
} | } | |||
friend void asio_handler_deallocate( | friend void asio_handler_deallocate( | |||
void*, std::size_t, allocating_handler<Handl er, Size>* ctx) | void*, std::size_t, allocating_handler<Handl er, Size>* ctx) | |||
{ | { | |||
#ifdef TORRENT_DEBUG | #ifdef TORRENT_DEBUG | |||
ctx->storage.used = false; | ctx->storage.used = false; | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
policy.hpp | policy.hpp | |||
---|---|---|---|---|
skipping to change at line 304 | skipping to change at line 304 | |||
bool on_parole:1; | bool on_parole:1; | |||
// is set to true if this peer has been banned | // is set to true if this peer has been banned | |||
bool banned:1; | bool banned:1; | |||
#ifndef TORRENT_DISABLE_DHT | #ifndef TORRENT_DISABLE_DHT | |||
// this is set to true when this peer as been | // this is set to true when this peer as been | |||
// pinged by the DHT | // pinged by the DHT | |||
bool added_to_dht:1; | bool added_to_dht:1; | |||
#endif | #endif | |||
#ifdef TORRENT_DEBUG | ||||
bool in_use:1; | ||||
#endif | ||||
}; | }; | |||
struct TORRENT_EXPORT ipv4_peer : peer | struct TORRENT_EXPORT ipv4_peer : peer | |||
{ | { | |||
ipv4_peer(tcp::endpoint const& ip, bool connectable, int src); | ipv4_peer(tcp::endpoint const& ip, bool connectable, int src); | |||
ipv4_peer(libtorrent::address const& a); | ipv4_peer(libtorrent::address const& a); | |||
address_v4 addr; | address_v4 addr; | |||
}; | }; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added | |||
proxy_base.hpp | proxy_base.hpp | |||
---|---|---|---|---|
skipping to change at line 167 | skipping to change at line 167 | |||
m_resolver.cancel(); | m_resolver.cancel(); | |||
} | } | |||
#ifndef BOOST_NO_EXCEPTIONS | #ifndef BOOST_NO_EXCEPTIONS | |||
endpoint_type remote_endpoint() const | endpoint_type remote_endpoint() const | |||
{ | { | |||
return m_remote_endpoint; | return m_remote_endpoint; | |||
} | } | |||
#endif | #endif | |||
endpoint_type remote_endpoint(error_code& /*ec*/) const | endpoint_type remote_endpoint(error_code& ec) const | |||
{ | { | |||
if (!m_sock.is_open()) ec = asio::error::not_connected; | ||||
return m_remote_endpoint; | return m_remote_endpoint; | |||
} | } | |||
#ifndef BOOST_NO_EXCEPTIONS | #ifndef BOOST_NO_EXCEPTIONS | |||
endpoint_type local_endpoint() const | endpoint_type local_endpoint() const | |||
{ | { | |||
return m_sock.local_endpoint(); | return m_sock.local_endpoint(); | |||
} | } | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||
session.hpp | session.hpp | |||
---|---|---|---|---|
skipping to change at line 232 | skipping to change at line 232 | |||
{ | { | |||
save_settings = 0x001, | save_settings = 0x001, | |||
save_dht_settings = 0x002, | save_dht_settings = 0x002, | |||
save_dht_proxy = 0x004, | save_dht_proxy = 0x004, | |||
save_dht_state = 0x008, | save_dht_state = 0x008, | |||
save_i2p_proxy = 0x010, | save_i2p_proxy = 0x010, | |||
save_encryption_settings = 0x020, | save_encryption_settings = 0x020, | |||
save_peer_proxy = 0x040, | save_peer_proxy = 0x040, | |||
save_web_proxy = 0x080, | save_web_proxy = 0x080, | |||
save_tracker_proxy = 0x100, | save_tracker_proxy = 0x100, | |||
save_as_map = 0x200, | save_as_map = 0x200 | |||
}; | }; | |||
void save_state(entry& e, boost::uint32_t flags = 0xffffffff ) const; | void save_state(entry& e, boost::uint32_t flags = 0xffffffff ) const; | |||
void load_state(lazy_entry const& e); | void load_state(lazy_entry const& e); | |||
// returns a list of all torrents in this session | // returns a list of all torrents in this session | |||
std::vector<torrent_handle> get_torrents() const; | std::vector<torrent_handle> get_torrents() const; | |||
io_service& get_io_service(); | io_service& get_io_service(); | |||
// returns an invalid handle in case the torrent doesn't exi st | // returns an invalid handle in case the torrent doesn't exi st | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
session_settings.hpp | session_settings.hpp | |||
---|---|---|---|---|
skipping to change at line 167 | skipping to change at line 167 | |||
, announce_to_all_tiers(false) | , announce_to_all_tiers(false) | |||
, prefer_udp_trackers(true) | , prefer_udp_trackers(true) | |||
, strict_super_seeding(false) | , strict_super_seeding(false) | |||
, seeding_piece_quota(3) | , seeding_piece_quota(3) | |||
#ifdef TORRENT_WINDOWS | #ifdef TORRENT_WINDOWS | |||
, max_sparse_regions(30000) | , max_sparse_regions(30000) | |||
#else | #else | |||
, max_sparse_regions(0) | , max_sparse_regions(0) | |||
#endif | #endif | |||
#ifndef TORRENT_DISABLE_MLOCK | #ifndef TORRENT_DISABLE_MLOCK | |||
, lock_disk_cache(true) | , lock_disk_cache(false) | |||
#endif | #endif | |||
, max_rejects(50) | , max_rejects(50) | |||
, recv_socket_buffer_size(0) | , recv_socket_buffer_size(0) | |||
, send_socket_buffer_size(0) | , send_socket_buffer_size(0) | |||
, optimize_hashing_for_speed(true) | , optimize_hashing_for_speed(true) | |||
, file_checks_delay_per_block(0) | , file_checks_delay_per_block(0) | |||
, disk_cache_algorithm(largest_contiguous) | , disk_cache_algorithm(largest_contiguous) | |||
, read_cache_line_size(16) | , read_cache_line_size(16) | |||
, write_cache_line_size(32) | , write_cache_line_size(32) | |||
, optimistic_disk_retry(10 * 60) | , optimistic_disk_retry(10 * 60) | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
torrent.hpp | torrent.hpp | |||
---|---|---|---|---|
skipping to change at line 860 | skipping to change at line 860 | |||
void update_tracker_timer(ptime now); | void update_tracker_timer(ptime now); | |||
static void on_tracker_announce_disp(boost::weak_ptr<torrent > p | static void on_tracker_announce_disp(boost::weak_ptr<torrent > p | |||
, error_code const& e); | , error_code const& e); | |||
void on_tracker_announce(); | void on_tracker_announce(); | |||
void dht_announce(); | void dht_announce(); | |||
#ifndef TORRENT_DISABLE_DHT | #ifndef TORRENT_DISABLE_DHT | |||
static void on_dht_announce_post(boost::weak_ptr<libtorrent: | ||||
:torrent> t | ||||
, std::vector<tcp::endpoint> const& peers); | ||||
static void on_dht_announce_response_disp(boost::weak_ptr<to rrent> t | static void on_dht_announce_response_disp(boost::weak_ptr<to rrent> t | |||
, std::vector<tcp::endpoint> const& peers); | , std::vector<tcp::endpoint> const& peers); | |||
void on_dht_announce_response(std::vector<tcp::endpoint> con st& peers); | void on_dht_announce_response(std::vector<tcp::endpoint> con st& peers); | |||
bool should_announce_dht() const; | bool should_announce_dht() const; | |||
void on_dht_announce(error_code const& e); | void on_dht_announce(error_code const& e); | |||
// the time when the DHT was last announced of our | // the time when the DHT was last announced of our | |||
// presence on this torrent | // presence on this torrent | |||
ptime m_last_dht_announce; | ptime m_last_dht_announce; | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added | |||
torrent_info.hpp | torrent_info.hpp | |||
---|---|---|---|---|
skipping to change at line 82 | skipping to change at line 82 | |||
tracker_retry_delay_min = 10 | tracker_retry_delay_min = 10 | |||
// when tracker_failed_max trackers | // when tracker_failed_max trackers | |||
// has failed, wait 60 minutes instead | // has failed, wait 60 minutes instead | |||
, tracker_retry_delay_max = 60 * 60 | , tracker_retry_delay_max = 60 * 60 | |||
}; | }; | |||
struct TORRENT_EXPORT announce_entry | struct TORRENT_EXPORT announce_entry | |||
{ | { | |||
announce_entry(std::string const& u) | announce_entry(std::string const& u) | |||
: url(u) | : url(u) | |||
, next_announce(min_time()) | ||||
, min_announce(min_time()) | ||||
, tier(0) | , tier(0) | |||
, fail_limit(3) | , fail_limit(0) | |||
, fails(0) | , fails(0) | |||
, source(0) | , source(0) | |||
, verified(false) | , verified(false) | |||
, updating(false) | , updating(false) | |||
, start_sent(false) | , start_sent(false) | |||
, complete_sent(false) | , complete_sent(false) | |||
, send_stats(true) | , send_stats(true) | |||
{} | {} | |||
std::string url; | std::string url; | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 3 lines changed or added | |||
udp_socket.hpp | udp_socket.hpp | |||
---|---|---|---|---|
skipping to change at line 104 | skipping to change at line 104 | |||
void on_timeout(); | void on_timeout(); | |||
void on_connect(int ticket); | void on_connect(int ticket); | |||
void on_connected(error_code const& ec); | void on_connected(error_code const& ec); | |||
void handshake1(error_code const& e); | void handshake1(error_code const& e); | |||
void handshake2(error_code const& e); | void handshake2(error_code const& e); | |||
void handshake3(error_code const& e); | void handshake3(error_code const& e); | |||
void handshake4(error_code const& e); | void handshake4(error_code const& e); | |||
void socks_forward_udp(mutex_t::scoped_lock& l); | void socks_forward_udp(mutex_t::scoped_lock& l); | |||
void connect1(error_code const& e); | void connect1(error_code const& e); | |||
void connect2(error_code const& e); | void connect2(error_code const& e); | |||
void hung_up(error_code const& e); | ||||
void wrap(udp::endpoint const& ep, char const* p, int len, e rror_code& ec); | void wrap(udp::endpoint const& ep, char const* p, int len, e rror_code& ec); | |||
void unwrap(error_code const& e, char const* buf, int size); | void unwrap(error_code const& e, char const* buf, int size); | |||
mutable mutex_t m_mutex; | mutable mutex_t m_mutex; | |||
udp::socket m_ipv4_sock; | udp::socket m_ipv4_sock; | |||
udp::endpoint m_v4_ep; | udp::endpoint m_v4_ep; | |||
char m_v4_buf[1600]; | char m_v4_buf[1600]; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
utf8.hpp | utf8.hpp | |||
---|---|---|---|---|
skipping to change at line 51 | skipping to change at line 51 | |||
#include <cwchar> | #include <cwchar> | |||
#include "libtorrent/ConvertUTF.h" | #include "libtorrent/ConvertUTF.h" | |||
namespace libtorrent | namespace libtorrent | |||
{ | { | |||
inline int utf8_wchar(const std::string &utf8, std::wstring &wide) | inline int utf8_wchar(const std::string &utf8, std::wstring &wide) | |||
{ | { | |||
// allocate space for worst-case | // allocate space for worst-case | |||
wide.resize(utf8.size()); | wide.resize(utf8.size()); | |||
wchar_t const* dst_start = &wide[0]; | wchar_t const* dst_start = wide.c_str(); | |||
char const* src_start = &utf8[0]; | char const* src_start = utf8.c_str(); | |||
ConversionResult ret; | ConversionResult ret; | |||
if (sizeof(wchar_t) == sizeof(UTF32)) | if (sizeof(wchar_t) == sizeof(UTF32)) | |||
{ | { | |||
ret = ConvertUTF8toUTF32((const UTF8**)&src_start, ( const UTF8*)src_start | ret = ConvertUTF8toUTF32((const UTF8**)&src_start, ( const UTF8*)src_start | |||
+ utf8.size(), (UTF32**)&dst_start, (UTF32*) dst_start + wide.size() | + utf8.size(), (UTF32**)&dst_start, (UTF32*) dst_start + wide.size() | |||
, lenientConversion); | , lenientConversion); | |||
wide.resize(dst_start - &wide[0]); | wide.resize(dst_start - wide.c_str()); | |||
return ret; | return ret; | |||
} | } | |||
else if (sizeof(wchar_t) == sizeof(UTF16)) | else if (sizeof(wchar_t) == sizeof(UTF16)) | |||
{ | { | |||
ret = ConvertUTF8toUTF16((const UTF8**)&src_start, ( const UTF8*)src_start | ret = ConvertUTF8toUTF16((const UTF8**)&src_start, ( const UTF8*)src_start | |||
+ utf8.size(), (UTF16**)&dst_start, (UTF16*) dst_start + wide.size() | + utf8.size(), (UTF16**)&dst_start, (UTF16*) dst_start + wide.size() | |||
, lenientConversion); | , lenientConversion); | |||
wide.resize(dst_start - &wide[0]); | wide.resize(dst_start - wide.c_str()); | |||
return ret; | return ret; | |||
} | } | |||
else | else | |||
{ | { | |||
return sourceIllegal; | return sourceIllegal; | |||
} | } | |||
} | } | |||
inline int wchar_utf8(const std::wstring &wide, std::string &utf8) | inline int wchar_utf8(const std::wstring &wide, std::string &utf8) | |||
{ | { | |||
// allocate space for worst-case | // allocate space for worst-case | |||
utf8.resize(wide.size() * 6); | utf8.resize(wide.size() * 6); | |||
if (wide.empty()) return 0; | ||||
char* dst_start = &utf8[0]; | char* dst_start = &utf8[0]; | |||
wchar_t const* src_start = &wide[0]; | wchar_t const* src_start = wide.c_str(); | |||
ConversionResult ret; | ConversionResult ret; | |||
if (sizeof(wchar_t) == sizeof(UTF32)) | if (sizeof(wchar_t) == sizeof(UTF32)) | |||
{ | { | |||
ret = ConvertUTF32toUTF8((const UTF32**)&src_start, (const UTF32*)src_start | ret = ConvertUTF32toUTF8((const UTF32**)&src_start, (const UTF32*)src_start | |||
+ wide.size(), (UTF8**)&dst_start, (UTF8*)ds t_start + utf8.size() | + wide.size(), (UTF8**)&dst_start, (UTF8*)ds t_start + utf8.size() | |||
, lenientConversion); | , lenientConversion); | |||
utf8.resize(dst_start - &utf8[0]); | utf8.resize(dst_start - &utf8[0]); | |||
return ret; | return ret; | |||
} | } | |||
else if (sizeof(wchar_t) == sizeof(UTF16)) | else if (sizeof(wchar_t) == sizeof(UTF16)) | |||
End of changes. 5 change blocks. | ||||
5 lines changed or deleted | 6 lines changed or added | |||
version.hpp | version.hpp | |||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |||
POSSIBILITY OF SUCH DAMAGE. | POSSIBILITY OF SUCH DAMAGE. | |||
*/ | */ | |||
#ifndef TORRENT_VERSION_HPP_INCLUDED | #ifndef TORRENT_VERSION_HPP_INCLUDED | |||
#define TORRENT_VERSION_HPP_INCLUDED | #define TORRENT_VERSION_HPP_INCLUDED | |||
#define LIBTORRENT_VERSION_MAJOR 0 | #define LIBTORRENT_VERSION_MAJOR 0 | |||
#define LIBTORRENT_VERSION_MINOR 15 | #define LIBTORRENT_VERSION_MINOR 15 | |||
#define LIBTORRENT_VERSION_TINY 1 | #define LIBTORRENT_VERSION_TINY 2 | |||
#define LIBTORRENT_VERSION "0.15.1.0" | #define LIBTORRENT_VERSION "0.15.2.0" | |||
#define LIBTORRENT_REVISION "$Rev: 4658 $" | #define LIBTORRENT_REVISION "$Rev: 4758 $" | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||