bitfield.hpp | bitfield.hpp | |||
---|---|---|---|---|
skipping to change at line 39 | skipping to change at line 39 | |||
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 | #include <cstring> // for memset and memcpy | |||
#include <cstdlib> // for malloc, free and realloc | ||||
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 | |||
bt_peer_connection.hpp | bt_peer_connection.hpp | |||
---|---|---|---|---|
skipping to change at line 278 | skipping to change at line 278 | |||
// stream key (info hash of attached torrent) | // stream key (info hash of attached torrent) | |||
// secret is the DH shared secret | // secret is the DH shared secret | |||
// initializes m_RC4_handler | // initializes m_RC4_handler | |||
void init_pe_RC4_handler(char const* secret, sha1_hash const & stream_key); | void init_pe_RC4_handler(char const* secret, sha1_hash const & stream_key); | |||
public: | public: | |||
// these functions encrypt the send buffer if m_rc4_encrypte d | // these functions encrypt the send buffer if m_rc4_encrypte d | |||
// is true, otherwise it passes the call to the | // is true, otherwise it passes the call to the | |||
// peer_connection functions of the same names | // peer_connection functions of the same names | |||
virtual void append_const_send_buffer(char const* buffer, in t size); | ||||
void send_buffer(char const* buf, int size, int flags = 0); | void send_buffer(char const* buf, int size, int flags = 0); | |||
buffer::interval allocate_send_buffer(int size); | buffer::interval allocate_send_buffer(int size); | |||
template <class Destructor> | template <class Destructor> | |||
void append_send_buffer(char* buffer, int size, Destructor c onst& destructor) | void append_send_buffer(char* buffer, int size, Destructor c onst& destructor) | |||
{ | { | |||
#ifndef TORRENT_DISABLE_ENCRYPTION | #ifndef TORRENT_DISABLE_ENCRYPTION | |||
if (m_rc4_encrypted) | if (m_rc4_encrypted) | |||
{ | { | |||
TORRENT_ASSERT(send_buffer_size() == m_encry pted_bytes); | TORRENT_ASSERT(send_buffer_size() == m_encry pted_bytes); | |||
m_RC4_handler->encrypt(buffer, size); | m_RC4_handler->encrypt(buffer, size); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
http_connection.hpp | http_connection.hpp | |||
---|---|---|---|---|
skipping to change at line 62 | skipping to change at line 62 | |||
#ifdef TORRENT_USE_OPENSSL | #ifdef TORRENT_USE_OPENSSL | |||
#include "libtorrent/ssl_stream.hpp" | #include "libtorrent/ssl_stream.hpp" | |||
#include "libtorrent/variant_stream.hpp" | #include "libtorrent/variant_stream.hpp" | |||
#endif | #endif | |||
namespace libtorrent | namespace libtorrent | |||
{ | { | |||
struct http_connection; | struct http_connection; | |||
class connection_queue; | class connection_queue; | |||
class ip_filter; | ||||
typedef boost::function<void(error_code const& | typedef boost::function<void(error_code const& | |||
, http_parser const&, char const* data, int size, http_connection&)> http_handler; | , http_parser const&, char const* data, int size, http_connection&)> http_handler; | |||
typedef boost::function<void(http_connection&)> http_connect_handler; | typedef boost::function<void(http_connection&)> http_connect_handler; | |||
// TODO: add bind interface | // TODO: add bind interface | |||
// when bottled, the last two arguments to the handler | // when bottled, the last two arguments to the handler | |||
// will always be 0 | // will always be 0 | |||
struct http_connection : boost::enable_shared_from_this<http_connection>, b oost::noncopyable | struct http_connection : boost::enable_shared_from_this<http_connection>, b oost::noncopyable | |||
{ | { | |||
http_connection(io_service& ios, connection_queue& cc | http_connection(io_service& ios, connection_queue& cc | |||
, http_handler const& handler, bool bottled = true | , http_handler const& handler, bool bottled = true | |||
, http_connect_handler const& ch = http_connect_handler()) | , http_connect_handler const& ch = http_connect_handler() | |||
, ip_filter const* ipf = 0) | ||||
: m_sock(ios) | : m_sock(ios) | |||
, m_read_pos(0) | , m_read_pos(0) | |||
, m_resolver(ios) | , m_resolver(ios) | |||
, m_handler(handler) | , m_handler(handler) | |||
, m_connect_handler(ch) | , m_connect_handler(ch) | |||
, m_timer(ios) | , m_timer(ios) | |||
, m_last_receive(time_now()) | , m_last_receive(time_now()) | |||
, m_bottled(bottled) | , m_bottled(bottled) | |||
, m_called(false) | , m_called(false) | |||
, m_rate_limit(0) | , m_rate_limit(0) | |||
, m_download_quota(0) | , m_download_quota(0) | |||
, m_limiter_timer_active(false) | , m_limiter_timer_active(false) | |||
, m_limiter_timer(ios) | , m_limiter_timer(ios) | |||
, m_redirects(5) | , m_redirects(5) | |||
, m_connection_ticket(-1) | , m_connection_ticket(-1) | |||
, m_cc(cc) | , m_cc(cc) | |||
, m_ssl(false) | , m_ssl(false) | |||
, m_priority(0) | , m_priority(0) | |||
, m_abort(false) | , m_abort(false) | |||
, m_ip_filter(ipf) | ||||
{ | { | |||
TORRENT_ASSERT(!m_handler.empty()); | TORRENT_ASSERT(!m_handler.empty()); | |||
} | } | |||
void rate_limit(int limit); | void rate_limit(int limit); | |||
int rate_limit() const | int rate_limit() const | |||
{ return m_rate_limit; } | { return m_rate_limit; } | |||
std::string sendbuffer; | std::string sendbuffer; | |||
skipping to change at line 205 | skipping to change at line 208 | |||
// the address to bind to. address_v4::any() | // the address to bind to. address_v4::any() | |||
// means do not bind | // means do not bind | |||
address m_bind_addr; | address m_bind_addr; | |||
// the priority we have in the connection queue. | // the priority we have in the connection queue. | |||
// 0 is normal, 1 is high | // 0 is normal, 1 is high | |||
int m_priority; | int m_priority; | |||
bool m_abort; | bool m_abort; | |||
ip_filter const* m_ip_filter; | ||||
}; | }; | |||
} | } | |||
#endif | #endif | |||
End of changes. 4 change blocks. | ||||
1 lines changed or deleted | 6 lines changed or added | |||
http_tracker_connection.hpp | http_tracker_connection.hpp | |||
---|---|---|---|---|
skipping to change at line 60 | skipping to change at line 60 | |||
#include "libtorrent/config.hpp" | #include "libtorrent/config.hpp" | |||
namespace libtorrent | namespace libtorrent | |||
{ | { | |||
struct http_connection; | struct http_connection; | |||
class entry; | class entry; | |||
class http_parser; | class http_parser; | |||
class connection_queue; | class connection_queue; | |||
struct session_settings; | struct session_settings; | |||
class ip_filter; | ||||
class TORRENT_EXPORT http_tracker_connection | class TORRENT_EXPORT http_tracker_connection | |||
: public tracker_connection | : public tracker_connection | |||
{ | { | |||
friend class tracker_manager; | friend class tracker_manager; | |||
public: | public: | |||
http_tracker_connection( | http_tracker_connection( | |||
io_service& ios | io_service& ios | |||
, connection_queue& cc | , connection_queue& cc | |||
, tracker_manager& man | , tracker_manager& man | |||
, tracker_request const& req | , tracker_request const& req | |||
, address bind_infc | , address bind_infc | |||
, boost::weak_ptr<request_callback> c | , boost::weak_ptr<request_callback> c | |||
, session_settings const& stn | , session_settings const& stn | |||
, proxy_settings const& ps | , proxy_settings const& ps | |||
, std::string const& password = ""); | , std::string const& password = "" | |||
, ip_filter const* ipf = 0); | ||||
void start(); | void start(); | |||
void close(); | void close(); | |||
private: | private: | |||
boost::intrusive_ptr<http_tracker_connection> self() | boost::intrusive_ptr<http_tracker_connection> self() | |||
{ return boost::intrusive_ptr<http_tracker_connection>(this) ; } | { return boost::intrusive_ptr<http_tracker_connection>(this) ; } | |||
void on_response(error_code const& ec, http_parser const& pa rser | void on_response(error_code const& ec, http_parser const& pa rser | |||
skipping to change at line 101 | skipping to change at line 103 | |||
void parse(int status_code, const entry& e); | void parse(int status_code, const entry& e); | |||
bool extract_peer_info(const entry& e, peer_entry& ret); | bool extract_peer_info(const entry& e, peer_entry& ret); | |||
tracker_manager& m_man; | tracker_manager& m_man; | |||
boost::shared_ptr<http_connection> m_tracker_connection; | boost::shared_ptr<http_connection> m_tracker_connection; | |||
session_settings const& m_settings; | session_settings const& m_settings; | |||
address m_bind_iface; | address m_bind_iface; | |||
proxy_settings const& m_ps; | proxy_settings const& m_ps; | |||
connection_queue& m_cc; | connection_queue& m_cc; | |||
io_service& m_ios; | io_service& m_ios; | |||
ip_filter const* m_ip_filter; | ||||
}; | }; | |||
} | } | |||
#endif // TORRENT_HTTP_TRACKER_CONNECTION_HPP_INCLUDED | #endif // TORRENT_HTTP_TRACKER_CONNECTION_HPP_INCLUDED | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 4 lines changed or added | |||
peer_connection.hpp | peer_connection.hpp | |||
---|---|---|---|---|
skipping to change at line 449 | skipping to change at line 449 | |||
template <class Destructor> | template <class Destructor> | |||
void append_send_buffer(char* buffer, int size, Destructor c onst& destructor) | void append_send_buffer(char* buffer, int size, Destructor c onst& destructor) | |||
{ | { | |||
m_send_buffer.append_buffer(buffer, size, size, dest ructor); | m_send_buffer.append_buffer(buffer, size, size, dest ructor); | |||
#ifdef TORRENT_STATS | #ifdef TORRENT_STATS | |||
m_ses.m_buffer_usage_logger << log_time() << " appen d_send_buffer: " << size << std::endl; | m_ses.m_buffer_usage_logger << log_time() << " appen d_send_buffer: " << size << std::endl; | |||
m_ses.log_buffer_usage(); | m_ses.log_buffer_usage(); | |||
#endif | #endif | |||
} | } | |||
virtual void append_const_send_buffer(char const* buffer, in | ||||
t size); | ||||
#ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES | #ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES | |||
void set_country(char const* c) | void set_country(char const* c) | |||
{ | { | |||
TORRENT_ASSERT(strlen(c) == 2); | TORRENT_ASSERT(strlen(c) == 2); | |||
m_country[0] = c[0]; | m_country[0] = c[0]; | |||
m_country[1] = c[1]; | m_country[1] = c[1]; | |||
} | } | |||
bool has_country() const { return m_country[0] != 0; } | bool has_country() const { return m_country[0] != 0; } | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added | |||
session_impl.hpp | session_impl.hpp | |||
---|---|---|---|---|
skipping to change at line 469 | skipping to change at line 469 | |||
proxy_settings m_peer_proxy; | proxy_settings m_peer_proxy; | |||
proxy_settings m_web_seed_proxy; | proxy_settings m_web_seed_proxy; | |||
proxy_settings m_tracker_proxy; | proxy_settings m_tracker_proxy; | |||
#ifndef TORRENT_DISABLE_DHT | #ifndef TORRENT_DISABLE_DHT | |||
proxy_settings m_dht_proxy; | proxy_settings m_dht_proxy; | |||
#endif | #endif | |||
// set to true when the session object | // set to true when the session object | |||
// is being destructed and the thread | // is being destructed and the thread | |||
// should exit | // should exit | |||
volatile bool m_abort; | bool m_abort; | |||
// is true if the session is paused | // is true if the session is paused | |||
bool m_paused; | bool m_paused; | |||
// the max number of unchoked peers as set by the us er | // the max number of unchoked peers as set by the us er | |||
int m_max_uploads; | int m_max_uploads; | |||
// the number of unchoked peers as set by the auto-u nchoker | // the number of unchoked peers as set by the auto-u nchoker | |||
// this should always be >= m_max_uploads | // this should always be >= m_max_uploads | |||
int m_allowed_upload_slots; | int m_allowed_upload_slots; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
torrent.hpp | torrent.hpp | |||
---|---|---|---|---|
skipping to change at line 786 | skipping to change at line 786 | |||
void on_tracker_announce(); | void on_tracker_announce(); | |||
static void on_lsd_announce_disp(boost::weak_ptr<torrent> p | static void on_lsd_announce_disp(boost::weak_ptr<torrent> p | |||
, error_code const& e); | , error_code const& e); | |||
// this is called once every 5 minutes for torrents | // this is called once every 5 minutes for torrents | |||
// that are not private | // that are not private | |||
void on_lsd_announce(); | void on_lsd_announce(); | |||
#ifndef TORRENT_DISABLE_DHT | #ifndef TORRENT_DISABLE_DHT | |||
static void on_dht_announce_post(boost::weak_ptr<libtorrent: | ||||
:torrent> t | ||||
, std::vector<tcp::endpoint> const& peers); | ||||
static void on_dht_announce_response_disp(boost::weak_ptr<to rrent> t | static void on_dht_announce_response_disp(boost::weak_ptr<to rrent> t | |||
, std::vector<tcp::endpoint> const& peers); | , std::vector<tcp::endpoint> const& peers); | |||
void on_dht_announce_response(std::vector<tcp::endpoint> con st& peers); | void on_dht_announce_response(std::vector<tcp::endpoint> con st& peers); | |||
bool should_announce_dht() const; | bool should_announce_dht() const; | |||
// the time when the DHT was last announced of our | // the time when the DHT was last announced of our | |||
// presence on this torrent | // presence on this torrent | |||
ptime m_last_dht_announce; | ptime m_last_dht_announce; | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added | |||
tracker_manager.hpp | tracker_manager.hpp | |||
---|---|---|---|---|
skipping to change at line 73 | skipping to change at line 73 | |||
#include "libtorrent/time.hpp" | #include "libtorrent/time.hpp" | |||
#include "libtorrent/connection_queue.hpp" | #include "libtorrent/connection_queue.hpp" | |||
#include "libtorrent/intrusive_ptr_base.hpp" | #include "libtorrent/intrusive_ptr_base.hpp" | |||
namespace libtorrent | namespace libtorrent | |||
{ | { | |||
struct request_callback; | struct request_callback; | |||
class tracker_manager; | class tracker_manager; | |||
struct timeout_handler; | struct timeout_handler; | |||
struct tracker_connection; | struct tracker_connection; | |||
struct ip_filter; | ||||
// returns -1 if gzip header is invalid or the header size in bytes | // returns -1 if gzip header is invalid or the header size in bytes | |||
TORRENT_EXPORT int gzip_header(const char* buf, int size); | TORRENT_EXPORT int gzip_header(const char* buf, int size); | |||
struct TORRENT_EXPORT tracker_request | struct TORRENT_EXPORT tracker_request | |||
{ | { | |||
tracker_request() | tracker_request() | |||
: kind(announce_request) | : kind(announce_request) | |||
, event(none) | , event(none) | |||
, key(0) | , key(0) | |||
skipping to change at line 228 | skipping to change at line 229 | |||
, m_proxy(ps) | , m_proxy(ps) | |||
, m_abort(false) {} | , m_abort(false) {} | |||
void queue_request( | void queue_request( | |||
io_service& ios | io_service& ios | |||
, connection_queue& cc | , connection_queue& cc | |||
, tracker_request r | , tracker_request r | |||
, std::string const& auth | , std::string const& auth | |||
, address bind_infc | , address bind_infc | |||
, boost::weak_ptr<request_callback> c | , boost::weak_ptr<request_callback> c | |||
= boost::weak_ptr<request_callback>()); | = boost::weak_ptr<request_callback>() | |||
, ip_filter const* ipf = 0); | ||||
void abort_all_requests(); | void abort_all_requests(); | |||
void remove_request(tracker_connection const*); | void remove_request(tracker_connection const*); | |||
bool empty() const; | bool empty() const; | |||
int num_requests() const; | int num_requests() const; | |||
private: | private: | |||
typedef boost::recursive_mutex mutex_t; | typedef boost::recursive_mutex mutex_t; | |||
mutable mutex_t m_mutex; | mutable mutex_t m_mutex; | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 3 lines changed or added | |||
udp_socket.hpp | udp_socket.hpp | |||
---|---|---|---|---|
skipping to change at line 95 | skipping to change at line 95 | |||
void on_timeout(); | void on_timeout(); | |||
void on_connect(int ticket); | void on_connect(int ticket); | |||
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(mutex_t::scoped_lock& l); | void socks_forward_udp(mutex_t::scoped_lock& l); | |||
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 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 unwrap(error_code const& e, char const* buf, int size); | void unwrap(error_code const& e, char const* buf, int size); | |||
mutable mutex_t m_mutex; | mutable mutex_t m_mutex; | |||
udp::socket m_ipv4_sock; | udp::socket m_ipv4_sock; | |||
udp::socket m_ipv6_sock; | udp::socket m_ipv6_sock; | |||
udp::endpoint m_v4_ep; | udp::endpoint m_v4_ep; | |||
udp::endpoint m_v6_ep; | udp::endpoint m_v6_ep; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
udp_tracker_connection.hpp | udp_tracker_connection.hpp | |||
---|---|---|---|---|
skipping to change at line 62 | skipping to change at line 62 | |||
#include "libtorrent/udp_socket.hpp" | #include "libtorrent/udp_socket.hpp" | |||
#include "libtorrent/entry.hpp" | #include "libtorrent/entry.hpp" | |||
#include "libtorrent/session_settings.hpp" | #include "libtorrent/session_settings.hpp" | |||
#include "libtorrent/peer_id.hpp" | #include "libtorrent/peer_id.hpp" | |||
#include "libtorrent/peer.hpp" | #include "libtorrent/peer.hpp" | |||
#include "libtorrent/tracker_manager.hpp" | #include "libtorrent/tracker_manager.hpp" | |||
#include "libtorrent/config.hpp" | #include "libtorrent/config.hpp" | |||
namespace libtorrent | namespace libtorrent | |||
{ | { | |||
class ip_filter; | ||||
class TORRENT_EXPORT udp_tracker_connection: public tracker_connecti on | class TORRENT_EXPORT udp_tracker_connection: public tracker_connecti on | |||
{ | { | |||
friend class tracker_manager; | friend class tracker_manager; | |||
public: | public: | |||
udp_tracker_connection( | udp_tracker_connection( | |||
io_service& ios | io_service& ios | |||
, connection_queue& cc | , connection_queue& cc | |||
, tracker_manager& man | , tracker_manager& man | |||
, tracker_request const& req | , tracker_request const& req | |||
, address bind_infc | , address bind_infc | |||
, boost::weak_ptr<request_callback> c | , boost::weak_ptr<request_callback> c | |||
, session_settings const& stn | , session_settings const& stn | |||
, proxy_settings const& ps); | , proxy_settings const& ps | |||
, ip_filter const* ipf); | ||||
void start(); | void start(); | |||
void close(); | void close(); | |||
private: | private: | |||
enum action_t | enum action_t | |||
{ | { | |||
action_connect, | action_connect, | |||
action_announce, | action_announce, | |||
skipping to change at line 120 | skipping to change at line 123 | |||
udp::resolver m_name_lookup; | udp::resolver m_name_lookup; | |||
udp_socket m_socket; | udp_socket m_socket; | |||
udp::endpoint m_target; | udp::endpoint m_target; | |||
int m_transaction_id; | int m_transaction_id; | |||
boost::int64_t m_connection_id; | boost::int64_t m_connection_id; | |||
session_settings const& m_settings; | session_settings const& m_settings; | |||
int m_attempts; | int m_attempts; | |||
action_t m_state; | action_t m_state; | |||
ip_filter const* m_ip_filter; | ||||
}; | }; | |||
} | } | |||
#endif // TORRENT_UDP_TRACKER_CONNECTION_HPP_INCLUDED | #endif // TORRENT_UDP_TRACKER_CONNECTION_HPP_INCLUDED | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 6 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 10 | #define LIBTORRENT_VERSION_TINY 11 | |||
#define LIBTORRENT_VERSION "0.14.10.0" | #define LIBTORRENT_VERSION "0.14.11.0" | |||
#define LIBTORRENT_REVISION "$Rev: 4387 $" | #define LIBTORRENT_REVISION "$Rev: 4759 $" | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||