| broadcast_socket.hpp | | broadcast_socket.hpp | |
| | | | |
| skipping to change at line 92 | | skipping to change at line 92 | |
| if (!socket) return; | | if (!socket) return; | |
| error_code ec; | | error_code ec; | |
| socket->close(ec); | | socket->close(ec); | |
| } | | } | |
| }; | | }; | |
| | | | |
| void on_receive(socket_entry* s, error_code const& ec | | void on_receive(socket_entry* s, error_code const& ec | |
| , std::size_t bytes_transferred); | | , std::size_t bytes_transferred); | |
| void open_unicast_socket(io_service& ios, address const& add
r); | | void open_unicast_socket(io_service& ios, address const& add
r); | |
| void open_multicast_socket(io_service& ios, address const& a
ddr | | void open_multicast_socket(io_service& ios, address const& a
ddr | |
|
| , bool loopback); | | , bool loopback, error_code& ec); | |
| | | | |
| // these sockets are used to | | // these sockets are used to | |
| // join the multicast group (on each interface) | | // join the multicast group (on each interface) | |
| // and receive multicast messages | | // and receive multicast messages | |
| std::list<socket_entry> m_sockets; | | std::list<socket_entry> m_sockets; | |
| // these sockets are not bound to any | | // these sockets are not bound to any | |
| // specific port and are used to | | // specific port and are used to | |
| // send messages to the multicast group | | // send messages to the multicast group | |
| // and receive unicast responses | | // and receive unicast responses | |
| std::list<socket_entry> m_unicast_sockets; | | std::list<socket_entry> m_unicast_sockets; | |
| | | | |
End of changes. 1 change blocks. |
| 1 lines changed or deleted | | 1 lines changed or added | |
|
| create_torrent.hpp | | create_torrent.hpp | |
| | | | |
| skipping to change at line 146 | | skipping to change at line 146 | |
| inline bool default_pred(boost::filesystem::path const&) { r
eturn true; } | | inline bool default_pred(boost::filesystem::path const&) { r
eturn true; } | |
| | | | |
| inline void nop(int i) {} | | inline void nop(int i) {} | |
| | | | |
| template <class Pred> | | template <class Pred> | |
| void add_files_impl(file_storage& fs, boost::filesystem::pat
h const& p | | void add_files_impl(file_storage& fs, boost::filesystem::pat
h const& p | |
| , boost::filesystem::path const& l, Pred pred) | | , boost::filesystem::path const& l, Pred pred) | |
| { | | { | |
| using boost::filesystem::path; | | using boost::filesystem::path; | |
| using boost::filesystem::directory_iterator; | | using boost::filesystem::directory_iterator; | |
|
| #if BOOST_VERSION < 103600 | | | |
| std::string const& leaf = l.leaf(); | | | |
| #else | | | |
| std::string const& leaf = l.filename(); | | | |
| #endif | | | |
| if (leaf == ".." || leaf == ".") return; | | | |
| if (!pred(l)) return; | | if (!pred(l)) return; | |
| path f(p / l); | | path f(p / l); | |
| if (is_directory(f)) | | if (is_directory(f)) | |
| { | | { | |
| for (directory_iterator i(f), end; i != end;
++i) | | for (directory_iterator i(f), end; i != end;
++i) | |
|
| | | { | |
| #if BOOST_VERSION < 103600 | | #if BOOST_VERSION < 103600 | |
|
| add_files_impl(fs, p, l / i->path().
leaf(), pred); | | std::string leaf = i->path().leaf(); | |
| #else | | #else | |
|
| add_files_impl(fs, p, l / i->path().
filename(), pred); | | std::string leaf = i->path().filenam
e(); | |
| #endif | | #endif | |
|
| | | if (leaf == ".." || leaf == ".") con | |
| | | tinue; | |
| | | add_files_impl(fs, p, l / leaf, pred | |
| | | ); | |
| | | } | |
| } | | } | |
| else | | else | |
| { | | { | |
| fs.add_file(l, file_size(f)); | | fs.add_file(l, file_size(f)); | |
| } | | } | |
| } | | } | |
| } | | } | |
| | | | |
| template <class Pred> | | template <class Pred> | |
| void add_files(file_storage& fs, boost::filesystem::path const& file
, Pred p) | | void add_files(file_storage& fs, boost::filesystem::path const& file
, Pred p) | |
| { | | { | |
|
| | | boost::filesystem::path f = file; | |
| #if BOOST_VERSION < 103600 | | #if BOOST_VERSION < 103600 | |
|
| detail::add_files_impl(fs, complete(file).branch_path(), fil | | if (f.leaf() == ".") f = f.branch_path(); | |
| e.leaf(), p); | | detail::add_files_impl(fs, complete(f).branch_path(), f.leaf | |
| | | (), p); | |
| #else | | #else | |
|
| detail::add_files_impl(fs, complete(file).parent_path(), fil | | if (f.filename() == ".") f = f.parent_path(); | |
| e.filename(), p); | | detail::add_files_impl(fs, complete(f).parent_path(), f.file | |
| | | name(), p); | |
| #endif | | #endif | |
| } | | } | |
| | | | |
| 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) | |
| { | | { | |
|
| | | boost::filesystem::path f = file; | |
| #if BOOST_VERSION < 103600 | | #if BOOST_VERSION < 103600 | |
|
| detail::add_files_impl(fs, complete(file).branch_path(), fil | | if (f.leaf() == ".") f = f.branch_path(); | |
| e.leaf(), detail::default_pred); | | detail::add_files_impl(fs, complete(f).branch_path(), f.leaf | |
| | | (), detail::default_pred); | |
| #else | | #else | |
|
| detail::add_files_impl(fs, complete(file).parent_path(), fil | | if (f.filename() == ".") f = f.parent_path(); | |
| e.filename(), detail::default_pred); | | detail::add_files_impl(fs, complete(f).parent_path(), f.file | |
| | | name(), 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()), 0, p, fp)); | | default_storage_constructor(const_cast<file_storage&
>(t.files()), 0, p, fp)); | |
| | | | |
| skipping to change at line 216 | | skipping to change at line 220 | |
| { | | { | |
| ec = st->error(); | | ec = st->error(); | |
| return; | | 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); | |
| } | | } | |
| } | | } | |
| | | | |
|
| | | #ifndef BOOST_NO_EXCEPTIONS | |
| 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; | |
| 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, boost::filesystem::p
ath const& p) | | inline void set_piece_hashes(create_torrent& t, boost::filesystem::p
ath 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 | |
| | | | |
| inline void set_piece_hashes(create_torrent& t, boost::filesystem::p
ath const& p, error_code& 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); | | set_piece_hashes(t, p, detail::nop, ec); | |
| } | | } | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 13 change blocks. |
| 16 lines changed or deleted | | 24 lines changed or added | |
|
| session_impl.hpp | | session_impl.hpp | |
| | | | |
| skipping to change at line 44 | | skipping to change at line 44 | |
| #define TORRENT_SESSION_IMPL_HPP_INCLUDED | | #define TORRENT_SESSION_IMPL_HPP_INCLUDED | |
| | | | |
| #include <ctime> | | #include <ctime> | |
| #include <algorithm> | | #include <algorithm> | |
| #include <vector> | | #include <vector> | |
| #include <set> | | #include <set> | |
| #include <list> | | #include <list> | |
| #include <deque> | | #include <deque> | |
| | | | |
| #ifndef TORRENT_DISABLE_GEO_IP | | #ifndef TORRENT_DISABLE_GEO_IP | |
|
| | | #ifdef WITH_SHIPPED_GEOIP_H | |
| #include "libtorrent/GeoIP.h" | | #include "libtorrent/GeoIP.h" | |
|
| | | #else | |
| | | #include <GeoIP.h> | |
| | | #endif | |
| #endif | | #endif | |
| | | | |
| #ifdef _MSC_VER | | #ifdef _MSC_VER | |
| #pragma warning(push, 1) | | #pragma warning(push, 1) | |
| #endif | | #endif | |
| | | | |
| #include <boost/limits.hpp> | | #include <boost/limits.hpp> | |
| #include <boost/tuple/tuple.hpp> | | #include <boost/tuple/tuple.hpp> | |
| #include <boost/filesystem/path.hpp> | | #include <boost/filesystem/path.hpp> | |
| #include <boost/thread.hpp> | | #include <boost/thread.hpp> | |
| | | | |
| skipping to change at line 73 | | skipping to change at line 77 | |
| #include "libtorrent/entry.hpp" | | #include "libtorrent/entry.hpp" | |
| #include "libtorrent/socket.hpp" | | #include "libtorrent/socket.hpp" | |
| #include "libtorrent/peer_id.hpp" | | #include "libtorrent/peer_id.hpp" | |
| #include "libtorrent/tracker_manager.hpp" | | #include "libtorrent/tracker_manager.hpp" | |
| #include "libtorrent/alert.hpp" | | #include "libtorrent/alert.hpp" | |
| #include "libtorrent/debug.hpp" | | #include "libtorrent/debug.hpp" | |
| #include "libtorrent/piece_block_progress.hpp" | | #include "libtorrent/piece_block_progress.hpp" | |
| #include "libtorrent/ip_filter.hpp" | | #include "libtorrent/ip_filter.hpp" | |
| #include "libtorrent/config.hpp" | | #include "libtorrent/config.hpp" | |
| #include "libtorrent/session_settings.hpp" | | #include "libtorrent/session_settings.hpp" | |
|
| #include "libtorrent/kademlia/dht_tracker.hpp" | | | |
| #include "libtorrent/session_status.hpp" | | #include "libtorrent/session_status.hpp" | |
| #include "libtorrent/session.hpp" | | #include "libtorrent/session.hpp" | |
| #include "libtorrent/stat.hpp" | | #include "libtorrent/stat.hpp" | |
| #include "libtorrent/file_pool.hpp" | | #include "libtorrent/file_pool.hpp" | |
| #include "libtorrent/bandwidth_manager.hpp" | | #include "libtorrent/bandwidth_manager.hpp" | |
| #include "libtorrent/socket_type.hpp" | | #include "libtorrent/socket_type.hpp" | |
| #include "libtorrent/connection_queue.hpp" | | #include "libtorrent/connection_queue.hpp" | |
| #include "libtorrent/disk_io_thread.hpp" | | #include "libtorrent/disk_io_thread.hpp" | |
| #include "libtorrent/assert.hpp" | | #include "libtorrent/assert.hpp" | |
|
| | | #include "libtorrent/udp_socket.hpp" | |
| | | | |
| namespace libtorrent | | namespace libtorrent | |
| { | | { | |
| | | | |
| namespace fs = boost::filesystem; | | namespace fs = boost::filesystem; | |
| class peer_connection; | | class peer_connection; | |
| class upnp; | | class upnp; | |
| class natpmp; | | class natpmp; | |
| class lsd; | | class lsd; | |
| class fingerprint; | | class fingerprint; | |
| | | | |
| namespace dht | | namespace dht | |
| { | | { | |
| class dht_tracker; | | class dht_tracker; | |
|
| }; | | } | |
| | | | |
| namespace aux | | namespace aux | |
| { | | { | |
| struct session_impl; | | struct session_impl; | |
| | | | |
| #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined T
ORRENT_ERROR_LOGGING | | #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined T
ORRENT_ERROR_LOGGING | |
| struct tracker_logger; | | struct tracker_logger; | |
| #endif | | #endif | |
| | | | |
| // this is the link between the main thread and the | | // this is the link between the main thread and the | |
| | | | |
End of changes. 5 change blocks. |
| 2 lines changed or deleted | | 6 lines changed or added | |
|
| torrent.hpp | | torrent.hpp | |
| | | | |
| skipping to change at line 404 | | skipping to change at line 404 | |
| ptime next_announce() const; | | ptime next_announce() const; | |
| | | | |
| // forcefully sets next_announce to the current time | | // forcefully sets next_announce to the current time | |
| void force_tracker_request(); | | void force_tracker_request(); | |
| void force_tracker_request(ptime); | | void force_tracker_request(ptime); | |
| void scrape_tracker(); | | void scrape_tracker(); | |
| void announce_with_tracker(tracker_request::event_t e | | void announce_with_tracker(tracker_request::event_t e | |
| = tracker_request::none); | | = tracker_request::none); | |
| ptime const& last_scrape() const { return m_last_scrape; } | | ptime const& last_scrape() const { return m_last_scrape; } | |
| | | | |
|
| | | #ifndef TORRENT_DISABLE_DHT | |
| | | void force_dht_announce(); | |
| | | #endif | |
| | | | |
| // sets the username and password that will be sent to | | // sets the username and password that will be sent to | |
| // the tracker | | // the tracker | |
| void set_tracker_login(std::string const& name, std::string
const& pw); | | void set_tracker_login(std::string const& name, std::string
const& pw); | |
| | | | |
| // the tcp::endpoint of the tracker that we managed to | | // the tcp::endpoint of the tracker that we managed to | |
| // announce ourself at the last time we tried to announce | | // announce ourself at the last time we tried to announce | |
| const tcp::endpoint& current_tracker() const; | | const tcp::endpoint& current_tracker() const; | |
| | | | |
| // -------------------------------------------- | | // -------------------------------------------- | |
| // PIECE MANAGEMENT | | // PIECE MANAGEMENT | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 4 lines changed or added | |
|