| bandwidth_manager.hpp | | bandwidth_manager.hpp | |
| | | | |
| skipping to change at line 151 | | skipping to change at line 151 | |
| } | | } | |
| | | | |
| int throttle() const | | int throttle() const | |
| { | | { | |
| mutex_t::scoped_lock l(m_mutex); | | mutex_t::scoped_lock l(m_mutex); | |
| return m_limit; | | return m_limit; | |
| } | | } | |
| | | | |
| void close() | | void close() | |
| { | | { | |
|
| | | mutex_t::scoped_lock l(m_mutex); | |
| m_abort = true; | | m_abort = true; | |
| m_queue.clear(); | | m_queue.clear(); | |
| m_history.clear(); | | m_history.clear(); | |
| m_current_quota = 0; | | m_current_quota = 0; | |
| error_code ec; | | error_code ec; | |
| m_history_timer.cancel(ec); | | m_history_timer.cancel(ec); | |
| } | | } | |
| | | | |
| #ifdef TORRENT_DEBUG | | #ifdef TORRENT_DEBUG | |
| bool is_queued(PeerConnection const* peer) const | | bool is_queued(PeerConnection const* peer) const | |
| | | | |
| skipping to change at line 281 | | skipping to change at line 282 | |
| // TORRENT_ASSERT(e.expires_at > time_now()); | | // TORRENT_ASSERT(e.expires_at > time_now()); | |
| m_history_timer.expires_at(e.expires_at, ec); | | m_history_timer.expires_at(e.expires_at, ec); | |
| m_history_timer.async_wait(bind(&bandwidth_manager::on_histo
ry_expire, this, _1)); | | m_history_timer.async_wait(bind(&bandwidth_manager::on_histo
ry_expire, this, _1)); | |
| } | | } | |
| | | | |
| void on_history_expire(error_code const& e) | | void on_history_expire(error_code const& e) | |
| { | | { | |
| if (e) return; | | if (e) return; | |
| | | | |
| mutex_t::scoped_lock l(m_mutex); | | mutex_t::scoped_lock l(m_mutex); | |
|
| INVARIANT_CHECK; | | | |
| if (m_abort) return; | | if (m_abort) return; | |
|
| | | INVARIANT_CHECK; | |
| | | | |
| TORRENT_ASSERT(!m_history.empty()); | | TORRENT_ASSERT(!m_history.empty()); | |
| | | | |
| ptime now(time_now()); | | ptime now(time_now()); | |
| while (!m_history.empty() && m_history.back().expires_at <=
now) | | while (!m_history.empty() && m_history.back().expires_at <=
now) | |
| { | | { | |
| history_entry<PeerConnection, Torrent> e = m_history
.back(); | | history_entry<PeerConnection, Torrent> e = m_history
.back(); | |
| m_history.pop_back(); | | m_history.pop_back(); | |
| m_current_quota -= e.amount; | | m_current_quota -= e.amount; | |
| TORRENT_ASSERT(m_current_quota >= 0); | | TORRENT_ASSERT(m_current_quota >= 0); | |
| | | | |
End of changes. 3 change blocks. |
| 1 lines changed or deleted | | 2 lines changed or added | |
|
| bencode.hpp | | bencode.hpp | |
| | | | |
| skipping to change at line 66 | | skipping to change at line 66 | |
| * the string is not correctly bencoded. | | * the string is not correctly bencoded. | |
| * | | * | |
| */ | | */ | |
| | | | |
| #include <cstdlib> | | #include <cstdlib> | |
| | | | |
| #ifdef _MSC_VER | | #ifdef _MSC_VER | |
| #pragma warning(push, 1) | | #pragma warning(push, 1) | |
| #endif | | #endif | |
| | | | |
|
| #include <boost/lexical_cast.hpp> | | | |
| #include <boost/static_assert.hpp> | | #include <boost/static_assert.hpp> | |
| | | | |
| #ifdef _MSC_VER | | #ifdef _MSC_VER | |
| #pragma warning(pop) | | #pragma warning(pop) | |
| #endif | | #endif | |
| | | | |
| #include "libtorrent/entry.hpp" | | #include "libtorrent/entry.hpp" | |
| #include "libtorrent/config.hpp" | | #include "libtorrent/config.hpp" | |
| | | | |
| #include "libtorrent/assert.hpp" | | #include "libtorrent/assert.hpp" | |
| | | | |
| skipping to change at line 243 | | skipping to change at line 242 | |
| // ---------------------------------------------- | | // ---------------------------------------------- | |
| // integer | | // integer | |
| case 'i': | | case 'i': | |
| { | | { | |
| ++in; // 'i' | | ++in; // 'i' | |
| std::string val = read_until(in, end, 'e', e
rr); | | std::string val = read_until(in, end, 'e', e
rr); | |
| if (err) return; | | if (err) return; | |
| TORRENT_ASSERT(*in == 'e'); | | TORRENT_ASSERT(*in == 'e'); | |
| ++in; // 'e' | | ++in; // 'e' | |
| ret = entry(entry::int_t); | | ret = entry(entry::int_t); | |
|
| ret.integer() = boost::lexical_cast<entry::i | | char* end_pointer; | |
| nteger_type>(val); | | #ifdef TORRENT_WINDOWS | |
| | | ret.integer() = _strtoi64(val.c_str(), &end_ | |
| | | pointer, 10); | |
| | | #else | |
| | | ret.integer() = strtoll(val.c_str(), &end_po | |
| | | inter, 10); | |
| | | #endif | |
| #ifdef TORRENT_DEBUG | | #ifdef TORRENT_DEBUG | |
| ret.m_type_queried = false; | | ret.m_type_queried = false; | |
| #endif | | #endif | |
|
| | | if (end_pointer == val.c_str()) | |
| | | { | |
| | | err = true; | |
| | | return; | |
| | | } | |
| } break; | | } break; | |
| | | | |
| // ---------------------------------------------- | | // ---------------------------------------------- | |
| // list | | // list | |
| case 'l': | | case 'l': | |
| { | | { | |
| ret = entry(entry::list_t); | | ret = entry(entry::list_t); | |
| ++in; // 'l' | | ++in; // 'l' | |
| while (*in != 'e') | | while (*in != 'e') | |
| { | | { | |
| | | | |
End of changes. 3 change blocks. |
| 3 lines changed or deleted | | 13 lines changed or added | |
|
| bitfield.hpp | | bitfield.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_BITFIELD_HPP_INCLUDED | | #ifndef TORRENT_BITFIELD_HPP_INCLUDED | |
| #define TORRENT_BITFIELD_HPP_INCLUDED | | #define TORRENT_BITFIELD_HPP_INCLUDED | |
| | | | |
| #include "libtorrent/assert.hpp" | | #include "libtorrent/assert.hpp" | |
| #include "libtorrent/config.hpp" | | #include "libtorrent/config.hpp" | |
|
| | | #include <cstring> // for memset and memcpy | |
| | | | |
| namespace libtorrent | | namespace libtorrent | |
| { | | { | |
| struct TORRENT_EXPORT bitfield | | struct TORRENT_EXPORT bitfield | |
| { | | { | |
| bitfield(): m_bytes(0), m_size(0), m_own(false) {} | | bitfield(): m_bytes(0), m_size(0), m_own(false) {} | |
| bitfield(int bits): m_bytes(0), m_size(0) | | bitfield(int bits): m_bytes(0), m_size(0) | |
| { resize(bits); } | | { resize(bits); } | |
| bitfield(int bits, bool val): m_bytes(0), m_size(0) | | bitfield(int bits, bool val): m_bytes(0), m_size(0) | |
| { resize(bits, val); } | | { resize(bits, val); } | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 1 lines changed or added | |
|
| broadcast_socket.hpp | | broadcast_socket.hpp | |
| | | | |
| skipping to change at line 51 | | skipping to change at line 51 | |
| | | | |
| namespace libtorrent | | namespace libtorrent | |
| { | | { | |
| | | | |
| TORRENT_EXPORT bool is_local(address const& a); | | TORRENT_EXPORT bool is_local(address const& a); | |
| TORRENT_EXPORT bool is_loopback(address const& addr); | | TORRENT_EXPORT bool is_loopback(address const& addr); | |
| TORRENT_EXPORT bool is_multicast(address const& addr); | | TORRENT_EXPORT bool is_multicast(address const& addr); | |
| TORRENT_EXPORT bool is_any(address const& addr); | | TORRENT_EXPORT bool is_any(address const& addr); | |
| TORRENT_EXPORT int cidr_distance(address const& a1, address const& a
2); | | TORRENT_EXPORT int cidr_distance(address const& a1, address const& a
2); | |
| | | | |
|
| | | // determines if the operating system supports IPv6 | |
| | | TORRENT_EXPORT bool supports_ipv6(); | |
| | | | |
| int common_bits(unsigned char const* b1 | | int common_bits(unsigned char const* b1 | |
| , unsigned char const* b2, int n); | | , unsigned char const* b2, int n); | |
| | | | |
| TORRENT_EXPORT address guess_local_address(io_service&); | | TORRENT_EXPORT address guess_local_address(io_service&); | |
| | | | |
| typedef boost::function<void(udp::endpoint const& from | | typedef boost::function<void(udp::endpoint const& from | |
| , char* buffer, int size)> receive_handler_t; | | , char* buffer, int size)> receive_handler_t; | |
| | | | |
| class TORRENT_EXPORT broadcast_socket | | class TORRENT_EXPORT broadcast_socket | |
| { | | { | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 3 lines changed or added | |
|
| create_torrent.hpp | | create_torrent.hpp | |
| | | | |
| skipping to change at line 190 | | skipping to change at line 190 | |
| inline void add_files(file_storage& fs, boost::filesystem::path cons
t& file) | | inline void add_files(file_storage& fs, boost::filesystem::path cons
t& file) | |
| { | | { | |
| #if BOOST_VERSION < 103600 | | #if BOOST_VERSION < 103600 | |
| detail::add_files_impl(fs, complete(file).branch_path(), fil
e.leaf(), detail::default_pred); | | detail::add_files_impl(fs, complete(file).branch_path(), fil
e.leaf(), detail::default_pred); | |
| #else | | #else | |
| 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 | | void set_piece_hashes(create_torrent& t, boost::filesystem::path con | |
| st& p, Fun f) | | st& p, Fun f | |
| | | , 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()), 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()) | |
| | | { | |
| | | ec = st->error(); | |
| | | return; | |
| | | } | |
| hasher h(&buf[0], t.piece_size(i)); | | hasher h(&buf[0], t.piece_size(i)); | |
| t.set_hash(i, h.final()); | | t.set_hash(i, h.final()); | |
| f(i); | | f(i); | |
| } | | } | |
| } | | } | |
| | | | |
|
| | | template <class Fun> | |
| | | void set_piece_hashes(create_torrent& t, boost::filesystem::path con | |
| | | st& p, Fun f) | |
| | | { | |
| | | error_code ec; | |
| | | set_piece_hashes(t, p, f, ec); | |
| | | if (ec) throw libtorrent_exception(ec); | |
| | | } | |
| | | | |
| inline void set_piece_hashes(create_torrent& t, boost::filesystem::p
ath const& p) | | inline void set_piece_hashes(create_torrent& t, boost::filesystem::p
ath const& p) | |
| { | | { | |
|
| set_piece_hashes(t, p, detail::nop); | | error_code ec; | |
| | | set_piece_hashes(t, p, detail::nop, ec); | |
| | | if (ec) throw libtorrent_exception(ec); | |
| } | | } | |
| | | | |
|
| | | inline void set_piece_hashes(create_torrent& t, boost::filesystem::p | |
| | | ath const& p, error_code& ec) | |
| | | { | |
| | | set_piece_hashes(t, p, detail::nop, ec); | |
| | | } | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 5 change blocks. |
| 3 lines changed or deleted | | 25 lines changed or added | |
|
| disk_io_thread.hpp | | disk_io_thread.hpp | |
| | | | |
| skipping to change at line 224 | | skipping to change at line 224 | |
| // the number of blocks in the cache for this piece | | // the number of blocks in the cache for this piece | |
| int num_blocks; | | int num_blocks; | |
| // the pointers to the block data | | // the pointers to the block data | |
| boost::shared_array<char*> blocks; | | boost::shared_array<char*> blocks; | |
| }; | | }; | |
| | | | |
| typedef boost::recursive_mutex mutex_t; | | typedef boost::recursive_mutex mutex_t; | |
| typedef std::list<cached_piece_entry> cache_t; | | typedef std::list<cached_piece_entry> cache_t; | |
| | | | |
| bool test_error(disk_io_job& j); | | bool test_error(disk_io_job& j); | |
|
| | | void post_callback(boost::function<void(int, disk_io_job con | |
| | | st&)> const& handler | |
| | | , disk_io_job const& j, int ret); | |
| | | | |
| // 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); | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 3 lines changed or added | |
|
| error_code.hpp | | error_code.hpp | |
| | | | |
| skipping to change at line 44 | | skipping to change at line 44 | |
| #define TORRENT_ERROR_CODE_HPP_INCLUDED | | #define TORRENT_ERROR_CODE_HPP_INCLUDED | |
| | | | |
| #include <boost/version.hpp> | | #include <boost/version.hpp> | |
| | | | |
| #if BOOST_VERSION < 103500 | | #if BOOST_VERSION < 103500 | |
| #include <asio/error_code.hpp> | | #include <asio/error_code.hpp> | |
| #else | | #else | |
| #include <boost/system/error_code.hpp> | | #include <boost/system/error_code.hpp> | |
| #endif | | #endif | |
| | | | |
|
| | | #include "libtorrent/config.hpp" | |
| | | #include <boost/shared_ptr.hpp> | |
| | | #include <string> | |
| | | | |
| namespace libtorrent | | namespace libtorrent | |
| { | | { | |
| | | | |
| namespace errors | | namespace errors | |
| { | | { | |
| enum error_code_enum | | enum error_code_enum | |
| { | | { | |
| no_error = 0, | | no_error = 0, | |
| file_collision | | file_collision | |
| }; | | }; | |
| | | | |
| skipping to change at line 82 | | skipping to change at line 86 | |
| using boost::system::error_code; | | using boost::system::error_code; | |
| inline boost::system::error_category const& get_system_category() | | inline boost::system::error_category const& get_system_category() | |
| { return boost::system::get_system_category(); } | | { return boost::system::get_system_category(); } | |
| inline boost::system::error_category const& get_posix_category() | | inline boost::system::error_category const& get_posix_category() | |
| #if BOOST_VERSION < 103600 | | #if BOOST_VERSION < 103600 | |
| { return boost::system::get_posix_category(); } | | { return boost::system::get_posix_category(); } | |
| #else | | #else | |
| { return boost::system::get_generic_category(); } | | { return boost::system::get_generic_category(); } | |
| #endif | | #endif | |
| #endif | | #endif | |
|
| | | | |
| | | #ifndef BOOST_NO_EXCEPTIONS | |
| | | struct TORRENT_EXPORT libtorrent_exception: std::exception | |
| | | { | |
| | | libtorrent_exception(error_code const& s): m_error(s) {} | |
| | | virtual const char* what() const throw() | |
| | | { | |
| | | if (!m_msg) m_msg.reset(new std::string(m_error.mess | |
| | | age())); | |
| | | return m_msg->c_str(); | |
| | | } | |
| | | virtual ~libtorrent_exception() throw() {} | |
| | | error_code error() const { return m_error; } | |
| | | private: | |
| | | error_code m_error; | |
| | | mutable boost::shared_ptr<std::string> m_msg; | |
| | | }; | |
| | | #endif | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 2 change blocks. |
| 0 lines changed or deleted | | 22 lines changed or added | |
|
| gzip.hpp | | gzip.hpp | |
| | | | |
| skipping to change at line 33 | | skipping to change at line 33 | |
| LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
| CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
| SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
| INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
| CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
| 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_GZIP_HPP_INCLUDED | |
| | | #define TORRENT_GZIP_HPP_INCLUDED | |
| | | | |
| | | #include "libtorrent/config.hpp" | |
| | | #include <string> | |
| | | #include <vector> | |
| | | | |
| namespace libtorrent | | namespace libtorrent | |
| { | | { | |
| | | | |
| TORRENT_EXPORT bool inflate_gzip( | | TORRENT_EXPORT bool inflate_gzip( | |
| char const* in, int size | | char const* in, int size | |
| , std::vector<char>& buffer | | , std::vector<char>& buffer | |
| , int maximum_size | | , int maximum_size | |
| , std::string& error); | | , std::string& error); | |
| | | | |
| } | | } | |
|
| | | | |
| | | #endif | |
| | | | |
End of changes. 2 change blocks. |
| 0 lines changed or deleted | | 7 lines changed or added | |
|
| peer_connection.hpp | | peer_connection.hpp | |
| | | | |
| skipping to change at line 102 | | skipping to change at line 102 | |
| struct session_impl; | | struct session_impl; | |
| } | | } | |
| | | | |
| struct pending_block | | struct pending_block | |
| { | | { | |
| pending_block(piece_block const& b): skipped(0), block(b) {} | | pending_block(piece_block const& b): skipped(0), block(b) {} | |
| int skipped; | | int skipped; | |
| // the number of times the request | | // the number of times the request | |
| // has been skipped by out of order blocks | | // has been skipped by out of order blocks | |
| piece_block block; | | piece_block block; | |
|
| | | | |
| | | bool operator==(pending_block const& b) | |
| | | { return b.skipped == skipped && b.block == block; } | |
| }; | | }; | |
| | | | |
| struct has_block | | struct has_block | |
| { | | { | |
| has_block(piece_block const& b): block(b) {} | | has_block(piece_block const& b): block(b) {} | |
| piece_block const& block; | | piece_block const& block; | |
| bool operator()(pending_block const& pb) const | | bool operator()(pending_block const& pb) const | |
| { return pb.block == block; } | | { return pb.block == block; } | |
| }; | | }; | |
| | | | |
| | | | |
| skipping to change at line 587 | | skipping to change at line 590 | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| private: | | private: | |
| | | | |
| void fill_send_buffer(); | | void fill_send_buffer(); | |
| void on_disk_read_complete(int ret, disk_io_job const& j, pe
er_request r); | | void on_disk_read_complete(int ret, disk_io_job const& j, pe
er_request r); | |
| void on_disk_write_complete(int ret, disk_io_job const& j | | void on_disk_write_complete(int ret, disk_io_job const& j | |
| , peer_request r, boost::shared_ptr<torrent> t); | | , peer_request r, boost::shared_ptr<torrent> t); | |
| | | | |
|
| | | // keep the io_service running as long as we | |
| | | // have peer connections | |
| | | io_service::work m_work; | |
| | | | |
| // the time when we last got a part of a | | // the time when we last got a part of a | |
| // piece packet from this peer | | // piece packet from this peer | |
| ptime m_last_piece; | | ptime m_last_piece; | |
| // the time we sent a request to | | // the time we sent a request to | |
| // this peer the last time | | // this peer the last time | |
| ptime m_last_request; | | ptime m_last_request; | |
| // the time we received the last | | // the time we received the last | |
| // piece request from the peer | | // piece request from the peer | |
| ptime m_last_incoming_request; | | ptime m_last_incoming_request; | |
| // the time when we unchoked this peer | | // the time when we unchoked this peer | |
| | | | |
End of changes. 2 change blocks. |
| 0 lines changed or deleted | | 7 lines changed or added | |
|
| policy.hpp | | policy.hpp | |
| | | | |
| skipping to change at line 249 | | skipping to change at line 249 | |
| }; | | }; | |
| | | | |
| int num_peers() const { return m_peers.size(); } | | int num_peers() const { return m_peers.size(); } | |
| | | | |
| typedef std::multimap<address, peer>::iterator iterator; | | typedef std::multimap<address, peer>::iterator iterator; | |
| typedef std::multimap<address, peer>::const_iterator const_i
terator; | | typedef std::multimap<address, peer>::const_iterator const_i
terator; | |
| iterator begin_peer() { return m_peers.begin(); } | | iterator begin_peer() { return m_peers.begin(); } | |
| iterator end_peer() { return m_peers.end(); } | | iterator end_peer() { return m_peers.end(); } | |
| const_iterator begin_peer() const { return m_peers.begin();
} | | const_iterator begin_peer() const { return m_peers.begin();
} | |
| 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) | |
| | | { 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) | | if (m_num_connect_candidates == 0) | |
| | | | |
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 153 | | skipping to change at line 153 | |
| } | | } | |
| #endif | | #endif | |
| void operator()(); | | void operator()(); | |
| | | | |
| void open_listen_port(); | | void open_listen_port(); | |
| | | | |
| // if we are listening on an IPv6 interface | | // if we are listening on an IPv6 interface | |
| // this will return one of the IPv6 addresses on thi
s | | // this will return one of the IPv6 addresses on thi
s | |
| // machine, otherwise just an empty endpoint | | // machine, otherwise just an empty endpoint | |
| tcp::endpoint get_ipv6_interface() const; | | tcp::endpoint get_ipv6_interface() const; | |
|
| | | tcp::endpoint get_ipv4_interface() const; | |
| | | | |
| void async_accept(boost::shared_ptr<socket_acceptor>
const& listener); | | void async_accept(boost::shared_ptr<socket_acceptor>
const& listener); | |
| void on_incoming_connection(boost::shared_ptr<socket
_type> const& s | | void on_incoming_connection(boost::shared_ptr<socket
_type> const& s | |
| , boost::weak_ptr<socket_acceptor> listener,
error_code const& e); | | , boost::weak_ptr<socket_acceptor> listener,
error_code const& e); | |
| | | | |
| // must be locked to access the data | | // must be locked to access the data | |
| // in this struct | | // in this struct | |
| typedef boost::recursive_mutex mutex_t; | | typedef boost::recursive_mutex mutex_t; | |
| mutable mutex_t m_mutex; | | mutable mutex_t m_mutex; | |
| | | | |
| | | | |
| skipping to change at line 417 | | skipping to change at line 418 | |
| // we are supposed to listen on. | | // we are supposed to listen on. | |
| // if the ip is set to zero, it means | | // if the ip is set to zero, it means | |
| // that we should let the os decide which | | // that we should let the os decide which | |
| // interface to listen on | | // interface to listen on | |
| tcp::endpoint m_listen_interface; | | tcp::endpoint m_listen_interface; | |
| | | | |
| // if we're listening on an IPv6 interface | | // if we're listening on an IPv6 interface | |
| // this is one of the non local IPv6 interfaces | | // this is one of the non local IPv6 interfaces | |
| // on this machine | | // on this machine | |
| tcp::endpoint m_ipv6_interface; | | tcp::endpoint m_ipv6_interface; | |
|
| | | tcp::endpoint m_ipv4_interface; | |
| | | | |
| struct listen_socket_t | | struct listen_socket_t | |
| { | | { | |
| listen_socket_t(): external_port(0) {} | | listen_socket_t(): external_port(0) {} | |
| // this is typically set to the same as the
local | | // this is typically set to the same as the
local | |
| // listen port. In case a NAT port forward w
as | | // listen port. In case a NAT port forward w
as | |
| // successfully opened, this will be set to
the | | // successfully opened, this will be set to
the | |
| // port that is open on the external (NAT) i
nterface | | // port that is open on the external (NAT) i
nterface | |
| // on the NAT box itself. This is the port t
hat has | | // on the NAT box itself. This is the port t
hat has | |
| // to be published to peers, since this is t
he port | | // to be published to peers, since this is t
he port | |
| | | | |
End of changes. 2 change blocks. |
| 0 lines changed or deleted | | 2 lines changed or added | |
|
| socket.hpp | | socket.hpp | |
| | | | |
| skipping to change at line 217 | | skipping to change at line 217 | |
| template<class Protocol> | | template<class Protocol> | |
| int name(Protocol const&) const { return IPV6_V6ONLY; } | | int name(Protocol const&) const { return IPV6_V6ONLY; } | |
| template<class Protocol> | | template<class Protocol> | |
| int const* data(Protocol const&) const { return &m_value; } | | int const* data(Protocol const&) const { return &m_value; } | |
| template<class Protocol> | | template<class Protocol> | |
| size_t size(Protocol const&) const { return sizeof(m_value);
} | | size_t size(Protocol const&) const { return sizeof(m_value);
} | |
| int m_value; | | int m_value; | |
| }; | | }; | |
| | | | |
| #ifdef TORRENT_WINDOWS | | #ifdef TORRENT_WINDOWS | |
|
| | | | |
| | | #ifndef IPV6_PROTECTION_LEVEL | |
| | | #define IPV6_PROTECTION_LEVEL 30 | |
| | | #endif | |
| struct v6_protection_level | | struct v6_protection_level | |
| { | | { | |
| v6_protection_level(int level): m_value(level) {} | | v6_protection_level(int level): m_value(level) {} | |
| template<class Protocol> | | template<class Protocol> | |
| int level(Protocol const&) const { return IPPROTO_IPV6; } | | int level(Protocol const&) const { return IPPROTO_IPV6; } | |
| template<class Protocol> | | template<class Protocol> | |
| int name(Protocol const&) const { return IPV6_PROTECTION_LEV
EL; } | | int name(Protocol const&) const { return IPV6_PROTECTION_LEV
EL; } | |
| template<class Protocol> | | template<class Protocol> | |
| int const* data(Protocol const&) const { return &m_value; } | | int const* data(Protocol const&) const { return &m_value; } | |
| template<class Protocol> | | template<class Protocol> | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 4 lines changed or added | |
|
| storage.hpp | | storage.hpp | |
| | | | |
| skipping to change at line 125 | | skipping to change at line 125 | |
| | | | |
| struct TORRENT_EXPORT storage_interface | | struct TORRENT_EXPORT storage_interface | |
| { | | { | |
| // create directories and set file sizes | | // create directories and set file sizes | |
| // if allocate_files is true. | | // if allocate_files is true. | |
| // allocate_files is true if allocation mode | | // allocate_files is true if allocation mode | |
| // is set to full and sparse files are supported | | // is set to full and sparse files are supported | |
| // false return value indicates an error | | // false return value indicates an error | |
| virtual bool initialize(bool allocate_files) = 0; | | virtual bool initialize(bool allocate_files) = 0; | |
| | | | |
|
| | | virtual bool has_any_file() = 0; | |
| | | | |
| // negative return value indicates an error | | // negative return value indicates an error | |
| virtual int read(char* buf, int slot, int offset, int size)
= 0; | | virtual int read(char* buf, int slot, int offset, int size)
= 0; | |
| | | | |
| // negative return value indicates an error | | // negative return value indicates an error | |
| virtual int write(const char* buf, int slot, int offset, int
size) = 0; | | virtual int write(const char* buf, int slot, int offset, int
size) = 0; | |
| | | | |
| // non-zero return value indicates an error | | // non-zero return value indicates an error | |
| virtual bool move_storage(fs::path save_path) = 0; | | virtual bool move_storage(fs::path save_path) = 0; | |
| | | | |
| // verify storage dependent fast resume entries | | // verify storage dependent fast resume entries | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 2 lines changed or added | |
|
| tracker_manager.hpp | | tracker_manager.hpp | |
| | | | |
| skipping to change at line 111 | | skipping to change at line 111 | |
| peer_id pid; | | peer_id pid; | |
| size_type downloaded; | | size_type downloaded; | |
| size_type uploaded; | | size_type uploaded; | |
| size_type left; | | size_type left; | |
| unsigned short listen_port; | | unsigned short listen_port; | |
| event_t event; | | event_t event; | |
| std::string url; | | std::string url; | |
| int key; | | int key; | |
| int num_want; | | int num_want; | |
| std::string ipv6; | | std::string ipv6; | |
|
| | | std::string ipv4; | |
| }; | | }; | |
| | | | |
| struct TORRENT_EXPORT request_callback | | struct TORRENT_EXPORT request_callback | |
| { | | { | |
| friend class tracker_manager; | | friend class tracker_manager; | |
| request_callback(): m_manager(0) {} | | request_callback(): m_manager(0) {} | |
| virtual ~request_callback() {} | | virtual ~request_callback() {} | |
| virtual void tracker_warning(tracker_request const& req | | virtual void tracker_warning(tracker_request const& req | |
| , std::string const& msg) = 0; | | , std::string const& msg) = 0; | |
| virtual void tracker_scrape_response(tracker_request const&
req | | virtual void tracker_scrape_response(tracker_request const&
req | |
| | | | |
End of changes. 1 change blocks. |
| 0 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 "0.14.2.0" | | #define LIBTORRENT_VERSION "0.14.3.0" | |
| #define LIBTORRENT_REVISION "$Rev: 3169 $" | | #define LIBTORRENT_REVISION "$Rev: 3323 $" | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 2 change blocks. |
| 2 lines changed or deleted | | 3 lines changed or added | |
|