| alert_types.hpp | | alert_types.hpp | |
| | | | |
| skipping to change at line 336 | | skipping to change at line 336 | |
| int incomplete; | | int incomplete; | |
| int complete; | | int complete; | |
| }; | | }; | |
| | | | |
| struct TORRENT_EXPORT scrape_failed_alert: tracker_alert | | struct TORRENT_EXPORT scrape_failed_alert: tracker_alert | |
| { | | { | |
| scrape_failed_alert(torrent_handle const& h | | scrape_failed_alert(torrent_handle const& h | |
| , std::string const& url_ | | , std::string const& url_ | |
| , error_code const& e) | | , error_code const& e) | |
| : tracker_alert(h, url_) | | : tracker_alert(h, url_) | |
|
| , msg(e.message()) | | , msg(convert_from_native(e.message())) | |
| { TORRENT_ASSERT(!url.empty()); } | | { TORRENT_ASSERT(!url.empty()); } | |
| | | | |
| scrape_failed_alert(torrent_handle const& h | | scrape_failed_alert(torrent_handle const& h | |
| , std::string const& url_ | | , std::string const& url_ | |
| , std::string const& msg_) | | , std::string const& msg_) | |
| : tracker_alert(h, url_) | | : tracker_alert(h, url_) | |
| , msg(msg_) | | , msg(msg_) | |
| { TORRENT_ASSERT(!url.empty()); } | | { TORRENT_ASSERT(!url.empty()); } | |
| | | | |
| TORRENT_DEFINE_ALERT(scrape_failed_alert); | | TORRENT_DEFINE_ALERT(scrape_failed_alert); | |
| | | | |
| skipping to change at line 461 | | skipping to change at line 461 | |
| }; | | }; | |
| | | | |
| struct TORRENT_EXPORT peer_error_alert: peer_alert | | struct TORRENT_EXPORT peer_error_alert: peer_alert | |
| { | | { | |
| peer_error_alert(torrent_handle const& h, tcp::endpoint cons
t& ep | | peer_error_alert(torrent_handle const& h, tcp::endpoint cons
t& ep | |
| , peer_id const& peer_id, error_code const& e) | | , peer_id const& peer_id, error_code const& e) | |
| : peer_alert(h, ep, peer_id) | | : peer_alert(h, ep, peer_id) | |
| , error(e) | | , error(e) | |
| { | | { | |
| #ifndef TORRENT_NO_DEPRECATE | | #ifndef TORRENT_NO_DEPRECATE | |
|
| msg = error.message(); | | msg = convert_from_native(error.message()); | |
| #endif | | #endif | |
| } | | } | |
| | | | |
| TORRENT_DEFINE_ALERT(peer_error_alert); | | TORRENT_DEFINE_ALERT(peer_error_alert); | |
| | | | |
| const static int static_category = alert::peer_notification; | | const static int static_category = alert::peer_notification; | |
| virtual std::string message() const | | virtual std::string message() const | |
| { | | { | |
|
| return peer_alert::message() + " peer error: " + err
or.message(); | | return peer_alert::message() + " peer error: " + con
vert_from_native(error.message()); | |
| } | | } | |
| | | | |
| error_code error; | | error_code error; | |
| | | | |
| #ifndef TORRENT_NO_DEPRECATE | | #ifndef TORRENT_NO_DEPRECATE | |
| std::string msg; | | std::string msg; | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| struct TORRENT_EXPORT peer_connect_alert: peer_alert | | struct TORRENT_EXPORT peer_connect_alert: peer_alert | |
| | | | |
| skipping to change at line 502 | | skipping to change at line 502 | |
| }; | | }; | |
| | | | |
| struct TORRENT_EXPORT peer_disconnected_alert: peer_alert | | struct TORRENT_EXPORT peer_disconnected_alert: peer_alert | |
| { | | { | |
| peer_disconnected_alert(torrent_handle const& h, tcp::endpoi
nt const& ep | | peer_disconnected_alert(torrent_handle const& h, tcp::endpoi
nt const& ep | |
| , peer_id const& peer_id, error_code const& e) | | , peer_id const& peer_id, error_code const& e) | |
| : peer_alert(h, ep, peer_id) | | : peer_alert(h, ep, peer_id) | |
| , error(e) | | , error(e) | |
| { | | { | |
| #ifndef TORRENT_NO_DEPRECATE | | #ifndef TORRENT_NO_DEPRECATE | |
|
| msg = error.message(); | | msg = convert_from_native(error.message()); | |
| #endif | | #endif | |
| } | | } | |
| | | | |
| TORRENT_DEFINE_ALERT(peer_disconnected_alert); | | TORRENT_DEFINE_ALERT(peer_disconnected_alert); | |
| | | | |
| const static int static_category = alert::debug_notification
; | | const static int static_category = alert::debug_notification
; | |
|
| virtual std::string message() const | | virtual std::string message() const; | |
| { return peer_alert::message() + " disconnecting: " + error. | | | |
| message(); } | | | |
| | | | |
| error_code error; | | error_code error; | |
| | | | |
| #ifndef TORRENT_NO_DEPRECATE | | #ifndef TORRENT_NO_DEPRECATE | |
| std::string msg; | | std::string msg; | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| struct TORRENT_EXPORT invalid_request_alert: peer_alert | | struct TORRENT_EXPORT invalid_request_alert: peer_alert | |
| { | | { | |
| | | | |
| skipping to change at line 690 | | skipping to change at line 689 | |
| : torrent_alert(h) | | : torrent_alert(h) | |
| , error(ec_) | | , error(ec_) | |
| {} | | {} | |
| | | | |
| TORRENT_DEFINE_ALERT(storage_moved_failed_alert); | | TORRENT_DEFINE_ALERT(storage_moved_failed_alert); | |
| | | | |
| const static int static_category = alert::storage_notificati
on; | | const static int static_category = alert::storage_notificati
on; | |
| virtual std::string message() const | | virtual std::string message() const | |
| { | | { | |
| return torrent_alert::message() + " storage move fai
led: " | | return torrent_alert::message() + " storage move fai
led: " | |
|
| + error.message(); | | + convert_from_native(error.message()); | |
| } | | } | |
| | | | |
| error_code error; | | error_code error; | |
| }; | | }; | |
| | | | |
| struct TORRENT_EXPORT torrent_deleted_alert: torrent_alert | | struct TORRENT_EXPORT torrent_deleted_alert: torrent_alert | |
| { | | { | |
| torrent_deleted_alert(torrent_handle const& h, sha1_hash con
st& ih) | | torrent_deleted_alert(torrent_handle const& h, sha1_hash con
st& ih) | |
| : torrent_alert(h) | | : torrent_alert(h) | |
| { info_hash = ih; } | | { info_hash = ih; } | |
| | | | |
| skipping to change at line 718 | | skipping to change at line 717 | |
| sha1_hash info_hash; | | sha1_hash info_hash; | |
| }; | | }; | |
| | | | |
| struct TORRENT_EXPORT torrent_delete_failed_alert: torrent_alert | | struct TORRENT_EXPORT torrent_delete_failed_alert: torrent_alert | |
| { | | { | |
| torrent_delete_failed_alert(torrent_handle const& h, error_c
ode const& e) | | torrent_delete_failed_alert(torrent_handle const& h, error_c
ode const& e) | |
| : torrent_alert(h) | | : torrent_alert(h) | |
| , error(e) | | , error(e) | |
| { | | { | |
| #ifndef TORRENT_NO_DEPRECATE | | #ifndef TORRENT_NO_DEPRECATE | |
|
| msg = error.message(); | | msg = convert_from_native(error.message()); | |
| #endif | | #endif | |
| } | | } | |
| | | | |
| TORRENT_DEFINE_ALERT(torrent_delete_failed_alert); | | TORRENT_DEFINE_ALERT(torrent_delete_failed_alert); | |
| | | | |
| const static int static_category = alert::storage_notificati
on | | const static int static_category = alert::storage_notificati
on | |
| | alert::error_notification; | | | alert::error_notification; | |
| virtual std::string message() const | | virtual std::string message() const | |
| { | | { | |
| return torrent_alert::message() + " torrent deletion
failed: " | | return torrent_alert::message() + " torrent deletion
failed: " | |
|
| + error.message(); | | +convert_from_native(error.message()); | |
| } | | } | |
| | | | |
| error_code error; | | error_code error; | |
| | | | |
| #ifndef TORRENT_NO_DEPRECATE | | #ifndef TORRENT_NO_DEPRECATE | |
| std::string msg; | | std::string msg; | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| struct TORRENT_EXPORT save_resume_data_alert: torrent_alert | | struct TORRENT_EXPORT save_resume_data_alert: torrent_alert | |
| | | | |
| skipping to change at line 765 | | skipping to change at line 764 | |
| }; | | }; | |
| | | | |
| struct TORRENT_EXPORT save_resume_data_failed_alert: torrent_alert | | struct TORRENT_EXPORT save_resume_data_failed_alert: torrent_alert | |
| { | | { | |
| save_resume_data_failed_alert(torrent_handle const& h | | save_resume_data_failed_alert(torrent_handle const& h | |
| , error_code const& e) | | , error_code const& e) | |
| : torrent_alert(h) | | : torrent_alert(h) | |
| , error(e) | | , error(e) | |
| { | | { | |
| #ifndef TORRENT_NO_DEPRECATE | | #ifndef TORRENT_NO_DEPRECATE | |
|
| msg = error.message(); | | msg = convert_from_native(error.message()); | |
| #endif | | #endif | |
| } | | } | |
| | | | |
| TORRENT_DEFINE_ALERT(save_resume_data_failed_alert); | | TORRENT_DEFINE_ALERT(save_resume_data_failed_alert); | |
| | | | |
| const static int static_category = alert::storage_notificati
on | | const static int static_category = alert::storage_notificati
on | |
| | alert::error_notification; | | | alert::error_notification; | |
| virtual std::string message() const | | virtual std::string message() const | |
| { | | { | |
| return torrent_alert::message() + " resume data was
not generated: " | | return torrent_alert::message() + " resume data was
not generated: " | |
|
| + error.message(); | | + convert_from_native(error.message()); | |
| } | | } | |
| virtual bool discardable() const { return false; } | | virtual bool discardable() const { return false; } | |
| | | | |
| error_code error; | | error_code error; | |
| | | | |
| #ifndef TORRENT_NO_DEPRECATE | | #ifndef TORRENT_NO_DEPRECATE | |
| std::string msg; | | std::string msg; | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| | | | |
| skipping to change at line 833 | | skipping to change at line 832 | |
| }; | | }; | |
| | | | |
| struct TORRENT_EXPORT url_seed_alert: torrent_alert | | struct TORRENT_EXPORT url_seed_alert: torrent_alert | |
| { | | { | |
| url_seed_alert( | | url_seed_alert( | |
| torrent_handle const& h | | torrent_handle const& h | |
| , std::string const& url_ | | , std::string const& url_ | |
| , error_code const& e) | | , error_code const& e) | |
| : torrent_alert(h) | | : torrent_alert(h) | |
| , url(url_) | | , url(url_) | |
|
| , msg(e.message()) | | , msg(convert_from_native(e.message())) | |
| {} | | {} | |
| | | | |
| url_seed_alert( | | url_seed_alert( | |
| torrent_handle const& h | | torrent_handle const& h | |
| , std::string const& url_ | | , std::string const& url_ | |
| , std::string const& msg_) | | , std::string const& msg_) | |
| : torrent_alert(h) | | : torrent_alert(h) | |
| , url(url_) | | , url(url_) | |
| , msg(msg_) | | , msg(msg_) | |
| {} | | {} | |
| | | | |
| skipping to change at line 869 | | skipping to change at line 868 | |
| { | | { | |
| file_error_alert( | | file_error_alert( | |
| std::string const& f | | std::string const& f | |
| , torrent_handle const& h | | , torrent_handle const& h | |
| , error_code const& e) | | , error_code const& e) | |
| : torrent_alert(h) | | : torrent_alert(h) | |
| , file(f) | | , file(f) | |
| , error(e) | | , error(e) | |
| { | | { | |
| #ifndef TORRENT_NO_DEPRECATE | | #ifndef TORRENT_NO_DEPRECATE | |
|
| msg = error.message(); | | msg = convert_from_native(error.message()); | |
| #endif | | #endif | |
| } | | } | |
| | | | |
| TORRENT_DEFINE_ALERT(file_error_alert); | | TORRENT_DEFINE_ALERT(file_error_alert); | |
| | | | |
| const static int static_category = alert::status_notificatio
n | | const static int static_category = alert::status_notificatio
n | |
| | alert::error_notification | | | alert::error_notification | |
| | alert::storage_notification; | | | alert::storage_notification; | |
| virtual std::string message() const | | virtual std::string message() const | |
| { | | { | |
| return torrent_alert::message() + " file (" + file +
") error: " | | return torrent_alert::message() + " file (" + file +
") error: " | |
|
| + error.message(); | | + convert_from_native(error.message()); | |
| } | | } | |
| | | | |
| std::string file; | | std::string file; | |
| error_code error; | | error_code error; | |
| | | | |
| #ifndef TORRENT_NO_DEPRECATE | | #ifndef TORRENT_NO_DEPRECATE | |
| std::string msg; | | std::string msg; | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| | | | |
| skipping to change at line 934 | | skipping to change at line 933 | |
| : endpoint(ep) | | : endpoint(ep) | |
| , error(ec) | | , error(ec) | |
| {} | | {} | |
| | | | |
| TORRENT_DEFINE_ALERT(udp_error_alert); | | TORRENT_DEFINE_ALERT(udp_error_alert); | |
| | | | |
| const static int static_category = alert::error_notification
; | | const static int static_category = alert::error_notification
; | |
| virtual std::string message() const | | virtual std::string message() const | |
| { | | { | |
| error_code ec; | | error_code ec; | |
|
| return "UDP error: " + error.message() + " from: " +
endpoint.address().to_string(ec); | | return "UDP error: " + convert_from_native(error.mes
sage()) + " from: " + endpoint.address().to_string(ec); | |
| } | | } | |
| | | | |
| udp::endpoint endpoint; | | udp::endpoint endpoint; | |
| error_code error; | | error_code error; | |
| }; | | }; | |
| | | | |
| struct TORRENT_EXPORT external_ip_alert: alert | | struct TORRENT_EXPORT external_ip_alert: alert | |
| { | | { | |
| external_ip_alert(address const& ip) | | external_ip_alert(address const& ip) | |
| : external_address(ip) | | : external_address(ip) | |
| | | | |
| skipping to change at line 999 | | skipping to change at line 998 | |
| | | | |
| tcp::endpoint endpoint; | | tcp::endpoint endpoint; | |
| }; | | }; | |
| | | | |
| struct TORRENT_EXPORT portmap_error_alert: alert | | struct TORRENT_EXPORT portmap_error_alert: alert | |
| { | | { | |
| portmap_error_alert(int i, int t, error_code const& e) | | portmap_error_alert(int i, int t, error_code const& e) | |
| : mapping(i), map_type(t), error(e) | | : mapping(i), map_type(t), error(e) | |
| { | | { | |
| #ifndef TORRENT_NO_DEPRECATE | | #ifndef TORRENT_NO_DEPRECATE | |
|
| msg = error.message(); | | msg = convert_from_native(error.message()); | |
| #endif | | #endif | |
| } | | } | |
| | | | |
| TORRENT_DEFINE_ALERT(portmap_error_alert); | | TORRENT_DEFINE_ALERT(portmap_error_alert); | |
| | | | |
| const static int static_category = alert::port_mapping_notif
ication | | const static int static_category = alert::port_mapping_notif
ication | |
| | alert::error_notification; | | | alert::error_notification; | |
| virtual std::string message() const; | | virtual std::string message() const; | |
| | | | |
| int mapping; | | int mapping; | |
| | | | |
| skipping to change at line 1056 | | skipping to change at line 1055 | |
| }; | | }; | |
| | | | |
| struct TORRENT_EXPORT fastresume_rejected_alert: torrent_alert | | struct TORRENT_EXPORT fastresume_rejected_alert: torrent_alert | |
| { | | { | |
| fastresume_rejected_alert(torrent_handle const& h | | fastresume_rejected_alert(torrent_handle const& h | |
| , error_code const& e) | | , error_code const& e) | |
| : torrent_alert(h) | | : torrent_alert(h) | |
| , error(e) | | , error(e) | |
| { | | { | |
| #ifndef TORRENT_NO_DEPRECATE | | #ifndef TORRENT_NO_DEPRECATE | |
|
| msg = error.message(); | | msg = convert_from_native(error.message()); | |
| #endif | | #endif | |
| } | | } | |
| | | | |
| TORRENT_DEFINE_ALERT(fastresume_rejected_alert); | | TORRENT_DEFINE_ALERT(fastresume_rejected_alert); | |
| | | | |
| const static int static_category = alert::status_notificatio
n | | const static int static_category = alert::status_notificatio
n | |
| | alert::error_notification; | | | alert::error_notification; | |
| virtual std::string message() const | | virtual std::string message() const | |
|
| { return torrent_alert::message() + " fast resume rejected:
" + error.message(); } | | { return torrent_alert::message() + " fast resume rejected:
" + convert_from_native(error.message()); } | |
| | | | |
| error_code error; | | error_code error; | |
| | | | |
| #ifndef TORRENT_NO_DEPRECATE | | #ifndef TORRENT_NO_DEPRECATE | |
| std::string msg; | | std::string msg; | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| struct TORRENT_EXPORT peer_blocked_alert: torrent_alert | | struct TORRENT_EXPORT peer_blocked_alert: torrent_alert | |
| { | | { | |
| | | | |
End of changes. 17 change blocks. |
| 19 lines changed or deleted | | 17 lines changed or added | |
|
| config.hpp | | config.hpp | |
| | | | |
| skipping to change at line 182 | | skipping to change at line 182 | |
| || defined __OpenBSD__ || defined __bsdi__ || defined __DragonFly__
\ | | || defined __OpenBSD__ || defined __bsdi__ || defined __DragonFly__
\ | |
| || defined __FreeBSD_kernel__ | | || defined __FreeBSD_kernel__ | |
| #define TORRENT_BSD | | #define TORRENT_BSD | |
| // we don't need iconv on mac, because | | // we don't need iconv on mac, because | |
| // the locale is always utf-8 | | // the locale is always utf-8 | |
| #if defined __APPLE__ | | #if defined __APPLE__ | |
| #ifndef TORRENT_USE_ICONV | | #ifndef TORRENT_USE_ICONV | |
| #define TORRENT_USE_ICONV 0 | | #define TORRENT_USE_ICONV 0 | |
| #define TORRENT_USE_LOCALE 0 | | #define TORRENT_USE_LOCALE 0 | |
| #define TORRENT_CLOSE_MAY_BLOCK 1 | | #define TORRENT_CLOSE_MAY_BLOCK 1 | |
|
| | | // execinfo.h is available in the MacOS X 10.5 SDK. | |
| | | #define TORRENT_USE_EXECINFO MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 | |
| #endif | | #endif | |
| #else | | #else | |
| // FreeBSD has a reasonable iconv signature | | // FreeBSD has a reasonable iconv signature | |
|
| #define TORRENT_ICONV_ARG (const char**) | | // unless we're on glibc | |
| | | #ifndef __GLIBC__ | |
| | | # define TORRENT_ICONV_ARG (const char**) | |
| | | #endif | |
| #endif | | #endif | |
| #define TORRENT_HAS_FALLOCATE 0 | | #define TORRENT_HAS_FALLOCATE 0 | |
| #define TORRENT_USE_IFADDRS 1 | | #define TORRENT_USE_IFADDRS 1 | |
| #define TORRENT_USE_SYSCTL 1 | | #define TORRENT_USE_SYSCTL 1 | |
| #define TORRENT_USE_IFCONF 1 | | #define TORRENT_USE_IFCONF 1 | |
| | | | |
| // ==== LINUX === | | // ==== LINUX === | |
| #elif defined __linux__ | | #elif defined __linux__ | |
| #define TORRENT_LINUX | | #define TORRENT_LINUX | |
| #define TORRENT_USE_IFADDRS 1 | | #define TORRENT_USE_IFADDRS 1 | |
| #define TORRENT_USE_NETLINK 1 | | #define TORRENT_USE_NETLINK 1 | |
| #define TORRENT_USE_IFCONF 1 | | #define TORRENT_USE_IFCONF 1 | |
| #define TORRENT_HAS_SALEN 0 | | #define TORRENT_HAS_SALEN 0 | |
| #define TORRENT_USE_POSIX_MEMALIGN 1 | | #define TORRENT_USE_POSIX_MEMALIGN 1 | |
|
| | | #if __amd64__ || __i386__ | |
| | | #define TORRENT_USE_EXECINFO 1 | |
| | | #endif | |
| | | | |
| // ==== MINGW === | | // ==== MINGW === | |
| #elif defined __MINGW32__ | | #elif defined __MINGW32__ | |
| #define TORRENT_MINGW | | #define TORRENT_MINGW | |
| #define TORRENT_WINDOWS | | #define TORRENT_WINDOWS | |
| #ifndef TORRENT_USE_ICONV | | #ifndef TORRENT_USE_ICONV | |
| #define TORRENT_USE_ICONV 0 | | #define TORRENT_USE_ICONV 0 | |
| #define TORRENT_USE_LOCALE 1 | | #define TORRENT_USE_LOCALE 1 | |
| #endif | | #endif | |
| #define TORRENT_USE_RLIMIT 0 | | #define TORRENT_USE_RLIMIT 0 | |
| | | | |
| skipping to change at line 339 | | skipping to change at line 347 | |
| #endif | | #endif | |
| | | | |
| #ifndef TORRENT_USE_GETADAPTERSADDRESSES | | #ifndef TORRENT_USE_GETADAPTERSADDRESSES | |
| #define TORRENT_USE_GETADAPTERSADDRESSES 0 | | #define TORRENT_USE_GETADAPTERSADDRESSES 0 | |
| #endif | | #endif | |
| | | | |
| #ifndef TORRENT_USE_NETLINK | | #ifndef TORRENT_USE_NETLINK | |
| #define TORRENT_USE_NETLINK 0 | | #define TORRENT_USE_NETLINK 0 | |
| #endif | | #endif | |
| | | | |
|
| | | #ifndef TORRENT_USE_EXECINFO | |
| | | #define TORRENT_USE_EXECINFO 0 | |
| | | #endif | |
| | | | |
| #ifndef TORRENT_USE_SYSCTL | | #ifndef TORRENT_USE_SYSCTL | |
| #define TORRENT_USE_SYSCTL 0 | | #define TORRENT_USE_SYSCTL 0 | |
| #endif | | #endif | |
| | | | |
| #ifndef TORRENT_USE_GETIPFORWARDTABLE | | #ifndef TORRENT_USE_GETIPFORWARDTABLE | |
| #define TORRENT_USE_GETIPFORWARDTABLE 0 | | #define TORRENT_USE_GETIPFORWARDTABLE 0 | |
| #endif | | #endif | |
| | | | |
| #ifndef TORRENT_USE_LOCALE | | #ifndef TORRENT_USE_LOCALE | |
| #define TORRENT_USE_LOCALE 0 | | #define TORRENT_USE_LOCALE 0 | |
| | | | |
End of changes. 4 change blocks. |
| 1 lines changed or deleted | | 13 lines changed or added | |
|
| create_torrent.hpp | | create_torrent.hpp | |
| | | | |
| skipping to change at line 238 | | skipping to change at line 238 | |
| #endif | | #endif | |
| | | | |
| inline void set_piece_hashes(create_torrent& t, std::string const& p
, error_code& ec) | | inline void set_piece_hashes(create_torrent& t, std::string const& p
, error_code& ec) | |
| { | | { | |
| set_piece_hashes(t, p, detail::nop, ec); | | set_piece_hashes(t, p, detail::nop, ec); | |
| } | | } | |
| | | | |
| #if TORRENT_USE_WSTRING | | #if TORRENT_USE_WSTRING | |
| // wstring versions | | // wstring versions | |
| | | | |
|
| | | // all wstring APIs are deprecated since 0.16.11 | |
| | | // instead, use the wchar -> utf8 conversion functions | |
| | | // and pass in utf8 strings | |
| | | #ifndef TORRENT_NO_DEPRECATE | |
| | | | |
| template <class Pred> | | template <class Pred> | |
|
| void add_files(file_storage& fs, std::wstring const& wfile, Pred p, | | TORRENT_DEPRECATED_PREFIX | |
| boost::uint32_t flags = 0) | | void TORRENT_DEPRECATED add_files(file_storage& fs, std::wstring con | |
| | | st& wfile, Pred p, boost::uint32_t flags = 0) | |
| { | | { | |
| std::string utf8; | | std::string utf8; | |
| wchar_utf8(wfile, utf8); | | wchar_utf8(wfile, utf8); | |
| detail::add_files_impl(fs, parent_path(complete(utf8)) | | detail::add_files_impl(fs, parent_path(complete(utf8)) | |
| , filename(utf8), p, flags); | | , filename(utf8), p, flags); | |
| } | | } | |
| | | | |
|
| inline void add_files(file_storage& fs, std::wstring const& wfile, b | | TORRENT_DEPRECATED_PREFIX | |
| oost::uint32_t flags = 0) | | inline void TORRENT_DEPRECATED add_files(file_storage& fs, std::wstr | |
| | | ing const& wfile, boost::uint32_t flags = 0) | |
| { | | { | |
| std::string utf8; | | std::string utf8; | |
| wchar_utf8(wfile, utf8); | | wchar_utf8(wfile, utf8); | |
| detail::add_files_impl(fs, parent_path(complete(utf8)) | | detail::add_files_impl(fs, parent_path(complete(utf8)) | |
| , filename(utf8), detail::default_pred, flags); | | , filename(utf8), detail::default_pred, flags); | |
| } | | } | |
| | | | |
| void TORRENT_EXPORT set_piece_hashes(create_torrent& t, std::wstring
const& p | | void TORRENT_EXPORT set_piece_hashes(create_torrent& t, std::wstring
const& p | |
| , boost::function<void(int)> const& f, error_code& ec); | | , boost::function<void(int)> const& f, error_code& ec); | |
| | | | |
| #ifndef BOOST_NO_EXCEPTIONS | | #ifndef BOOST_NO_EXCEPTIONS | |
| template <class Fun> | | template <class Fun> | |
|
| void set_piece_hashes(create_torrent& t, std::wstring const& p, Fun | | TORRENT_DEPRECATED_PREFIX | |
| f) | | void TORRENT_DEPRECATED set_piece_hashes(create_torrent& t, std::wst | |
| | | ring const& p, Fun f) | |
| { | | { | |
| error_code ec; | | error_code ec; | |
| set_piece_hashes(t, p, f, ec); | | set_piece_hashes(t, p, f, ec); | |
| if (ec) throw libtorrent_exception(ec); | | if (ec) throw libtorrent_exception(ec); | |
| } | | } | |
| | | | |
|
| inline void set_piece_hashes(create_torrent& t, std::wstring const& | | TORRENT_DEPRECATED_PREFIX | |
| p) | | inline void TORRENT_DEPRECATED set_piece_hashes(create_torrent& t, s | |
| | | td::wstring const& p) | |
| { | | { | |
| error_code ec; | | error_code ec; | |
| set_piece_hashes(t, p, detail::nop, ec); | | set_piece_hashes(t, p, detail::nop, ec); | |
| if (ec) throw libtorrent_exception(ec); | | if (ec) throw libtorrent_exception(ec); | |
| } | | } | |
| #endif | | #endif | |
| | | | |
|
| inline void set_piece_hashes(create_torrent& t, std::wstring const& | | TORRENT_DEPRECATED_PREFIX | |
| p, error_code& ec) | | inline void TORRENT_DEPRECATED set_piece_hashes(create_torrent& t, s | |
| | | td::wstring const& p, error_code& ec) | |
| { | | { | |
| set_piece_hashes(t, p, detail::nop, ec); | | set_piece_hashes(t, p, detail::nop, ec); | |
| } | | } | |
|
| | | #endif // TORRENT_NO_DEPRECATE | |
| #endif // TORRENT_USE_WPATH | | #endif // TORRENT_USE_WSTRING | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 7 change blocks. |
| 12 lines changed or deleted | | 22 lines changed or added | |
|
| file_storage.hpp | | file_storage.hpp | |
| | | | |
| skipping to change at line 189 | | skipping to change at line 189 | |
| void reserve(int num_files); | | void reserve(int num_files); | |
| | | | |
| void add_file(file_entry const& e, char const* filehash = 0)
; | | void add_file(file_entry const& e, char const* filehash = 0)
; | |
| | | | |
| void add_file(std::string const& p, size_type size, int flag
s = 0 | | void add_file(std::string const& p, size_type size, int flag
s = 0 | |
| , std::time_t mtime = 0, std::string const& s_p = ""
); | | , std::time_t mtime = 0, std::string const& s_p = ""
); | |
| | | | |
| void rename_file(int index, std::string const& new_filename)
; | | void rename_file(int index, std::string const& new_filename)
; | |
| | | | |
| #if TORRENT_USE_WSTRING | | #if TORRENT_USE_WSTRING | |
|
| | | // all wstring APIs are deprecated since 0.16.11 | |
| | | // instead, use the wchar -> utf8 conversion functions | |
| | | // and pass in utf8 strings | |
| | | #ifndef TORRENT_NO_DEPRECATE | |
| | | TORRENT_DEPRECATED_PREFIX | |
| void add_file(std::wstring const& p, size_type size, int fla
gs = 0 | | void add_file(std::wstring const& p, size_type size, int fla
gs = 0 | |
|
| , std::time_t mtime = 0, std::string const& s_p = "" | | , std::time_t mtime = 0, std::string const& s_p = "" | |
| ); | | ) TORRENT_DEPRECATED; | |
| void rename_file(int index, std::wstring const& new_filename | | TORRENT_DEPRECATED_PREFIX | |
| ); | | void rename_file(int index, std::wstring const& new_filename | |
| void set_name(std::wstring const& n); | | ) TORRENT_DEPRECATED; | |
| #endif | | TORRENT_DEPRECATED_PREFIX | |
| | | void set_name(std::wstring const& n) TORRENT_DEPRECATED; | |
| | | #endif // TORRENT_NO_DEPRECATE | |
| | | #endif // TORRENT_USE_WSTRING | |
| | | | |
| std::vector<file_slice> map_block(int piece, size_type offse
t | | std::vector<file_slice> map_block(int piece, size_type offse
t | |
| , int size) const; | | , int size) const; | |
| peer_request map_file(int file, size_type offset, int size)
const; | | peer_request map_file(int file, size_type offset, int size)
const; | |
| | | | |
| typedef std::vector<internal_file_entry>::const_iterator ite
rator; | | typedef std::vector<internal_file_entry>::const_iterator ite
rator; | |
| typedef std::vector<internal_file_entry>::const_reverse_iter
ator reverse_iterator; | | typedef std::vector<internal_file_entry>::const_reverse_iter
ator reverse_iterator; | |
| | | | |
| iterator file_at_offset(size_type offset) const; | | iterator file_at_offset(size_type offset) const; | |
| iterator begin() const { return m_files.begin(); } | | iterator begin() const { return m_files.begin(); } | |
| | | | |
End of changes. 2 change blocks. |
| 6 lines changed or deleted | | 14 lines changed or added | |
|
| peer_connection.hpp | | peer_connection.hpp | |
| | | | |
| skipping to change at line 613 | | skipping to change at line 613 | |
| bool piece_failed; | | bool piece_failed; | |
| #endif | | #endif | |
| | | | |
| time_t last_seen_complete() const { return m_last_seen_compl
ete; } | | time_t last_seen_complete() const { return m_last_seen_compl
ete; } | |
| void set_last_seen_complete(int ago) { m_last_seen_complete
= time(0) - ago; } | | void set_last_seen_complete(int ago) { m_last_seen_complete
= time(0) - ago; } | |
| | | | |
| // upload and download channel state | | // upload and download channel state | |
| // enum from peer_info::bw_state | | // enum from peer_info::bw_state | |
| char m_channel_state[2]; | | char m_channel_state[2]; | |
| | | | |
|
| size_type uploaded_since_unchoke() const | | size_type uploaded_in_last_round() const | |
| { return m_statistics.total_payload_upload() - m_uploaded_at | | { return m_statistics.total_payload_upload() - m_uploaded_at | |
| _last_unchoke; } | | _last_round; } | |
| | | | |
| | | size_type downloaded_in_last_round() const | |
| | | { return m_statistics.total_payload_download() - m_downloade | |
| | | d_at_last_round; } | |
| | | | |
|
| size_type downloaded_since_unchoke() const | | size_type uploaded_since_unchoked() const | |
| { return m_statistics.total_payload_download() - m_downloade | | { return m_statistics.total_payload_upload() - m_uploaded_at | |
| d_at_last_unchoke; } | | _last_unchoke; } | |
| | | | |
| // called when the disk write buffer is drained again, and w
e can | | // called when the disk write buffer is drained again, and w
e can | |
| // start downloading payload again | | // start downloading payload again | |
| void on_disk(); | | void on_disk(); | |
| | | | |
| int num_reading_bytes() const { return m_reading_bytes; } | | int num_reading_bytes() const { return m_reading_bytes; } | |
| | | | |
| enum sync_t { read_async, read_sync }; | | enum sync_t { read_async, read_sync }; | |
| void setup_receive(sync_t sync = read_sync); | | void setup_receive(sync_t sync = read_sync); | |
| | | | |
| | | | |
| skipping to change at line 833 | | skipping to change at line 836 | |
| | | | |
| // the amount of data this peer has been given | | // the amount of data this peer has been given | |
| // as free upload. This is distributed from | | // as free upload. This is distributed from | |
| // peers from which we get free download | | // peers from which we get free download | |
| // this will be negative on a peer from which | | // this will be negative on a peer from which | |
| // we get free download, and positive on peers | | // we get free download, and positive on peers | |
| // that we give the free upload, to keep the balance. | | // that we give the free upload, to keep the balance. | |
| size_type m_free_upload; | | size_type m_free_upload; | |
| | | | |
| // the total payload download bytes | | // the total payload download bytes | |
|
| // at the last unchoke cycle. This is used to | | // at the last unchoke round. This is used to | |
| // measure the number of bytes transferred during | | // measure the number of bytes transferred during | |
| // an unchoke cycle, to unchoke peers the more bytes | | // an unchoke cycle, to unchoke peers the more bytes | |
| // they sent us | | // they sent us | |
|
| size_type m_downloaded_at_last_unchoke; | | size_type m_downloaded_at_last_round; | |
| | | size_type m_uploaded_at_last_round; | |
| | | | |
| | | // this is the number of bytes we had uploaded the | |
| | | // last time this peer was unchoked. This does not | |
| | | // reset each unchoke interval/round. This is used to | |
| | | // track upload across rounds, for the full duration of | |
| | | // the peer being unchoked. Specifically, it's used | |
| | | // for the round-robin unchoke algorithm. | |
| size_type m_uploaded_at_last_unchoke; | | size_type m_uploaded_at_last_unchoke; | |
| | | | |
| #ifndef TORRENT_DISABLE_GEO_IP | | #ifndef TORRENT_DISABLE_GEO_IP | |
| std::string m_inet_as_name; | | std::string m_inet_as_name; | |
| #endif | | #endif | |
| | | | |
| buffer m_recv_buffer; | | buffer m_recv_buffer; | |
| | | | |
| // if this peer is receiving a piece, this | | // if this peer is receiving a piece, this | |
| // points to a disk buffer that the data is | | // points to a disk buffer that the data is | |
| | | | |
| skipping to change at line 890 | | skipping to change at line 901 | |
| std::vector<pending_block> m_request_queue; | | std::vector<pending_block> m_request_queue; | |
| | | | |
| // the queue of blocks we have requested | | // the queue of blocks we have requested | |
| // from this peer | | // from this peer | |
| std::vector<pending_block> m_download_queue; | | std::vector<pending_block> m_download_queue; | |
| | | | |
| // the pieces we will send to the peer | | // the pieces we will send to the peer | |
| // if requested (regardless of choke state) | | // if requested (regardless of choke state) | |
| std::vector<int> m_accept_fast; | | std::vector<int> m_accept_fast; | |
| | | | |
|
| | | // a sent-piece counter for the allowed fast set | |
| | | // to avoid exploitation. Each slot is a counter | |
| | | // for one of the pieces from the allowed-fast set | |
| | | std::vector<boost::uint16_t> m_accept_fast_piece_cnt; | |
| | | | |
| // the pieces the peer will send us if | | // the pieces the peer will send us if | |
| // requested (regardless of choke state) | | // requested (regardless of choke state) | |
| std::vector<int> m_allowed_fast; | | std::vector<int> m_allowed_fast; | |
| | | | |
| // pieces that has been suggested to be | | // pieces that has been suggested to be | |
| // downloaded from this peer | | // downloaded from this peer | |
| std::vector<int> m_suggested_pieces; | | std::vector<int> m_suggested_pieces; | |
| | | | |
| // a list of byte offsets inside the send buffer | | // a list of byte offsets inside the send buffer | |
| // the piece requests | | // the piece requests | |
| | | | |
End of changes. 5 change blocks. |
| 8 lines changed or deleted | | 25 lines changed or added | |
|
| session.hpp | | session.hpp | |
| | | | |
| skipping to change at line 295 | | skipping to change at line 295 | |
| #ifndef TORRENT_DISABLE_EXTENSIONS | | #ifndef TORRENT_DISABLE_EXTENSIONS | |
| void add_extension(boost::function<boost::shared_ptr<torrent
_plugin>(torrent*, void*)> ext); | | void add_extension(boost::function<boost::shared_ptr<torrent
_plugin>(torrent*, void*)> ext); | |
| void add_extension(boost::shared_ptr<plugin> ext); | | void add_extension(boost::shared_ptr<plugin> ext); | |
| #endif | | #endif | |
| | | | |
| #ifndef TORRENT_DISABLE_GEO_IP | | #ifndef TORRENT_DISABLE_GEO_IP | |
| int as_for_ip(address const& addr); | | int as_for_ip(address const& addr); | |
| void load_asnum_db(char const* file); | | void load_asnum_db(char const* file); | |
| void load_country_db(char const* file); | | void load_country_db(char const* file); | |
| #if TORRENT_USE_WSTRING | | #if TORRENT_USE_WSTRING | |
|
| void load_country_db(wchar_t const* file); | | // all wstring APIs are deprecated since 0.16.11 | |
| void load_asnum_db(wchar_t const* file); | | // instead, use the wchar -> utf8 conversion functions | |
| #endif | | // and pass in utf8 strings | |
| #endif | | #ifndef TORRENT_NO_DEPRECATE | |
| | | TORRENT_DEPRECATED_PREFIX | |
| | | void load_country_db(wchar_t const* file) TORRENT_DEPRECATED | |
| | | ; | |
| | | TORRENT_DEPRECATED_PREFIX | |
| | | void load_asnum_db(wchar_t const* file) TORRENT_DEPRECATED; | |
| | | #endif // TORRENT_NO_DEPRECATE | |
| | | #endif // TORRENT_USE_WSTRING | |
| | | #endif // TORRENT_DISABLE_GEO_IP | |
| | | | |
| #ifndef TORRENT_NO_DEPRECATE | | #ifndef TORRENT_NO_DEPRECATE | |
| // deprecated in 0.15 | | // deprecated in 0.15 | |
| // use load_state and save_state instead | | // use load_state and save_state instead | |
| TORRENT_DEPRECATED_PREFIX | | TORRENT_DEPRECATED_PREFIX | |
| void load_state(entry const& ses_state) TORRENT_DEPRECATED; | | void load_state(entry const& ses_state) TORRENT_DEPRECATED; | |
| TORRENT_DEPRECATED_PREFIX | | TORRENT_DEPRECATED_PREFIX | |
| entry state() const TORRENT_DEPRECATED; | | entry state() const TORRENT_DEPRECATED; | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 356 | | skipping to change at line 363 | |
| #endif | | #endif | |
| | | | |
| void listen_on( | | void listen_on( | |
| std::pair<int, int> const& port_range | | std::pair<int, int> const& port_range | |
| , error_code& ec | | , error_code& ec | |
| , const char* net_interface = 0 | | , const char* net_interface = 0 | |
| , int flags = 0); | | , int flags = 0); | |
| | | | |
| // returns the port we ended up listening on | | // returns the port we ended up listening on | |
| unsigned short listen_port() const; | | unsigned short listen_port() const; | |
|
| | | unsigned short ssl_listen_port() const; | |
| | | | |
| enum options_t | | enum options_t | |
| { | | { | |
| none = 0, | | none = 0, | |
| delete_files = 1 | | delete_files = 1 | |
| }; | | }; | |
| | | | |
| enum session_flags_t | | enum session_flags_t | |
| { | | { | |
| add_default_plugins = 1, | | add_default_plugins = 1, | |
| | | | |
End of changes. 2 change blocks. |
| 4 lines changed or deleted | | 13 lines changed or added | |
|
| torrent.hpp | | torrent.hpp | |
| | | | |
| skipping to change at line 126 | | skipping to change at line 126 | |
| , int block_size, int seq, add_torrent_params const&
p | | , int block_size, int seq, add_torrent_params const&
p | |
| , sha1_hash const& info_hash); | | , sha1_hash const& info_hash); | |
| ~torrent(); | | ~torrent(); | |
| | | | |
| #ifndef TORRENT_DISABLE_ENCRYPTION | | #ifndef TORRENT_DISABLE_ENCRYPTION | |
| sha1_hash const& obfuscated_hash() const | | sha1_hash const& obfuscated_hash() const | |
| { return m_obfuscated_hash; } | | { return m_obfuscated_hash; } | |
| #endif | | #endif | |
| | | | |
| sha1_hash const& info_hash() const | | sha1_hash const& info_hash() const | |
|
| { return m_torrent_file->info_hash(); } | | { | |
| | | static sha1_hash empty; | |
| | | return m_torrent_file ? m_torrent_file->info_hash() | |
| | | : empty; | |
| | | } | |
| | | | |
| // starts the announce timer | | // starts the announce timer | |
| void start(); | | void start(); | |
| | | | |
| void start_download_url(); | | void start_download_url(); | |
| | | | |
| #ifndef TORRENT_DISABLE_EXTENSIONS | | #ifndef TORRENT_DISABLE_EXTENSIONS | |
| void add_extension(boost::shared_ptr<torrent_plugin>); | | void add_extension(boost::shared_ptr<torrent_plugin>); | |
| void add_extension(boost::function<boost::shared_ptr<torrent
_plugin>(torrent*, void*)> const& ext | | void add_extension(boost::function<boost::shared_ptr<torrent
_plugin>(torrent*, void*)> const& ext | |
| , void* userdata); | | , void* userdata); | |
| | | | |
| skipping to change at line 828 | | skipping to change at line 831 | |
| void clear_in_state_update() | | void clear_in_state_update() | |
| { m_in_state_updates = false; } | | { m_in_state_updates = false; } | |
| | | | |
| void inc_num_connecting() | | void inc_num_connecting() | |
| { ++m_num_connecting; } | | { ++m_num_connecting; } | |
| void dec_num_connecting() | | void dec_num_connecting() | |
| { | | { | |
| TORRENT_ASSERT(m_num_connecting > 0); | | TORRENT_ASSERT(m_num_connecting > 0); | |
| --m_num_connecting; | | --m_num_connecting; | |
| } | | } | |
|
| | | | |
| | | bool is_ssl_torrent() const { return m_ssl_torrent; } | |
| #ifdef TORRENT_USE_OPENSSL | | #ifdef TORRENT_USE_OPENSSL | |
| void set_ssl_cert(std::string const& certificate | | void set_ssl_cert(std::string const& certificate | |
| , std::string const& private_key | | , std::string const& private_key | |
| , std::string const& dh_params | | , std::string const& dh_params | |
| , std::string const& passphrase); | | , std::string const& passphrase); | |
|
| bool is_ssl_torrent() const { return m_ssl_ctx; } | | | |
| boost::asio::ssl::context* ssl_ctx() const { return m_ssl_ct
x.get(); } | | boost::asio::ssl::context* ssl_ctx() const { return m_ssl_ct
x.get(); } | |
| #endif | | #endif | |
| | | | |
| private: | | private: | |
| | | | |
| void on_files_deleted(int ret, disk_io_job const& j); | | void on_files_deleted(int ret, disk_io_job const& j); | |
| void on_files_released(int ret, disk_io_job const& j); | | void on_files_released(int ret, disk_io_job const& j); | |
| void on_torrent_paused(int ret, disk_io_job const& j); | | void on_torrent_paused(int ret, disk_io_job const& j); | |
| void on_storage_moved(int ret, disk_io_job const& j); | | void on_storage_moved(int ret, disk_io_job const& j); | |
| void on_save_resume_data(int ret, disk_io_job const& j); | | void on_save_resume_data(int ret, disk_io_job const& j); | |
| | | | |
| skipping to change at line 897 | | skipping to change at line 901 | |
| // if this torrent is running, this was the time | | // if this torrent is running, this was the time | |
| // when it was started. This is used to have a | | // when it was started. This is used to have a | |
| // bias towards keeping seeding torrents that | | // bias towards keeping seeding torrents that | |
| // recently was started, to avoid oscillation | | // recently was started, to avoid oscillation | |
| ptime m_started; | | ptime m_started; | |
| | | | |
| boost::intrusive_ptr<torrent_info> m_torrent_file; | | boost::intrusive_ptr<torrent_info> m_torrent_file; | |
| | | | |
| // if this pointer is 0, the torrent is in | | // if this pointer is 0, the torrent is in | |
| // a state where the metadata hasn't been | | // a state where the metadata hasn't been | |
|
| // received yet. | | // received yet, or during shutdown. | |
| // the piece_manager keeps the torrent object | | // the piece_manager keeps the torrent object | |
| // alive by holding a shared_ptr to it and | | // alive by holding a shared_ptr to it and | |
| // the torrent keeps the piece manager alive | | // the torrent keeps the piece manager alive | |
| // with this intrusive_ptr. This cycle is | | // with this intrusive_ptr. This cycle is | |
| // broken when torrent::abort() is called | | // broken when torrent::abort() is called | |
| // Then the torrent releases the piece_manager | | // Then the torrent releases the piece_manager | |
| // and when the piece_manager is complete with all | | // and when the piece_manager is complete with all | |
| // outstanding disk io jobs (that keeps | | // outstanding disk io jobs (that keeps | |
| // the piece_manager alive) it will destruct | | // the piece_manager alive) it will destruct | |
| // and release the torrent file. The reason for | | // and release the torrent file. The reason for | |
| | | | |
| skipping to change at line 1335 | | skipping to change at line 1339 | |
| // state subscription. If set, a pointer to this torrent | | // state subscription. If set, a pointer to this torrent | |
| // will be added to the m_state_updates set in session_impl | | // will be added to the m_state_updates set in session_impl | |
| // whenever this torrent's state changes (any state). | | // whenever this torrent's state changes (any state). | |
| bool m_state_subscription:1; | | bool m_state_subscription:1; | |
| | | | |
| // in state_updates list. When adding a torrent to the | | // in state_updates list. When adding a torrent to the | |
| // session_impl's m_state_update list, this bit is set | | // session_impl's m_state_update list, this bit is set | |
| // to never add the same torrent twice | | // to never add the same torrent twice | |
| bool m_in_state_updates:1; | | bool m_in_state_updates:1; | |
| | | | |
|
| | | // even if we're not built to support SSL torrents, | |
| | | // remember that this is an SSL torrent, so that we don't | |
| | | // accidentally start seeding it without any authentication. | |
| | | bool m_ssl_torrent:1; | |
| | | | |
| #if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS | | #if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS | |
| public: | | public: | |
| // set to false until we've loaded resume data | | // set to false until we've loaded resume data | |
| bool m_resume_data_loaded; | | bool m_resume_data_loaded; | |
| #endif | | #endif | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif // TORRENT_TORRENT_HPP_INCLUDED | | #endif // TORRENT_TORRENT_HPP_INCLUDED | |
| | | | |
End of changes. 5 change blocks. |
| 3 lines changed or deleted | | 13 lines changed or added | |
|
| torrent_info.hpp | | torrent_info.hpp | |
| | | | |
| skipping to change at line 242 | | skipping to change at line 242 | |
| | | | |
| #ifdef TORRENT_DEBUG | | #ifdef TORRENT_DEBUG | |
| void check_invariant() const; | | void check_invariant() const; | |
| #endif | | #endif | |
| | | | |
| #ifndef BOOST_NO_EXCEPTIONS | | #ifndef BOOST_NO_EXCEPTIONS | |
| torrent_info(lazy_entry const& torrent_file, int flags = 0); | | torrent_info(lazy_entry const& torrent_file, int flags = 0); | |
| torrent_info(char const* buffer, int size, int flags = 0); | | torrent_info(char const* buffer, int size, int flags = 0); | |
| torrent_info(std::string const& filename, int flags = 0); | | torrent_info(std::string const& filename, int flags = 0); | |
| #if TORRENT_USE_WSTRING | | #if TORRENT_USE_WSTRING | |
|
| torrent_info(std::wstring const& filename, int flags = 0); | | // all wstring APIs are deprecated since 0.16.11 | |
| | | // instead, use the wchar -> utf8 conversion functions | |
| | | // and pass in utf8 strings | |
| | | #ifndef TORRENT_NO_DEPRECATE | |
| | | TORRENT_DEPRECATED_PREFIX | |
| | | torrent_info(std::wstring const& filename, int flags = 0) TO | |
| | | RRENT_DEPRECATED; | |
| | | #endif // TORRENT_NO_DEPRECATE | |
| #endif // TORRENT_USE_WSTRING | | #endif // TORRENT_USE_WSTRING | |
| #endif | | #endif | |
| | | | |
| torrent_info(torrent_info const& t, int flags = 0); | | torrent_info(torrent_info const& t, int flags = 0); | |
| torrent_info(sha1_hash const& info_hash, int flags = 0); | | torrent_info(sha1_hash const& info_hash, int flags = 0); | |
| torrent_info(lazy_entry const& torrent_file, error_code& ec,
int flags = 0); | | torrent_info(lazy_entry const& torrent_file, error_code& ec,
int flags = 0); | |
| torrent_info(char const* buffer, int size, error_code& ec, i
nt flags = 0); | | torrent_info(char const* buffer, int size, error_code& ec, i
nt flags = 0); | |
| torrent_info(std::string const& filename, error_code& ec, in
t flags = 0); | | torrent_info(std::string const& filename, error_code& ec, in
t flags = 0); | |
| #if TORRENT_USE_WSTRING | | #if TORRENT_USE_WSTRING | |
|
| torrent_info(std::wstring const& filename, error_code& ec, i | | // all wstring APIs are deprecated since 0.16.11 | |
| nt flags = 0); | | // instead, use the wchar -> utf8 conversion functions | |
| | | // and pass in utf8 strings | |
| | | #ifndef TORRENT_NO_DEPRECATE | |
| | | TORRENT_DEPRECATED_PREFIX | |
| | | torrent_info(std::wstring const& filename, error_code& ec, i | |
| | | nt flags = 0) TORRENT_DEPRECATED; | |
| | | #endif // TORRENT_NO_DEPRECATE | |
| #endif // TORRENT_USE_WSTRING | | #endif // TORRENT_USE_WSTRING | |
| | | | |
| ~torrent_info(); | | ~torrent_info(); | |
| | | | |
| file_storage const& files() const { return m_files; } | | file_storage const& files() const { return m_files; } | |
| file_storage const& orig_files() const { return m_orig_files
? *m_orig_files : m_files; } | | file_storage const& orig_files() const { return m_orig_files
? *m_orig_files : m_files; } | |
| | | | |
| void rename_file(int index, std::string const& new_filename) | | void rename_file(int index, std::string const& new_filename) | |
| { | | { | |
| copy_on_write(); | | copy_on_write(); | |
| m_files.rename_file(index, new_filename); | | m_files.rename_file(index, new_filename); | |
| } | | } | |
| | | | |
| #if TORRENT_USE_WSTRING | | #if TORRENT_USE_WSTRING | |
|
| void rename_file(int index, std::wstring const& new_filename | | // all wstring APIs are deprecated since 0.16.11 | |
| ) | | // instead, use the wchar -> utf8 conversion functions | |
| | | // and pass in utf8 strings | |
| | | #ifndef TORRENT_NO_DEPRECATE | |
| | | TORRENT_DEPRECATED_PREFIX | |
| | | void rename_file(int index, std::wstring const& new_filename | |
| | | ) TORRENT_DEPRECATED | |
| { | | { | |
| copy_on_write(); | | copy_on_write(); | |
| m_files.rename_file(index, new_filename); | | m_files.rename_file(index, new_filename); | |
| } | | } | |
|
| | | #endif // TORRENT_NO_DEPRECATE | |
| #endif // TORRENT_USE_WSTRING | | #endif // TORRENT_USE_WSTRING | |
| | | | |
| void remap_files(file_storage const& f); | | void remap_files(file_storage const& f); | |
| | | | |
| void add_tracker(std::string const& url, int tier = 0); | | void add_tracker(std::string const& url, int tier = 0); | |
| std::vector<announce_entry> const& trackers() const { return
m_urls; } | | std::vector<announce_entry> const& trackers() const { return
m_urls; } | |
| | | | |
| #ifndef TORRENT_NO_DEPRECATE | | #ifndef TORRENT_NO_DEPRECATE | |
| // deprecated in 0.16. Use web_seeds() instead | | // deprecated in 0.16. Use web_seeds() instead | |
| TORRENT_DEPRECATED_PREFIX | | TORRENT_DEPRECATED_PREFIX | |
| | | | |
| skipping to change at line 333 | | skipping to change at line 351 | |
| // these functions will be removed in a future version | | // these functions will be removed in a future version | |
| TORRENT_DEPRECATED_PREFIX | | TORRENT_DEPRECATED_PREFIX | |
| torrent_info(entry const& torrent_file) TORRENT_DEPRECATED; | | torrent_info(entry const& torrent_file) TORRENT_DEPRECATED; | |
| TORRENT_DEPRECATED_PREFIX | | TORRENT_DEPRECATED_PREFIX | |
| void print(std::ostream& os) const TORRENT_DEPRECATED; | | void print(std::ostream& os) const TORRENT_DEPRECATED; | |
| // ------- end deprecation ------- | | // ------- end deprecation ------- | |
| #endif | | #endif | |
| | | | |
| #ifdef TORRENT_USE_OPENSSL | | #ifdef TORRENT_USE_OPENSSL | |
| std::string const& ssl_cert() const { return m_ssl_root_cert
; } | | std::string const& ssl_cert() const { return m_ssl_root_cert
; } | |
|
| | | #else | |
| | | std::string ssl_cert() const | |
| | | { | |
| | | if (m_info_dict.type() != lazy_entry::dict_t) return | |
| | | ""; | |
| | | return m_info_dict.dict_find_string_value("ssl-cert" | |
| | | ); | |
| | | } | |
| #endif | | #endif | |
| | | | |
| bool is_valid() const { return m_files.is_valid(); } | | bool is_valid() const { return m_files.is_valid(); } | |
| | | | |
| bool priv() const { return m_private; } | | bool priv() const { return m_private; } | |
| | | | |
| bool is_i2p() const { return m_i2p; } | | bool is_i2p() const { return m_i2p; } | |
| | | | |
| int piece_size(int index) const { return m_files.piece_size(
index); } | | int piece_size(int index) const { return m_files.piece_size(
index); } | |
| | | | |
| | | | |
End of changes. 5 change blocks. |
| 5 lines changed or deleted | | 32 lines changed or added | |
|
| udp_socket.hpp | | udp_socket.hpp | |
| | | | |
| skipping to change at line 85 | | skipping to change at line 85 | |
| void send_hostname(char const* hostname, int port, char cons
t* p, int len, error_code& ec); | | void send_hostname(char const* hostname, int port, char cons
t* p, int len, error_code& ec); | |
| | | | |
| void send(udp::endpoint const& ep, char const* p, int len, e
rror_code& ec, int flags = 0); | | void send(udp::endpoint const& ep, char const* p, int len, e
rror_code& ec, int flags = 0); | |
| void bind(udp::endpoint const& ep, error_code& ec); | | void bind(udp::endpoint const& ep, error_code& ec); | |
| void bind(int port); | | void bind(int port); | |
| void close(); | | void close(); | |
| int local_port() const { return m_bind_port; } | | int local_port() const { return m_bind_port; } | |
| | | | |
| void set_proxy_settings(proxy_settings const& ps); | | void set_proxy_settings(proxy_settings const& ps); | |
| proxy_settings const& get_proxy_settings() { return m_proxy_
settings; } | | proxy_settings const& get_proxy_settings() { return m_proxy_
settings; } | |
|
| | | void set_force_proxy(bool f) { m_force_proxy = f; } | |
| | | | |
| bool is_closed() const { return m_abort; } | | bool is_closed() const { return m_abort; } | |
| tcp::endpoint local_endpoint(error_code& ec) const | | tcp::endpoint local_endpoint(error_code& ec) const | |
| { | | { | |
| udp::endpoint ep = m_ipv4_sock.local_endpoint(ec); | | udp::endpoint ep = m_ipv4_sock.local_endpoint(ec); | |
| return tcp::endpoint(ep.address(), ep.port()); | | return tcp::endpoint(ep.address(), ep.port()); | |
| } | | } | |
| | | | |
| void set_buf_size(int s); | | void set_buf_size(int s); | |
| | | | |
| | | | |
| skipping to change at line 160 | | skipping to change at line 161 | |
| 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(); | | void socks_forward_udp(); | |
| 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 hung_up(error_code const& e); | |
| | | | |
|
| | | void drain_queue(); | |
| | | | |
| 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 wrap(char const* hostname, int port, char const* p, int
len, error_code& ec); | | void wrap(char const* hostname, int port, char const* p, int
len, error_code& ec); | |
| void unwrap(error_code const& e, char const* buf, int size); | | void unwrap(error_code const& e, char const* buf, int size); | |
| | | | |
| void maybe_realloc_buffers(int which = 3); | | void maybe_realloc_buffers(int which = 3); | |
| bool maybe_clear_callback(); | | bool maybe_clear_callback(); | |
| | | | |
| #if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS | | #if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS | |
| #if defined BOOST_HAS_PTHREADS | | #if defined BOOST_HAS_PTHREADS | |
| mutable pthread_t m_thread; | | mutable pthread_t m_thread; | |
| | | | |
| skipping to change at line 218 | | skipping to change at line 221 | |
| #endif | | #endif | |
| | | | |
| tcp::socket m_socks5_sock; | | tcp::socket m_socks5_sock; | |
| int m_connection_ticket; | | int m_connection_ticket; | |
| proxy_settings m_proxy_settings; | | proxy_settings m_proxy_settings; | |
| connection_queue& m_cc; | | connection_queue& m_cc; | |
| tcp::resolver m_resolver; | | tcp::resolver m_resolver; | |
| char m_tmp_buf[270]; | | char m_tmp_buf[270]; | |
| bool m_queue_packets; | | bool m_queue_packets; | |
| bool m_tunnel_packets; | | bool m_tunnel_packets; | |
|
| | | bool m_force_proxy; | |
| bool m_abort; | | bool m_abort; | |
|
| | | | |
| | | // this is the endpoint the proxy server lives at. | |
| | | // when performing a UDP associate, we get another | |
| | | // endpoint (presumably on the same IP) where we're | |
| | | // supposed to send UDP packets. | |
| udp::endpoint m_proxy_addr; | | udp::endpoint m_proxy_addr; | |
|
| | | | |
| | | // this is where UDP packets that are to be forwarded | |
| | | // are sent. The result from UDP ASSOCIATE is stored | |
| | | // in here. | |
| | | udp::endpoint m_udp_proxy_addr; | |
| | | | |
| // while we're connecting to the proxy | | // while we're connecting to the proxy | |
| // we have to queue the packets, we'll flush | | // we have to queue the packets, we'll flush | |
| // them once we're connected | | // them once we're connected | |
| std::deque<queued_packet> m_queue; | | std::deque<queued_packet> m_queue; | |
| | | | |
| // counts the number of outstanding async | | // counts the number of outstanding async | |
| // operations hanging on this socket | | // operations hanging on this socket | |
| int m_outstanding_ops; | | int m_outstanding_ops; | |
| | | | |
| #if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS | | #if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS | |
| | | | |
End of changes. 5 change blocks. |
| 0 lines changed or deleted | | 15 lines changed or added | |
|