config.hpp | config.hpp | |||
---|---|---|---|---|
skipping to change at line 80 | skipping to change at line 80 | |||
#define TORRENT_DEPRECATED | #define TORRENT_DEPRECATED | |||
#endif | #endif | |||
// set up defines for target environments | // set up defines for target environments | |||
#if (defined __APPLE__ && __MACH__) || defined __FreeBSD__ || defined __Net BSD__ \ | #if (defined __APPLE__ && __MACH__) || defined __FreeBSD__ || defined __Net BSD__ \ | |||
|| defined __OpenBSD__ || defined __bsdi__ || defined __DragonFly__ \ | || defined __OpenBSD__ || defined __bsdi__ || defined __DragonFly__ \ | |||
|| defined __FreeBSD_kernel__ | || defined __FreeBSD_kernel__ | |||
#define TORRENT_BSD | #define TORRENT_BSD | |||
#elif defined __linux__ | #elif defined __linux__ | |||
#define TORRENT_LINUX | #define TORRENT_LINUX | |||
#elif defined __MINGW32__ | ||||
#define TORRENT_MINGW | ||||
#elif defined WIN32 | #elif defined WIN32 | |||
#define TORRENT_WINDOWS | #define TORRENT_WINDOWS | |||
#elif defined sun || defined __sun | #elif defined sun || defined __sun | |||
#define TORRENT_SOLARIS | #define TORRENT_SOLARIS | |||
#else | #else | |||
#warning unkown OS, assuming BSD | #warning unkown OS, assuming BSD | |||
#define TORRENT_BSD | #define TORRENT_BSD | |||
#endif | #endif | |||
// should wpath or path be used? | // should wpath or path be used? | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 2 lines changed or added | |||
create_torrent.hpp | create_torrent.hpp | |||
---|---|---|---|---|
skipping to change at line 195 | skipping to change at line 195 | |||
detail::add_files_impl(fs, complete(file).parent_path(), fil e.filename(), detail::default_pred); | detail::add_files_impl(fs, complete(file).parent_path(), fil e.filename(), detail::default_pred); | |||
#endif | #endif | |||
} | } | |||
template <class Fun> | template <class Fun> | |||
void set_piece_hashes(create_torrent& t, boost::filesystem::path con st& p, Fun f | void set_piece_hashes(create_torrent& t, boost::filesystem::path con st& p, Fun f | |||
, error_code& ec) | , error_code& ec) | |||
{ | { | |||
file_pool fp; | file_pool fp; | |||
boost::scoped_ptr<storage_interface> st( | boost::scoped_ptr<storage_interface> st( | |||
default_storage_constructor(const_cast<file_storage& >(t.files()), p, fp)); | default_storage_constructor(const_cast<file_storage& >(t.files()), 0, p, fp)); | |||
// calculate the hash for all pieces | // calculate the hash for all pieces | |||
int num = t.num_pieces(); | int num = t.num_pieces(); | |||
std::vector<char> buf(t.piece_length()); | std::vector<char> buf(t.piece_length()); | |||
for (int i = 0; i < num; ++i) | for (int i = 0; i < num; ++i) | |||
{ | { | |||
// read hits the disk and will block. Progress shoul d | // read hits the disk and will block. Progress shoul d | |||
// be updated in between reads | // be updated in between reads | |||
st->read(&buf[0], i, 0, t.piece_size(i)); | st->read(&buf[0], i, 0, t.piece_size(i)); | |||
if (st->error()) | if (st->error()) | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
policy.hpp | policy.hpp | |||
---|---|---|---|---|
skipping to change at line 99 | skipping to change at line 99 | |||
// false means duplicate connection | // false means duplicate connection | |||
bool update_peer_port(int port, policy::peer* p, int src); | bool update_peer_port(int port, policy::peer* p, int src); | |||
// called when an incoming connection is accepted | // called when an incoming connection is accepted | |||
// false means the connection was refused or failed | // false means the connection was refused or failed | |||
bool new_connection(peer_connection& c); | bool new_connection(peer_connection& c); | |||
// the given connection was just closed | // the given connection was just closed | |||
void connection_closed(const peer_connection& c); | void connection_closed(const peer_connection& c); | |||
void ban_peer(policy::peer* p); | ||||
// the peer has got at least one interesting piece | // the peer has got at least one interesting piece | |||
void peer_is_interesting(peer_connection& c); | void peer_is_interesting(peer_connection& c); | |||
// the peer unchoked us | // the peer unchoked us | |||
void unchoked(peer_connection& c); | void unchoked(peer_connection& c); | |||
// the peer is interested in our pieces | // the peer is interested in our pieces | |||
void interested(peer_connection& c); | void interested(peer_connection& c); | |||
// the peer is not interested in our pieces | // the peer is not interested in our pieces | |||
void not_interested(peer_connection& c); | void not_interested(peer_connection& c); | |||
void ip_filter_updated(); | void ip_filter_updated(); | |||
void set_seed(policy::peer* p, bool s); | ||||
#ifdef TORRENT_DEBUG | #ifdef TORRENT_DEBUG | |||
bool has_connection(const peer_connection* p); | bool has_connection(const peer_connection* p); | |||
void check_invariant() const; | void check_invariant() const; | |||
#endif | #endif | |||
struct peer | struct peer | |||
{ | { | |||
enum connection_type { not_connectable, connectable }; | enum connection_type { not_connectable, connectable }; | |||
peer(tcp::endpoint const& ip, connection_type t, int src); | peer(tcp::endpoint const& ip, connection_type t, int src); | |||
skipping to change at line 269 | skipping to change at line 273 | |||
void erase_peer(iterator i); | void erase_peer(iterator i); | |||
private: | private: | |||
bool compare_peer(policy::peer const& lhs, policy::peer cons t& rhs | bool compare_peer(policy::peer const& lhs, policy::peer cons t& rhs | |||
, address const& external_ip) const; | , address const& external_ip) const; | |||
iterator find_connect_candidate(); | iterator find_connect_candidate(); | |||
bool is_connect_candidate(peer const& p, bool finished); | bool is_connect_candidate(peer const& p, bool finished) cons t; | |||
std::multimap<address, peer> m_peers; | std::multimap<address, peer> m_peers; | |||
// since the peer list can grow too large | // since the peer list can grow too large | |||
// to scan all of it, start at this iterator | // to scan all of it, start at this iterator | |||
iterator m_round_robin; | iterator m_round_robin; | |||
torrent* m_torrent; | torrent* m_torrent; | |||
// free download we have got that hasn't | // free download we have got that hasn't | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 5 lines changed or added | |||
session.hpp | session.hpp | |||
---|---|---|---|---|
skipping to change at line 257 | skipping to change at line 257 | |||
#ifndef TORRENT_DISABLE_GEO_IP | #ifndef TORRENT_DISABLE_GEO_IP | |||
int as_for_ip(address const& addr); | int as_for_ip(address const& addr); | |||
bool load_asnum_db(char const* file); | bool load_asnum_db(char const* file); | |||
bool load_country_db(char const* file); | bool load_country_db(char const* file); | |||
#endif | #endif | |||
void load_state(entry const& ses_state); | void load_state(entry const& ses_state); | |||
entry state() const; | entry state() const; | |||
void set_ip_filter(ip_filter const& f); | void set_ip_filter(ip_filter const& f); | |||
ip_filter const& get_ip_filter() const; | ||||
void set_port_filter(port_filter const& f); | void set_port_filter(port_filter const& f); | |||
void set_peer_id(peer_id const& pid); | void set_peer_id(peer_id const& pid); | |||
void set_key(int key); | void set_key(int key); | |||
peer_id id() const; | peer_id id() const; | |||
bool is_listening() const; | bool is_listening() const; | |||
// if the listen port failed in some way | // if the listen port failed in some way | |||
// you can retry to listen on another port- | // you can retry to listen on another port- | |||
// range with this function. If the listener | // range with this function. If the listener | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 2 lines changed or added | |||
session_impl.hpp | session_impl.hpp | |||
---|---|---|---|---|
skipping to change at line 202 | skipping to change at line 202 | |||
void on_port_mapping(int mapping, int port, std::str ing const& errmsg | void on_port_mapping(int mapping, int port, std::str ing const& errmsg | |||
, int nat_transport); | , int nat_transport); | |||
bool is_aborted() const { return m_abort; } | bool is_aborted() const { return m_abort; } | |||
bool is_paused() const { return m_paused; } | bool is_paused() const { return m_paused; } | |||
void pause(); | void pause(); | |||
void resume(); | void resume(); | |||
void set_ip_filter(ip_filter const& f); | void set_ip_filter(ip_filter const& f); | |||
ip_filter const& get_ip_filter() const; | ||||
void set_port_filter(port_filter const& f); | void set_port_filter(port_filter const& f); | |||
bool listen_on( | bool listen_on( | |||
std::pair<int, int> const& port_range | std::pair<int, int> const& port_range | |||
, const char* net_interface = 0); | , const char* net_interface = 0); | |||
bool is_listening() const; | bool is_listening() const; | |||
torrent_handle add_torrent(add_torrent_params const& ); | torrent_handle add_torrent(add_torrent_params const& ); | |||
void remove_torrent(torrent_handle const& h, int opt ions); | void remove_torrent(torrent_handle const& h, int opt ions); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 2 lines changed or added | |||
storage.hpp | storage.hpp | |||
---|---|---|---|---|
skipping to change at line 185 | skipping to change at line 185 | |||
std::string const& error_file() const { return m_error_file; } | std::string const& error_file() const { return m_error_file; } | |||
void clear_error() { m_error = error_code(); m_error_file.cl ear(); } | void clear_error() { m_error = error_code(); m_error_file.cl ear(); } | |||
mutable error_code m_error; | mutable error_code m_error; | |||
mutable std::string m_error_file; | mutable std::string m_error_file; | |||
virtual ~storage_interface() {} | virtual ~storage_interface() {} | |||
}; | }; | |||
typedef storage_interface* (&storage_constructor_type)( | typedef storage_interface* (&storage_constructor_type)( | |||
file_storage const&, fs::path const&, file_pool&); | file_storage const&, file_storage const*, fs::path const&, f ile_pool&); | |||
TORRENT_EXPORT storage_interface* default_storage_constructor( | TORRENT_EXPORT storage_interface* default_storage_constructor( | |||
file_storage const&, fs::path const&, file_pool&); | file_storage const&, file_storage const* mapped, fs::path co | |||
TORRENT_EXPORT storage_interface* mapped_storage_constructor( | nst&, file_pool&); | |||
file_storage const&, fs::path const&, file_pool&); | ||||
struct disk_io_thread; | struct disk_io_thread; | |||
class TORRENT_EXPORT piece_manager | class TORRENT_EXPORT piece_manager | |||
: public intrusive_ptr_base<piece_manager> | : public intrusive_ptr_base<piece_manager> | |||
, boost::noncopyable | , boost::noncopyable | |||
{ | { | |||
friend class invariant_access; | friend class invariant_access; | |||
friend struct disk_io_thread; | friend struct disk_io_thread; | |||
public: | public: | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 3 lines changed or added | |||
upnp.hpp | upnp.hpp | |||
---|---|---|---|---|
skipping to change at line 95 | skipping to change at line 95 | |||
mutex_t::scoped_lock l(m_mutex); | mutex_t::scoped_lock l(m_mutex); | |||
return m_model; | return m_model; | |||
} | } | |||
private: | private: | |||
void discover_device_impl(); | void discover_device_impl(); | |||
static address_v4 upnp_multicast_address; | static address_v4 upnp_multicast_address; | |||
static udp::endpoint upnp_multicast_endpoint; | static udp::endpoint upnp_multicast_endpoint; | |||
enum { default_lease_time = 3600 }; | // there are routers that's don't support timed | |||
// port maps, without returning error 725. It seems | ||||
// safer to always assume that we have to ask for | ||||
// permanent leases | ||||
enum { default_lease_time = 0 }; | ||||
void resend_request(error_code const& e); | void resend_request(error_code const& e); | |||
void on_reply(udp::endpoint const& from, char* buffer | void on_reply(udp::endpoint const& from, char* buffer | |||
, std::size_t bytes_transferred); | , std::size_t bytes_transferred); | |||
struct rootdevice; | struct rootdevice; | |||
void next(rootdevice& d, int i); | void next(rootdevice& d, int i); | |||
void update_map(rootdevice& d, int i); | void update_map(rootdevice& d, int i); | |||
void on_upnp_xml(error_code const& e | void on_upnp_xml(error_code const& e | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 5 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 14 | #define LIBTORRENT_VERSION_MINOR 14 | |||
#define LIBTORRENT_VERSION_TINY 4 | #define LIBTORRENT_VERSION_TINY 5 | |||
#define LIBTORRENT_VERSION "0.14.4.0" | #define LIBTORRENT_VERSION "0.14.5.0" | |||
#define LIBTORRENT_REVISION "$Rev: 3609 $" | #define LIBTORRENT_REVISION "$Rev: 3760 $" | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
web_peer_connection.hpp | web_peer_connection.hpp | |||
---|---|---|---|---|
skipping to change at line 100 | skipping to change at line 100 | |||
// this is the constructor where the we are the active part. | // this is the constructor where the we are the active part. | |||
// The peer_conenction should handshake and verify that the | // The peer_conenction should handshake and verify that the | |||
// other end has the correct id | // other end has the correct id | |||
web_peer_connection( | web_peer_connection( | |||
aux::session_impl& ses | aux::session_impl& ses | |||
, boost::weak_ptr<torrent> t | , boost::weak_ptr<torrent> t | |||
, boost::shared_ptr<socket_type> s | , boost::shared_ptr<socket_type> s | |||
, tcp::endpoint const& remote | , tcp::endpoint const& remote | |||
, std::string const& url | , std::string const& url | |||
, policy::peer* peerinfo); | , policy::peer* peerinfo); | |||
void start(); | ||||
~web_peer_connection(); | ~web_peer_connection(); | |||
// called from the main loop when this connection has any | // called from the main loop when this connection has any | |||
// work to do. | // work to do. | |||
void on_sent(error_code const& error | void on_sent(error_code const& error | |||
, std::size_t bytes_transferred); | , std::size_t bytes_transferred); | |||
void on_receive(error_code const& error | void on_receive(error_code const& error | |||
, std::size_t bytes_transferred); | , std::size_t bytes_transferred); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||