| alert_types.hpp | | alert_types.hpp | |
| | | | |
| skipping to change at line 741 | | skipping to change at line 741 | |
| virtual char const* what() const { return "storage moved"; } | | virtual char const* what() const { return "storage moved"; } | |
| const static int static_category = alert::storage_notificati
on; | | const static int static_category = alert::storage_notificati
on; | |
| virtual int category() const { return static_category; } | | virtual int category() const { return static_category; } | |
| virtual std::string message() const | | virtual std::string message() const | |
| { | | { | |
| return torrent_alert::message() + " moved storage to
: " | | return torrent_alert::message() + " moved storage to
: " | |
| + path; | | + path; | |
| } | | } | |
| }; | | }; | |
| | | | |
|
| | | struct TORRENT_EXPORT storage_moved_failed_alert: torrent_alert | |
| | | { | |
| | | storage_moved_failed_alert(torrent_handle const& h, error_co | |
| | | de const& ec_) | |
| | | : torrent_alert(h) | |
| | | , error(ec_) | |
| | | {} | |
| | | | |
| | | error_code error; | |
| | | | |
| | | virtual std::auto_ptr<alert> clone() const | |
| | | { return std::auto_ptr<alert>(new storage_moved_failed_alert | |
| | | (*this)); } | |
| | | virtual char const* what() const { return "storage moved fai | |
| | | led"; } | |
| | | const static int static_category = alert::storage_notificati | |
| | | on; | |
| | | virtual int category() const { return static_category; } | |
| | | virtual std::string message() const | |
| | | { | |
| | | return torrent_alert::message() + " storage move fai | |
| | | led: " | |
| | | + error.message(); | |
| | | } | |
| | | }; | |
| | | | |
| struct TORRENT_EXPORT torrent_deleted_alert: torrent_alert | | struct TORRENT_EXPORT torrent_deleted_alert: torrent_alert | |
| { | | { | |
| torrent_deleted_alert(torrent_handle const& h) | | torrent_deleted_alert(torrent_handle const& h) | |
| : torrent_alert(h) | | : torrent_alert(h) | |
| {} | | {} | |
| | | | |
| virtual std::auto_ptr<alert> clone() const | | virtual std::auto_ptr<alert> clone() const | |
| { return std::auto_ptr<alert>(new torrent_deleted_alert(*thi
s)); } | | { return std::auto_ptr<alert>(new torrent_deleted_alert(*thi
s)); } | |
| virtual char const* what() const { return "torrent deleted";
} | | virtual char const* what() const { return "torrent deleted";
} | |
| const static int static_category = alert::storage_notificati
on; | | const static int static_category = alert::storage_notificati
on; | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 26 lines changed or added | |
|
| bitfield.hpp | | bitfield.hpp | |
| | | | |
| skipping to change at line 73 | | skipping to change at line 73 | |
| void assign(char const* bytes, int bits) | | void assign(char const* bytes, int bits) | |
| { resize(bits); std::memcpy(m_bytes, bytes, (bits + 7) / 8);
clear_trailing_bits(); } | | { resize(bits); std::memcpy(m_bytes, bytes, (bits + 7) / 8);
clear_trailing_bits(); } | |
| | | | |
| bool operator[](int index) const | | bool operator[](int index) const | |
| { return get_bit(index); } | | { return get_bit(index); } | |
| | | | |
| bool get_bit(int index) const | | bool get_bit(int index) const | |
| { | | { | |
| TORRENT_ASSERT(index >= 0); | | TORRENT_ASSERT(index >= 0); | |
| TORRENT_ASSERT(index < m_size); | | TORRENT_ASSERT(index < m_size); | |
|
| return m_bytes[index / 8] & (0x80 >> (index & 7)); | | return (m_bytes[index / 8] & (0x80 >> (index & 7)))
!= 0; | |
| } | | } | |
| | | | |
| void clear_bit(int index) | | void clear_bit(int index) | |
| { | | { | |
| TORRENT_ASSERT(index >= 0); | | TORRENT_ASSERT(index >= 0); | |
| TORRENT_ASSERT(index < m_size); | | TORRENT_ASSERT(index < m_size); | |
| m_bytes[index / 8] &= ~(0x80 >> (index & 7)); | | m_bytes[index / 8] &= ~(0x80 >> (index & 7)); | |
| } | | } | |
| | | | |
| void set_bit(int index) | | void set_bit(int index) | |
| | | | |
| skipping to change at line 138 | | skipping to change at line 138 | |
| struct const_iterator | | struct const_iterator | |
| { | | { | |
| friend struct bitfield; | | friend struct bitfield; | |
| | | | |
| typedef bool value_type; | | typedef bool value_type; | |
| typedef ptrdiff_t difference_type; | | typedef ptrdiff_t difference_type; | |
| typedef bool const* pointer; | | typedef bool const* pointer; | |
| typedef bool& reference; | | typedef bool& reference; | |
| typedef std::forward_iterator_tag iterator_category; | | typedef std::forward_iterator_tag iterator_category; | |
| | | | |
|
| bool operator*() { return *byte & bit; } | | bool operator*() { return (*byte & bit) != 0; } | |
| const_iterator& operator++() { inc(); return *this;
} | | const_iterator& operator++() { inc(); return *this;
} | |
| const_iterator operator++(int) | | const_iterator operator++(int) | |
| { const_iterator ret(*this); inc(); return ret; } | | { const_iterator ret(*this); inc(); return ret; } | |
| const_iterator& operator--() { dec(); return *this;
} | | const_iterator& operator--() { dec(); return *this;
} | |
| const_iterator operator--(int) | | const_iterator operator--(int) | |
| { const_iterator ret(*this); dec(); return ret; } | | { const_iterator ret(*this); dec(); return ret; } | |
| | | | |
| const_iterator(): byte(0), bit(0x80) {} | | const_iterator(): byte(0), bit(0x80) {} | |
| bool operator==(const_iterator const& rhs) const | | bool operator==(const_iterator const& rhs) const | |
| { return byte == rhs.byte && bit == rhs.bit; } | | { return byte == rhs.byte && bit == rhs.bit; } | |
| | | | |
End of changes. 2 change blocks. |
| 2 lines changed or deleted | | 2 lines changed or added | |
|
| disk_io_thread.hpp | | disk_io_thread.hpp | |
| | | | |
| skipping to change at line 237 | | skipping to change at line 237 | |
| // cache operations | | // cache operations | |
| cache_t::iterator find_cached_piece( | | cache_t::iterator find_cached_piece( | |
| cache_t& cache, disk_io_job const& j | | cache_t& cache, disk_io_job const& j | |
| , mutex_t::scoped_lock& l); | | , mutex_t::scoped_lock& l); | |
| | | | |
| // write cache operations | | // write cache operations | |
| void flush_oldest_piece(mutex_t::scoped_lock& l); | | void flush_oldest_piece(mutex_t::scoped_lock& l); | |
| void flush_expired_pieces(); | | void flush_expired_pieces(); | |
| void flush_and_remove(cache_t::iterator i, mutex_t::scoped_l
ock& l); | | void flush_and_remove(cache_t::iterator i, mutex_t::scoped_l
ock& l); | |
| void flush(cache_t::iterator i, mutex_t::scoped_lock& l); | | void flush(cache_t::iterator i, mutex_t::scoped_lock& l); | |
|
| void cache_block(disk_io_job& j, mutex_t::scoped_lock& l); | | int cache_block(disk_io_job& j, mutex_t::scoped_lock& l); | |
| | | | |
| // read cache operations | | // read cache operations | |
| bool clear_oldest_read_piece(cache_t::iterator ignore | | bool clear_oldest_read_piece(cache_t::iterator ignore | |
| , mutex_t::scoped_lock& l); | | , mutex_t::scoped_lock& l); | |
| int read_into_piece(cached_piece_entry& p, int start_block,
mutex_t::scoped_lock& l); | | int read_into_piece(cached_piece_entry& p, int start_block,
mutex_t::scoped_lock& l); | |
| int cache_read_block(disk_io_job const& j, mutex_t::scoped_l
ock& l); | | int cache_read_block(disk_io_job const& j, mutex_t::scoped_l
ock& l); | |
| void free_piece(cached_piece_entry& p, mutex_t::scoped_lock&
l); | | void free_piece(cached_piece_entry& p, mutex_t::scoped_lock&
l); | |
| bool make_room(int num_blocks | | bool make_room(int num_blocks | |
| , cache_t::iterator ignore | | , cache_t::iterator ignore | |
| , mutex_t::scoped_lock& l); | | , mutex_t::scoped_lock& l); | |
| | | | |
| skipping to change at line 313 | | skipping to change at line 313 | |
| #endif | | #endif | |
| #ifdef TORRENT_STATS | | #ifdef TORRENT_STATS | |
| int m_allocations; | | int m_allocations; | |
| #endif | | #endif | |
| | | | |
| size_type m_writes; | | size_type m_writes; | |
| size_type m_blocks_written; | | size_type m_blocks_written; | |
| | | | |
| io_service& m_ios; | | io_service& m_ios; | |
| | | | |
|
| | | // this keeps the io_service::run() call blocked from | |
| | | // returning. When shutting down, it's possible that | |
| | | // the event queue is drained before the disk_io_thread | |
| | | // has posted its last callback. When this happens, the | |
| | | // io_service will have a pending callback from the | |
| | | // disk_io_thread, but the event loop is not running. | |
| | | // this means that the event is destructed after the | |
| | | // disk_io_thread. If the event refers to a disk buffer | |
| | | // it will try to free it, but the buffer pool won't | |
| | | // exist anymore, and crash. This prevents that. | |
| | | boost::optional<asio::io_service::work> m_work; | |
| | | | |
| // thread for performing blocking disk io operations | | // thread for performing blocking disk io operations | |
| boost::thread m_disk_io_thread; | | boost::thread m_disk_io_thread; | |
|
| | | #ifdef TORRENT_DEBUG | |
| | | int m_magic; | |
| | | #endif | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 3 change blocks. |
| 1 lines changed or deleted | | 16 lines changed or added | |
|
| peer_id.hpp | | peer_id.hpp | |
| | | | |
| skipping to change at line 72 | | skipping to change at line 72 | |
| else std::memcpy(m_number, s, size); | | else std::memcpy(m_number, s, size); | |
| } | | } | |
| | | | |
| explicit big_number(std::string const& s) | | explicit big_number(std::string const& s) | |
| { | | { | |
| TORRENT_ASSERT(s.size() >= 20); | | TORRENT_ASSERT(s.size() >= 20); | |
| int sl = int(s.size()) < size ? int(s.size()) : size
; | | int sl = int(s.size()) < size ? int(s.size()) : size
; | |
| std::memcpy(m_number, &s[0], sl); | | std::memcpy(m_number, &s[0], sl); | |
| } | | } | |
| | | | |
|
| | | void assign(std::string const& s) | |
| | | { | |
| | | TORRENT_ASSERT(s.size() >= 20); | |
| | | int sl = int(s.size()) < size ? int(s.size()) : size | |
| | | ; | |
| | | std::memcpy(m_number, &s[0], sl); | |
| | | } | |
| | | | |
| void clear() | | void clear() | |
| { | | { | |
| std::fill(m_number,m_number+number_size,0); | | std::fill(m_number,m_number+number_size,0); | |
| } | | } | |
| | | | |
| bool is_all_zeros() const | | bool is_all_zeros() const | |
| { | | { | |
| return std::count(m_number,m_number+number_size,0) =
= number_size; | | return std::count(m_number,m_number+number_size,0) =
= number_size; | |
| } | | } | |
| | | | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 8 lines changed or added | |
|
| policy.hpp | | policy.hpp | |
| | | | |
| skipping to change at line 258 | | skipping to change at line 258 | |
| const_iterator end_peer() const { return m_peers.end(); } | | const_iterator end_peer() const { return m_peers.end(); } | |
| std::pair<iterator, iterator> find_peers(address const& a) | | std::pair<iterator, iterator> find_peers(address const& a) | |
| { return m_peers.equal_range(a); } | | { return m_peers.equal_range(a); } | |
| | | | |
| bool connect_one_peer(); | | bool connect_one_peer(); | |
| | | | |
| bool has_peer(policy::peer const* p) const; | | bool has_peer(policy::peer const* p) const; | |
| | | | |
| int num_seeds() const { return m_num_seeds; } | | int num_seeds() const { return m_num_seeds; } | |
| int num_connect_candidates() const { return m_num_connect_ca
ndidates; } | | int num_connect_candidates() const { return m_num_connect_ca
ndidates; } | |
|
| void recalculate_connect_candidates() | | void recalculate_connect_candidates(); | |
| { | | | |
| if (m_num_connect_candidates == 0) | | | |
| m_num_connect_candidates = 1; | | | |
| } | | | |
| | | | |
| 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(); | |
| | | | |
| | | | |
| skipping to change at line 297 | | skipping to change at line 293 | |
| // The number of peers in our peer list | | // The number of peers in our peer list | |
| // that are connect candidates. i.e. they're | | // that are connect candidates. i.e. they're | |
| // not already connected and they have not | | // not already connected and they have not | |
| // yet reached their max try count and they | | // yet reached their max try count and they | |
| // have the connectable state (we have a listen | | // have the connectable state (we have a listen | |
| // port for them). | | // port for them). | |
| int m_num_connect_candidates; | | int m_num_connect_candidates; | |
| | | | |
| // the number of seeds in the peer list | | // the number of seeds in the peer list | |
| int m_num_seeds; | | int m_num_seeds; | |
|
| | | | |
| | | // this was the state of the torrent the | |
| | | // last time we recalculated the number of | |
| | | // connect candidates. Since seeds (or upload | |
| | | // only) peers are not connect candidates | |
| | | // when we're finished, the set depends on | |
| | | // this state. Every time m_torrent->is_finished() | |
| | | // is different from this state, we need to | |
| | | // recalculate the connect candidates. | |
| | | bool m_finished; | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif // TORRENT_POLICY_HPP_INCLUDED | | #endif // TORRENT_POLICY_HPP_INCLUDED | |
| | | | |
End of changes. 2 change blocks. |
| 5 lines changed or deleted | | 11 lines changed or added | |
|
| session_settings.hpp | | session_settings.hpp | |
| | | | |
| skipping to change at line 106 | | skipping to change at line 106 | |
| , peer_timeout(120) | | , peer_timeout(120) | |
| , urlseed_timeout(20) | | , urlseed_timeout(20) | |
| , urlseed_pipeline_size(5) | | , urlseed_pipeline_size(5) | |
| , urlseed_wait_retry(30) | | , urlseed_wait_retry(30) | |
| , file_pool_size(40) | | , file_pool_size(40) | |
| , allow_multiple_connections_per_ip(false) | | , allow_multiple_connections_per_ip(false) | |
| , max_failcount(3) | | , max_failcount(3) | |
| , min_reconnect_time(60) | | , min_reconnect_time(60) | |
| , peer_connect_timeout(7) | | , peer_connect_timeout(7) | |
| , ignore_limits_on_local_network(true) | | , ignore_limits_on_local_network(true) | |
|
| , connection_speed(20) | | , connection_speed(10) | |
| , send_redundant_have(false) | | , send_redundant_have(false) | |
| , lazy_bitfields(true) | | , lazy_bitfields(true) | |
| , inactivity_timeout(600) | | , inactivity_timeout(600) | |
| , unchoke_interval(15) | | , unchoke_interval(15) | |
| , optimistic_unchoke_multiplier(4) | | , optimistic_unchoke_multiplier(4) | |
| , num_want(200) | | , num_want(200) | |
| , initial_picker_threshold(4) | | , initial_picker_threshold(4) | |
| , allowed_fast_set_size(10) | | , allowed_fast_set_size(10) | |
| , max_outstanding_disk_bytes_per_connection(64 * 102
4) | | , max_outstanding_disk_bytes_per_connection(64 * 102
4) | |
| , handshake_timeout(10) | | , handshake_timeout(10) | |
| | | | |
End of changes. 1 change blocks. |
| 1 lines changed or deleted | | 1 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 3 | | #define LIBTORRENT_VERSION_TINY 4 | |
| | | | |
|
| #define LIBTORRENT_VERSION "0.14.3.0" | | #define LIBTORRENT_VERSION "0.14.4.0" | |
| #define LIBTORRENT_REVISION "$Rev: 3323 $" | | #define LIBTORRENT_REVISION "$Rev: 3609 $" | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 2 change blocks. |
| 3 lines changed or deleted | | 3 lines changed or added | |
|