add_torrent_params.hpp   add_torrent_params.hpp 
skipping to change at line 150 skipping to change at line 150
// that the files are complete, this is a way to avo id the initial // that the files are complete, this is a way to avo id the initial
// file checks, and significantly reduce the startup time. // file checks, and significantly reduce the startup time.
// //
// Setting ``flag_seed_mode`` on a torrent without m etadata (a // Setting ``flag_seed_mode`` on a torrent without m etadata (a
// .torrent file) is a no-op and will be ignored. // .torrent file) is a no-op and will be ignored.
// //
// If resume data is passed in with this torrent, th e seed mode saved // If resume data is passed in with this torrent, th e seed mode saved
// in there will override the seed mode you set here . // in there will override the seed mode you set here .
flag_seed_mode = 0x001, flag_seed_mode = 0x001,
// If ``flag_override_resume_data`` is set, the ``pa // If ``flag_override_resume_data`` is set, flags se
used``, t for this torrent
// ``auto_managed`` and ``save_path`` of the torrent // in this ``add_torrent_params`` object will take p
are not loaded recedence over
// from the resume data, but the states requested by // whatever states are saved in the resume data. For
the flags in instance, the
// ``add_torrent_params`` will override them. // ``paused``, ``auto_managed``, ``sequential_downlo
// ad``, ``seed_mode``,
// If you pass in resume data, the paused state of t // ``super_seeding``, ``max_uploads``, ``max_connect
he torrent when ions``,
// the resume data was saved will override the pause // ``upload_limit`` and ``download_limit`` are all a
d state you pass ffected by this
// in here. You can override this by setting // flag. The intention of this flag is to have any f
// ``flag_override_resume_data``. ield in
// add_torrent_params configuring the torrent overri
de the corresponding
// configuration from the resume file, with the one
exception of save
// resume data, which has its own flag (for historic
reasons).
flag_override_resume_data = 0x002, flag_override_resume_data = 0x002,
// If ``flag_upload_mode`` is set, the torrent will be initialized in // If ``flag_upload_mode`` is set, the torrent will be initialized in
// upload-mode, which means it will not make any pie ce requests. This // upload-mode, which means it will not make any pie ce requests. This
// state is typically entered on disk I/O errors, an d if the torrent // state is typically entered on disk I/O errors, an d if the torrent
// is also auto managed, it will be taken out of thi s state // is also auto managed, it will be taken out of thi s state
// periodically. This mode can be used to avoid race conditions when // periodically. This mode can be used to avoid race conditions when
// adjusting priorities of pieces before allowing th e torrent to start // adjusting priorities of pieces before allowing th e torrent to start
// downloading. // downloading.
// //
skipping to change at line 283 skipping to change at line 284
// url seeds to be added to the torrent (`BEP 17`_). // url seeds to be added to the torrent (`BEP 17`_).
std::vector<std::string> url_seeds; std::vector<std::string> url_seeds;
// a list of hostname and port pairs, representing DHT nodes to be added // a list of hostname and port pairs, representing DHT nodes to be added
// to the session (if DHT is enabled). The hostname may be a n IP address. // to the session (if DHT is enabled). The hostname may be a n IP address.
std::vector<std::pair<std::string, int> > dht_nodes; std::vector<std::pair<std::string, int> > dht_nodes;
std::string name; std::string name;
// the path where the torrent is or will be stored. Note tha t this may // the path where the torrent is or will be stored. Note tha t this may
// alos be stored in resume data. If you which the save path saved in // alos be stored in resume data. If you want the save path saved in
// the resume data to be used, you need to set the // the resume data to be used, you need to set the
// flag_use_resume_save_path flag. // flag_use_resume_save_path flag.
//
// .. note::
// On windows this path (and other paths) are interpret
ed as UNC
// paths. This means they must use backslashes as direc
tory separators
// and may not contain the special directories "." or "
..".
std::string save_path; std::string save_path;
// The optional parameter, ``resume_data`` can be given if u p to date // The optional parameter, ``resume_data`` can be given if u p to date
// fast-resume data is available. The fast-resume data can b e acquired // fast-resume data is available. The fast-resume data can b e acquired
// from a running torrent by calling save_resume_data() on // from a running torrent by calling save_resume_data() on
// torrent_handle. See fast-resume_. The ``vector`` that is passed in // torrent_handle. See fast-resume_. The ``vector`` that is passed in
// will be swapped into the running torrent instance with // will be swapped into the running torrent instance with
// ``std::vector::swap()``. // ``std::vector::swap()``.
std::vector<char> resume_data; std::vector<char> resume_data;
 End of changes. 3 change blocks. 
15 lines changed or deleted 29 lines changed or added


 allocator.hpp   allocator.hpp 
skipping to change at line 71 skipping to change at line 71
if (m_buf) page_aligned_allocator::free(m_buf); if (m_buf) page_aligned_allocator::free(m_buf);
m_buf = buf; m_buf = buf;
} }
void swap(aligned_holder& h) void swap(aligned_holder& h)
{ {
char* tmp = m_buf; char* tmp = m_buf;
m_buf = h.m_buf; m_buf = h.m_buf;
h.m_buf = tmp; h.m_buf = tmp;
} }
private: private:
aligned_holder(aligned_holder const&);
aligned_holder& operator=(aligned_holder const&);
char* m_buf; char* m_buf;
}; };
} }
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 assert.hpp   assert.hpp 
skipping to change at line 37 skipping to change at line 37
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_ASSERT #ifndef TORRENT_ASSERT
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#if defined TORRENT_DEBUG || defined TORRENT_ASIO_DEBUGGING || TORRENT_RELE #if defined TORRENT_DEBUG || defined TORRENT_ASIO_DEBUGGING \
ASE_ASSERTS || TORRENT_RELEASE_ASSERTS || defined TORRENT_DEBUG_BUFFERS
#include <string> #include <string>
std::string demangle(char const* name); std::string demangle(char const* name);
TORRENT_EXPORT void print_backtrace(char* out, int len, int max_depth = 0); TORRENT_EXPORT void print_backtrace(char* out, int len, int max_depth = 0);
#endif #endif
#if TORRENT_USE_ASSERTS #if TORRENT_USE_ASSERTS
#if TORRENT_PRODUCTION_ASSERTS #if TORRENT_PRODUCTION_ASSERTS
extern char const* libtorrent_assert_log; extern char const* libtorrent_assert_log;
#endif #endif
 End of changes. 1 change blocks. 
2 lines changed or deleted 2 lines changed or added


 bencode.hpp   bencode.hpp 
skipping to change at line 102 skipping to change at line 102
#include "libtorrent/entry.hpp" #include "libtorrent/entry.hpp"
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#include "libtorrent/assert.hpp" #include "libtorrent/assert.hpp"
#include "libtorrent/escape_string.hpp" #include "libtorrent/escape_string.hpp"
#include "libtorrent/io.hpp" // for write_string #include "libtorrent/io.hpp" // for write_string
namespace libtorrent namespace libtorrent
{ {
#ifndef TORRENT_NO_DEPRECATE
// thrown by bdecode() if the provided bencoded buffer does not cont ain // thrown by bdecode() if the provided bencoded buffer does not cont ain
// valid encoding. // valid encoding.
struct TORRENT_EXPORT invalid_encoding: std::exception struct TORRENT_EXPORT invalid_encoding: std::exception
{ {
// hidden
virtual const char* what() const throw() { return "invalid b encoding"; } virtual const char* what() const throw() { return "invalid b encoding"; }
}; };
#endif
namespace detail namespace detail
{ {
// this is used in the template, so it must be available to the client // this is used in the template, so it must be available to the client
TORRENT_EXPORT char const* integer_to_str(char* buf, int siz e TORRENT_EXPORT char const* integer_to_str(char* buf, int siz e
, entry::integer_type val); , entry::integer_type val);
template <class OutIt> template <class OutIt>
int write_integer(OutIt& out, entry::integer_type val) int write_integer(OutIt& out, entry::integer_type val)
{ {
skipping to change at line 429 skipping to change at line 432
// //
// Or, if you have a raw char buffer:: // Or, if you have a raw char buffer::
// //
// const char* buf; // const char* buf;
// // ... // // ...
// entry e = bdecode(buf, buf + data_size); // entry e = bdecode(buf, buf + data_size);
// //
// Now we just need to know how to retrieve information from the ent ry. // Now we just need to know how to retrieve information from the ent ry.
// //
// If ``bdecode()`` encounters invalid encoded data in the range giv en to it // If ``bdecode()`` encounters invalid encoded data in the range giv en to it
// it will throw libtorrent_exception. // it will return a default constructed ``entry`` object.
template<class OutIt> int bencode(OutIt out, const entry& e) template<class OutIt> int bencode(OutIt out, const entry& e)
{ {
return detail::bencode_recursive(out, e); return detail::bencode_recursive(out, e);
} }
template<class InIt> entry bdecode(InIt start, InIt end) template<class InIt> entry bdecode(InIt start, InIt end)
{ {
entry e; entry e;
bool err = false; bool err = false;
detail::bdecode_recursive(start, end, e, err, 0); detail::bdecode_recursive(start, end, e, err, 0);
#ifdef TORRENT_DEBUG #ifdef TORRENT_DEBUG
 End of changes. 4 change blocks. 
1 lines changed or deleted 4 lines changed or added


 bitfield.hpp   bitfield.hpp 
skipping to change at line 172 skipping to change at line 172
if (bytes[i] != 0xff) return false; if (bytes[i] != 0xff) return false;
} }
int rest = m_size & 0x7; int rest = m_size & 0x7;
boost::uint8_t mask = (0xff << (8-rest)) & 0xff; boost::uint8_t mask = (0xff << (8-rest)) & 0xff;
if (rest > 0 && (bytes[num_bytes] & mask) != mask) if (rest > 0 && (bytes[num_bytes] & mask) != mask)
return false; return false;
return true; return true;
} }
// returns the size of the bitfield in bits. // returns the size of the bitfield in bits.
std::size_t size() const { return m_size; } int size() const { return m_size; }
// returns true if the bitfield has zero size. // returns true if the bitfield has zero size.
bool empty() const { return m_size == 0; } bool empty() const { return m_size == 0; }
// returns a pointer to the internal buffer of the bitfield. // returns a pointer to the internal buffer of the bitfield.
char const* bytes() const { return (char*)m_bytes; } char const* bytes() const { return (char*)m_bytes; }
// copy operator // copy operator
bitfield& operator=(bitfield const& rhs) bitfield& operator=(bitfield const& rhs)
{ {
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 buffer.hpp   buffer.hpp 
skipping to change at line 63 skipping to change at line 63
: begin(b) : begin(b)
, end(e) , end(e)
{} {}
char operator[](int index) const char operator[](int index) const
{ {
TORRENT_ASSERT(begin + index < end); TORRENT_ASSERT(begin + index < end);
return begin[index]; return begin[index];
} }
int left() const { TORRENT_ASSERT(end >= begin); return end int left() const
- begin; } {
TORRENT_ASSERT(end >= begin);
TORRENT_ASSERT(end - begin < INT_MAX);
return int(end - begin);
}
char* begin; char* begin;
char* end; char* end;
}; };
struct const_interval struct const_interval
{ {
const_interval(interval const& i) const_interval(interval const& i)
: begin(i.begin) : begin(i.begin)
, end(i.end) , end(i.end)
skipping to change at line 89 skipping to change at line 94
{} {}
char operator[](int index) const char operator[](int index) const
{ {
TORRENT_ASSERT(begin + index < end); TORRENT_ASSERT(begin + index < end);
return begin[index]; return begin[index];
} }
bool operator==(const const_interval& p_interval) bool operator==(const const_interval& p_interval)
{ {
return (begin == p_interval.begin return begin == p_interval.begin
&& end == p_interval.end); && end == p_interval.end;
} }
int left() const { TORRENT_ASSERT(end >= begin); return end int left() const
- begin; } {
TORRENT_ASSERT(end >= begin);
TORRENT_ASSERT(end - begin < INT_MAX);
return int(end - begin);
}
char const* begin; char const* begin;
char const* end; char const* end;
}; };
buffer(std::size_t n = 0) buffer(std::size_t n = 0)
: m_begin(0) : m_begin(0)
, m_end(0) , m_end(0)
, m_last(0) , m_last(0)
{ {
 End of changes. 3 change blocks. 
6 lines changed or deleted 14 lines changed or added


 config.hpp   config.hpp 
skipping to change at line 64 skipping to change at line 64
#error TORRENT_DEBUG_BUFFERS only works if you also disable pool allocators with TORRENT_DISABLE_POOL_ALLOCATOR #error TORRENT_DEBUG_BUFFERS only works if you also disable pool allocators with TORRENT_DISABLE_POOL_ALLOCATOR
#endif #endif
#if !defined BOOST_ASIO_SEPARATE_COMPILATION && !defined BOOST_ASIO_DYN_LIN K #if !defined BOOST_ASIO_SEPARATE_COMPILATION && !defined BOOST_ASIO_DYN_LIN K
#error you must define either BOOST_ASIO_SEPARATE_COMPILATION or BOOST_ASIO _DYN_LINK in your project in \ #error you must define either BOOST_ASIO_SEPARATE_COMPILATION or BOOST_ASIO _DYN_LINK in your project in \
order for asios declarations to be correct. If you are linking dynam ically against libtorrent, define \ order for asios declarations to be correct. If you are linking dynam ically against libtorrent, define \
BOOST_ASIO_DYN_LINK otherwise BOOST_ASIO_SEPARATE_COMPILATION. You c an also use pkg-config or boost \ BOOST_ASIO_DYN_LINK otherwise BOOST_ASIO_SEPARATE_COMPILATION. You c an also use pkg-config or boost \
build, to automatically apply these defines build, to automatically apply these defines
#endif #endif
// some parts pulled out of stdint.h
// to avoid C99 or C++11 dependency
#if !defined INT64_MAX
#define INT64_MAX 0x7fffffffffffffffLL
#endif
#if !defined INT16_MAX
#define INT16_MAX 32767
#endif
#if !defined INT16_MIN
#define INT16_MIN -32768
#endif
#ifndef _MSC_VER #ifndef _MSC_VER
#ifndef __STDC_FORMAT_MACROS #ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS 1 #define __STDC_FORMAT_MACROS 1
#endif #endif
#include <inttypes.h> // for PRId64 et.al. #include <inttypes.h> // for PRId64 et.al.
#endif #endif
#ifndef PRId64 #ifndef PRId64
// MinGW uses microsofts runtime // MinGW uses microsofts runtime
#if defined _MSC_VER || defined __MINGW32__ #if defined _MSC_VER || defined __MINGW32__
skipping to change at line 286 skipping to change at line 274
#define TORRENT_HAS_FALLOCATE 0 #define TORRENT_HAS_FALLOCATE 0
#define TORRENT_USE_IFCONF 1 #define TORRENT_USE_IFCONF 1
#define TORRENT_USE_SYSCTL 1 #define TORRENT_USE_SYSCTL 1
#define TORRENT_USE_MLOCK 0 #define TORRENT_USE_MLOCK 0
#define TORRENT_USE_IPV6 0 #define TORRENT_USE_IPV6 0
#define TORRENT_ICONV_ARG (const char**) #define TORRENT_ICONV_ARG (const char**)
#define TORRENT_USE_WRITEV 0 #define TORRENT_USE_WRITEV 0
#define TORRENT_USE_READV 0 #define TORRENT_USE_READV 0
#else #else
#warning unknown OS, assuming BSD
#ifdef _MSC_VER
#pragma message ( "unknown OS, assuming BSD" )
#else
#warning "unknown OS, assuming BSD"
#endif
#define TORRENT_BSD #define TORRENT_BSD
#endif #endif
// on windows, NAME_MAX refers to Unicode characters // on windows, NAME_MAX refers to Unicode characters
// on linux it refers to bytes (utf-8 encoded) // on linux it refers to bytes (utf-8 encoded)
// TODO: Make this count Unicode characters instead of bytes on windows // TODO: Make this count Unicode characters instead of bytes on windows
// windows // windows
#if defined FILENAME_MAX #if defined FILENAME_MAX
#define TORRENT_MAX_PATH FILENAME_MAX #define TORRENT_MAX_PATH FILENAME_MAX
skipping to change at line 315 skipping to change at line 309
// posix // posix
#elif defined NAME_MAX #elif defined NAME_MAX
#define TORRENT_MAX_PATH NAME_MAX #define TORRENT_MAX_PATH NAME_MAX
// none of the above // none of the above
#else #else
// this is the maximum number of characters in a // this is the maximum number of characters in a
// path element / filename on windows // path element / filename on windows
#define TORRENT_MAX_PATH 255 #define TORRENT_MAX_PATH 255
#warning unknown platform, assuming the longest path is 255
#ifdef _MSC_VER
#pragma message ( "unknown platform, assuming the longest path is 255" )
#else
#warning "unknown platform, assuming the longest path is 255"
#endif
#endif #endif
#if defined TORRENT_WINDOWS && !defined TORRENT_MINGW #if defined TORRENT_WINDOWS && !defined TORRENT_MINGW
#include <stdarg.h> #include <stdarg.h>
// internal // internal
#ifdef __cplusplus #ifdef __cplusplus
inline inline
 End of changes. 3 change blocks. 
14 lines changed or deleted 13 lines changed or added


 entry.hpp   entry.hpp 
skipping to change at line 85 skipping to change at line 85
namespace libtorrent namespace libtorrent
{ {
struct lazy_entry; struct lazy_entry;
// thrown by any accessor function of entry if the accessor // thrown by any accessor function of entry if the accessor
// function requires a type different than the actual type // function requires a type different than the actual type
// of the entry object. // of the entry object.
struct TORRENT_EXPORT type_error: std::runtime_error struct TORRENT_EXPORT type_error: std::runtime_error
{ {
// internal
type_error(const char* error): std::runtime_error(error) {} type_error(const char* error): std::runtime_error(error) {}
}; };
// The ``entry`` class represents one node in a bencoded hierarchy. It works as a // The ``entry`` class represents one node in a bencoded hierarchy. It works as a
// variant type, it can be either a list, a dictionary (``std::map`` ), an integer // variant type, it can be either a list, a dictionary (``std::map`` ), an integer
// or a string. // or a string.
class TORRENT_EXPORT entry class TORRENT_EXPORT entry
{ {
public: public:
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 hasher.hpp   hasher.hpp 
skipping to change at line 109 skipping to change at line 109
// this is the same as default constructing followed by a ca ll to // this is the same as default constructing followed by a ca ll to
// ``update(data, len)``. // ``update(data, len)``.
hasher(const char* data, int len); hasher(const char* data, int len);
#ifdef TORRENT_USE_GCRYPT #ifdef TORRENT_USE_GCRYPT
hasher(hasher const& h); hasher(hasher const& h);
hasher& operator=(hasher const& h); hasher& operator=(hasher const& h);
#endif #endif
// append the following bytes to what is being hashed // append the following bytes to what is being hashed
hasher& update(std::string const& data) { update(data.c_str( ), data.size()); return *this; } hasher& update(std::string const& data) { update(data.c_str( ), int(data.size())); return *this; }
hasher& update(const char* data, int len); hasher& update(const char* data, int len);
// returns the SHA-1 digest of the buffers previously passed to // returns the SHA-1 digest of the buffers previously passed to
// update() and the hasher constructor. // update() and the hasher constructor.
sha1_hash final(); sha1_hash final();
// restore the hasher state to be as if the hasher has just been // restore the hasher state to be as if the hasher has just been
// default constructed. // default constructed.
void reset(); void reset();
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 http_connection.hpp   http_connection.hpp 
skipping to change at line 142 skipping to change at line 142
void queue_connect(); void queue_connect();
void connect(int ticket, tcp::endpoint target_address); void connect(int ticket, tcp::endpoint target_address);
void on_connect_timeout(); void on_connect_timeout();
void on_connect(error_code const& e); void on_connect(error_code const& e);
void on_write(error_code const& e); void on_write(error_code const& e);
void on_read(error_code const& e, std::size_t bytes_transferred); void on_read(error_code const& e, std::size_t bytes_transferred);
static void on_timeout(boost::weak_ptr<http_connection> p static void on_timeout(boost::weak_ptr<http_connection> p
, error_code const& e); , error_code const& e);
void on_assign_bandwidth(error_code const& e); void on_assign_bandwidth(error_code const& e);
void callback(error_code e, char const* data = 0, int size = 0); void callback(error_code e, char* data = 0, int size = 0);
std::vector<char> m_recvbuffer; std::vector<char> m_recvbuffer;
socket_type m_sock; socket_type m_sock;
#if TORRENT_USE_I2P #if TORRENT_USE_I2P
i2p_connection* m_i2p_conn; i2p_connection* m_i2p_conn;
#endif #endif
int m_read_pos; int m_read_pos;
tcp::resolver m_resolver; tcp::resolver m_resolver;
http_parser m_parser; http_parser m_parser;
http_handler m_handler; http_handler m_handler;
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 lazy_entry.hpp   lazy_entry.hpp 
skipping to change at line 230 skipping to change at line 230
// internal // internal
lazy_entry* dict_append(char const* name); lazy_entry* dict_append(char const* name);
// internal // internal
void pop(); void pop();
// if this is a dictionary, look for a key ``name``, and ret urn // if this is a dictionary, look for a key ``name``, and ret urn
// a pointer to its value, or NULL if there is none. // a pointer to its value, or NULL if there is none.
lazy_entry* dict_find(char const* name); lazy_entry* dict_find(char const* name);
lazy_entry const* dict_find(char const* name) const lazy_entry const* dict_find(char const* name) const
{ return const_cast<lazy_entry*>(this)->dict_find(name); } { return const_cast<lazy_entry*>(this)->dict_find(name); }
lazy_entry* dict_find(std::string const& name);
lazy_entry const* dict_find(std::string const& name) const
{ return const_cast<lazy_entry*>(this)->dict_find(name); }
lazy_entry const* dict_find_string(char const* name) const; lazy_entry const* dict_find_string(char const* name) const;
// if this is a dictionary, look for a key ``name`` whose va lue // if this is a dictionary, look for a key ``name`` whose va lue
// is a string. If such key exist, return a pointer to // is a string. If such key exist, return a pointer to
// its value, otherwise NULL. // its value, otherwise NULL.
std::string dict_find_string_value(char const* name) const; std::string dict_find_string_value(char const* name) const;
pascal_string dict_find_pstr(char const* name) const; pascal_string dict_find_pstr(char const* name) const;
// if this is a dictionary, look for a key ``name`` whose va lue // if this is a dictionary, look for a key ``name`` whose va lue
// is an int. If such key exist, return a pointer to its val ue, // is an int. If such key exist, return a pointer to its val ue,
skipping to change at line 251 skipping to change at line 254
boost::int64_t dict_find_int_value(char const* name, boost:: int64_t default_val = 0) const; boost::int64_t dict_find_int_value(char const* name, boost:: int64_t default_val = 0) const;
lazy_entry const* dict_find_int(char const* name) const; lazy_entry const* dict_find_int(char const* name) const;
// these functions require that ``this`` is a dictionary. // these functions require that ``this`` is a dictionary.
// (this->type() == dict_t). They look for an element with t he // (this->type() == dict_t). They look for an element with t he
// specified name in the dictionary. ``dict_find_dict`` only // specified name in the dictionary. ``dict_find_dict`` only
// finds dictionaries and ``dict_find_list`` only finds list s. // finds dictionaries and ``dict_find_list`` only finds list s.
// if no key with the corresponding value of the right type is // if no key with the corresponding value of the right type is
// found, NULL is returned. // found, NULL is returned.
lazy_entry const* dict_find_dict(char const* name) const; lazy_entry const* dict_find_dict(char const* name) const;
lazy_entry const* dict_find_dict(std::string const& name) co nst;
lazy_entry const* dict_find_list(char const* name) const; lazy_entry const* dict_find_list(char const* name) const;
// if this is a dictionary, return the key value pair at // if this is a dictionary, return the key value pair at
// position ``i`` from the dictionary. // position ``i`` from the dictionary.
std::pair<std::string, lazy_entry const*> dict_at(int i) con st; std::pair<std::string, lazy_entry const*> dict_at(int i) con st;
// requires that ``this`` is a dictionary. return the // requires that ``this`` is a dictionary. return the
// number of items in it // number of items in it
int dict_size() const int dict_size() const
{ {
skipping to change at line 316 skipping to change at line 320
{ {
TORRENT_ASSERT(m_type == list_t); TORRENT_ASSERT(m_type == list_t);
return int(m_size); return int(m_size);
} }
// internal: end points one byte passed last byte in the sou rce // internal: end points one byte passed last byte in the sou rce
// buffer backing the bencoded structure. // buffer backing the bencoded structure.
void set_end(char const* end) void set_end(char const* end)
{ {
TORRENT_ASSERT(end > m_begin); TORRENT_ASSERT(end > m_begin);
m_len = end - m_begin; TORRENT_ASSERT(end - m_begin < INT_MAX);
m_len = int(end - m_begin);
} }
// internal // internal
void clear(); void clear();
// internal: releases ownership of any memory allocated // internal: releases ownership of any memory allocated
void release() void release()
{ {
m_data.start = 0; m_data.start = 0;
m_size = 0; m_size = 0;
 End of changes. 3 change blocks. 
1 lines changed or deleted 6 lines changed or added


 node.hpp   node.hpp 
skipping to change at line 204 skipping to change at line 204
typedef std::map<node_id, dht_mutable_item> dht_mutable_table_t; typedef std::map<node_id, dht_mutable_item> dht_mutable_table_t;
public: public:
node_impl(alert_dispatcher* alert_disp, udp_socket_interface* sock node_impl(alert_dispatcher* alert_disp, udp_socket_interface* sock
, libtorrent::dht_settings const& settings, node_id nid, add ress const& external_address , libtorrent::dht_settings const& settings, node_id nid, add ress const& external_address
, dht_observer* observer); , dht_observer* observer);
virtual ~node_impl() {} virtual ~node_impl() {}
void tick(); void tick();
void refresh(node_id const& id, find_data::nodes_callback const& f);
void bootstrap(std::vector<udp::endpoint> const& nodes void bootstrap(std::vector<udp::endpoint> const& nodes
, find_data::nodes_callback const& f); , find_data::nodes_callback const& f);
void add_router_node(udp::endpoint router); void add_router_node(udp::endpoint router);
void unreachable(udp::endpoint const& ep); void unreachable(udp::endpoint const& ep);
void incoming(msg const& m); void incoming(msg const& m);
int num_torrents() const { return m_map.size(); } int num_torrents() const { return m_map.size(); }
int num_peers() const int num_peers() const
{ {
int ret = 0; int ret = 0;
std::for_each(m_map.begin(), m_map.end(), count_peers(ret)); std::for_each(m_map.begin(), m_map.end(), count_peers(ret));
return ret; return ret;
} }
int bucket_size(int bucket); int bucket_size(int bucket);
node_id const& nid() const { return m_id; } node_id const& nid() const { return m_id; }
boost::tuple<int, int> size() const{ return m_table.size(); } boost::tuple<int, int, int> size() const { return m_table.size(); }
size_type num_global_nodes() const size_type num_global_nodes() const
{ return m_table.num_global_nodes(); } { return m_table.num_global_nodes(); }
int data_size() const { return int(m_map.size()); } int data_size() const { return int(m_map.size()); }
#ifdef TORRENT_DHT_VERBOSE_LOGGING #ifdef TORRENT_DHT_VERBOSE_LOGGING
void print_state(std::ostream& os) const void print_state(std::ostream& os) const
{ m_table.print_state(os); } { m_table.print_state(os); }
#endif #endif
skipping to change at line 282 skipping to change at line 281
mutex_t::scoped_lock l(m_mutex); mutex_t::scoped_lock l(m_mutex);
m_running_requests.erase(a); m_running_requests.erase(a);
} }
void status(libtorrent::session_status& s); void status(libtorrent::session_status& s);
libtorrent::dht_settings const& settings() const { return m_settings ; } libtorrent::dht_settings const& settings() const { return m_settings ; }
protected: protected:
void lookup_peers(sha1_hash const& info_hash, int prefix, entry& rep void send_single_refresh(udp::endpoint const& ep, int bucket
ly , node_id const& id = node_id());
void lookup_peers(sha1_hash const& info_hash, entry& reply
, bool noseed, bool scrape) const; , bool noseed, bool scrape) const;
bool lookup_torrents(sha1_hash const& target, entry& reply bool lookup_torrents(sha1_hash const& target, entry& reply
, char* tags) const; , char* tags) const;
libtorrent::dht_settings const& m_settings; libtorrent::dht_settings const& m_settings;
private: private:
typedef libtorrent::mutex mutex_t; typedef libtorrent::mutex mutex_t;
mutex_t m_mutex; mutex_t m_mutex;
skipping to change at line 314 skipping to change at line 315
private: private:
dht_observer* m_observer; dht_observer* m_observer;
table_t m_map; table_t m_map;
dht_immutable_table_t m_immutable_table; dht_immutable_table_t m_immutable_table;
dht_mutable_table_t m_mutable_table; dht_mutable_table_t m_mutable_table;
ptime m_last_tracker_tick; ptime m_last_tracker_tick;
// the last time we issued a bootstrap or a refresh on our own ID, t
o expand
// the routing table buckets close to us.
ptime m_last_self_refresh;
// secret random numbers used to create write tokens // secret random numbers used to create write tokens
int m_secret[2]; int m_secret[2];
alert_dispatcher* m_post_alert; alert_dispatcher* m_post_alert;
udp_socket_interface* m_sock; udp_socket_interface* m_sock;
}; };
} } // namespace libtorrent::dht } } // namespace libtorrent::dht
#endif // NODE_HPP #endif // NODE_HPP
 End of changes. 4 change blocks. 
4 lines changed or deleted 9 lines changed or added


 node_entry.hpp   node_entry.hpp 
skipping to change at line 40 skipping to change at line 40
*/ */
#ifndef KADEMLIA_NODE_ENTRY_HPP #ifndef KADEMLIA_NODE_ENTRY_HPP
#define KADEMLIA_NODE_ENTRY_HPP #define KADEMLIA_NODE_ENTRY_HPP
#include "libtorrent/kademlia/node_id.hpp" #include "libtorrent/kademlia/node_id.hpp"
#include "libtorrent/socket.hpp" #include "libtorrent/socket.hpp"
#include "libtorrent/address.hpp" #include "libtorrent/address.hpp"
#include "libtorrent/union_endpoint.hpp" #include "libtorrent/union_endpoint.hpp"
#include "libtorrent/time.hpp" // for time_now()
#ifdef TORRENT_DHT_VERBOSE_LOGGING #ifdef TORRENT_DHT_VERBOSE_LOGGING
#include "libtorrent/time.hpp" #include "libtorrent/time.hpp"
#endif #endif
namespace libtorrent { namespace dht namespace libtorrent { namespace dht
{ {
struct node_entry struct node_entry
{ {
node_entry(node_id const& id_, udp::endpoint ep, int roundtriptime = node_entry(node_id const& id_, udp::endpoint ep, int roundtriptime =
0xffff, bool pinged = false) 0xffff
: id(id_) , bool pinged = false)
, endpoint(ep) : last_queried(pinged ? time_now() : min_time())
, id(id_)
, a(ep.address().to_v4().to_bytes())
, p(ep.port())
, rtt(roundtriptime & 0xffff) , rtt(roundtriptime & 0xffff)
, timeout_count(pinged ? 0 : 0xff) , timeout_count(pinged ? 0 : 0xff)
{ {
#ifdef TORRENT_DHT_VERBOSE_LOGGING #ifdef TORRENT_DHT_VERBOSE_LOGGING
first_seen = time_now(); first_seen = time_now();
#endif #endif
} }
node_entry(udp::endpoint ep) node_entry(udp::endpoint ep)
: id(0) : last_queried(min_time())
, endpoint(ep) , id(0)
, a(ep.address().to_v4().to_bytes())
, p(ep.port())
, rtt(0xffff) , rtt(0xffff)
, timeout_count(0xff) , timeout_count(0xff)
{ {
#ifdef TORRENT_DHT_VERBOSE_LOGGING #ifdef TORRENT_DHT_VERBOSE_LOGGING
first_seen = time_now(); first_seen = time_now();
#endif #endif
} }
node_entry() node_entry()
: id(0) : last_queried(min_time())
, id(0)
, p(0)
, rtt(0xffff) , rtt(0xffff)
, timeout_count(0xff) , timeout_count(0xff)
{ {
#ifdef TORRENT_DHT_VERBOSE_LOGGING #ifdef TORRENT_DHT_VERBOSE_LOGGING
first_seen = time_now(); first_seen = time_now();
#endif #endif
} }
bool pinged() const { return timeout_count != 0xff; } bool pinged() const { return timeout_count != 0xff; }
void set_pinged() { if (timeout_count == 0xff) timeout_count = 0; } void set_pinged() { if (timeout_count == 0xff) timeout_count = 0; }
void timed_out() { if (pinged() && timeout_count < 0xfe) ++timeout_c ount; } void timed_out() { if (pinged() && timeout_count < 0xfe) ++timeout_c ount; }
int fail_count() const { return pinged() ? timeout_count : 0; } int fail_count() const { return pinged() ? timeout_count : 0; }
void reset_fail_count() { if (pinged()) timeout_count = 0; } void reset_fail_count() { if (pinged()) timeout_count = 0; }
udp::endpoint ep() const { return udp::endpoint(endpoint); } udp::endpoint ep() const { return udp::endpoint(address_v4(a), p); }
bool confirmed() const { return timeout_count == 0; } bool confirmed() const { return timeout_count == 0; }
void update_rtt(int new_rtt) void update_rtt(int new_rtt)
{ {
TORRENT_ASSERT(new_rtt <= 0xffff);
TORRENT_ASSERT(new_rtt >= 0);
if (new_rtt == 0xffff) return;
if (rtt == 0xffff) rtt = new_rtt; if (rtt == 0xffff) rtt = new_rtt;
else rtt = int(rtt) / 3 + int(new_rtt) * 2 / 3; else rtt = int(rtt) * 2 / 3 + int(new_rtt) / 3;
} }
address addr() const { return endpoint.address(); } address addr() const { return address_v4(a); }
int port() const { return endpoint.port; } int port() const { return p; }
#ifdef TORRENT_DHT_VERBOSE_LOGGING #ifdef TORRENT_DHT_VERBOSE_LOGGING
ptime first_seen; ptime first_seen;
#endif #endif
// the time we last received a response for a request to this peer
ptime last_queried;
node_id id; node_id id;
union_endpoint endpoint; address_v4::bytes_type a;
boost::uint16_t p;
// the average RTT of this node // the average RTT of this node
boost::uint16_t rtt; boost::uint16_t rtt;
// the number of times this node has failed to // the number of times this node has failed to
// respond in a row // respond in a row
boost::uint8_t timeout_count; boost::uint8_t timeout_count;
}; };
} } // namespace libtorrent::dht } } // namespace libtorrent::dht
 End of changes. 10 change blocks. 
12 lines changed or deleted 27 lines changed or added


 node_id.hpp   node_id.hpp 
skipping to change at line 66 skipping to change at line 66
// returns n in: 2^n <= distance(n1, n2) < 2^(n+1) // returns n in: 2^n <= distance(n1, n2) < 2^(n+1)
// useful for finding out which bucket a node belongs to // useful for finding out which bucket a node belongs to
// the value that's returned is the number of trailing bits // the value that's returned is the number of trailing bits
// after the shared bit prefix of ``n1`` and ``n2``. // after the shared bit prefix of ``n1`` and ``n2``.
// if the first bits are different, that's 160. // if the first bits are different, that's 160.
int TORRENT_EXTRA_EXPORT distance_exp(node_id const& n1, node_id const& n2) ; int TORRENT_EXTRA_EXPORT distance_exp(node_id const& n1, node_id const& n2) ;
node_id TORRENT_EXTRA_EXPORT generate_id(address const& external_ip); node_id TORRENT_EXTRA_EXPORT generate_id(address const& external_ip);
node_id TORRENT_EXTRA_EXPORT generate_random_id(); node_id TORRENT_EXTRA_EXPORT generate_random_id();
void TORRENT_EXTRA_EXPORT make_id_secret(node_id& in);
node_id TORRENT_EXTRA_EXPORT generate_secret_id();
bool TORRENT_EXTRA_EXPORT verify_secret_id(node_id const& nid);
node_id TORRENT_EXTRA_EXPORT generate_id_impl(address const& ip_, boost::ui nt32_t r); node_id TORRENT_EXTRA_EXPORT generate_id_impl(address const& ip_, boost::ui nt32_t r);
bool TORRENT_EXTRA_EXPORT verify_id(node_id const& nid, address const& sour ce_ip); bool TORRENT_EXTRA_EXPORT verify_id(node_id const& nid, address const& sour ce_ip);
bool TORRENT_EXTRA_EXPORT matching_prefix(node_entry const& n, int mask, in t prefix, int bucket_index); bool TORRENT_EXTRA_EXPORT matching_prefix(node_entry const& n, int mask, in t prefix, int bucket_index);
node_id TORRENT_EXTRA_EXPORT generate_prefix_mask(int bits); node_id TORRENT_EXTRA_EXPORT generate_prefix_mask(int bits);
} } // namespace libtorrent::dht } } // namespace libtorrent::dht
#endif // NODE_ID_HPP #endif // NODE_ID_HPP
 End of changes. 1 change blocks. 
0 lines changed or deleted 3 lines changed or added


 policy.hpp   policy.hpp 
skipping to change at line 348 skipping to change at line 348
#if TORRENT_USE_IPV6 #if TORRENT_USE_IPV6
struct TORRENT_EXTRA_EXPORT ipv6_peer : peer struct TORRENT_EXTRA_EXPORT ipv6_peer : peer
{ {
ipv6_peer(tcp::endpoint const& ip, bool connectable, int src); ipv6_peer(tcp::endpoint const& ip, bool connectable, int src);
const address_v6::bytes_type addr; const address_v6::bytes_type addr;
}; };
#endif #endif
int num_peers() const { return m_peers.size(); } int num_peers() const { return int(m_peers.size()); }
struct peer_address_compare struct peer_address_compare
{ {
bool operator()( bool operator()(
peer const* lhs, libtorrent::address const& rhs) const peer const* lhs, libtorrent::address const& rhs) const
{ {
return lhs->address() < rhs; return lhs->address() < rhs;
} }
bool operator()( bool operator()(
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 refresh.hpp   refresh.hpp 
skipping to change at line 46 skipping to change at line 46
#include <libtorrent/kademlia/traversal_algorithm.hpp> #include <libtorrent/kademlia/traversal_algorithm.hpp>
#include <libtorrent/kademlia/node_id.hpp> #include <libtorrent/kademlia/node_id.hpp>
#include <libtorrent/kademlia/get_peers.hpp> #include <libtorrent/kademlia/get_peers.hpp>
namespace libtorrent { namespace dht namespace libtorrent { namespace dht
{ {
class routing_table; class routing_table;
class rpc_manager; class rpc_manager;
class refresh : public get_peers class bootstrap : public get_peers
{ {
public: public:
typedef get_peers::nodes_callback done_callback; typedef get_peers::nodes_callback done_callback;
refresh(node_impl& node, node_id target bootstrap(node_impl& node, node_id target
, done_callback const& callback); , done_callback const& callback);
virtual char const* name() const; virtual char const* name() const;
protected:
observer_ptr new_observer(void* ptr, udp::endpoint const& ep observer_ptr new_observer(void* ptr, udp::endpoint const& ep
, node_id const& id); , node_id const& id);
virtual bool invoke(observer_ptr o);
};
class bootstrap : public refresh
{
public:
bootstrap(node_impl& node, node_id target
, done_callback const& callback);
virtual char const* name() const; void trim_seed_nodes();
protected: protected:
virtual bool invoke(observer_ptr o);
virtual void done(); virtual void done();
}; };
} } // namespace libtorrent::dht } } // namespace libtorrent::dht
#endif // REFRESH_050324_HPP #endif // REFRESH_050324_HPP
 End of changes. 7 change blocks. 
14 lines changed or deleted 5 lines changed or added


 routing_table.hpp   routing_table.hpp 
skipping to change at line 42 skipping to change at line 42
#ifndef ROUTING_TABLE_HPP #ifndef ROUTING_TABLE_HPP
#define ROUTING_TABLE_HPP #define ROUTING_TABLE_HPP
#include <vector> #include <vector>
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include <boost/utility.hpp> #include <boost/utility.hpp>
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
#include <boost/array.hpp> #include <boost/array.hpp>
#include <boost/noncopyable.hpp>
#include <set> #include <set>
#include <libtorrent/kademlia/logging.hpp> #include <libtorrent/kademlia/logging.hpp>
#include <libtorrent/kademlia/node_id.hpp> #include <libtorrent/kademlia/node_id.hpp>
#include <libtorrent/kademlia/node_entry.hpp> #include <libtorrent/kademlia/node_entry.hpp>
#include <libtorrent/session_settings.hpp> #include <libtorrent/session_settings.hpp>
#include <libtorrent/size_type.hpp> #include <libtorrent/size_type.hpp>
#include <libtorrent/assert.hpp> #include <libtorrent/assert.hpp>
#include <libtorrent/ptime.hpp> #include <libtorrent/ptime.hpp>
skipping to change at line 71 skipping to change at line 72
#ifdef TORRENT_DHT_VERBOSE_LOGGING #ifdef TORRENT_DHT_VERBOSE_LOGGING
TORRENT_DECLARE_LOG(table); TORRENT_DECLARE_LOG(table);
#endif #endif
typedef std::vector<node_entry> bucket_t; typedef std::vector<node_entry> bucket_t;
struct routing_table_node struct routing_table_node
{ {
bucket_t replacements; bucket_t replacements;
bucket_t live_nodes; bucket_t live_nodes;
ptime last_active;
}; };
// differences in the implementation from the description in // differences in the implementation from the description in
// the paper: // the paper:
// //
// * Nodes are not marked as being stale, they keep a counter // * Nodes are not marked as being stale, they keep a counter
// that tells how many times in a row they have failed. When // that tells how many times in a row they have failed. When
// a new node is to be inserted, the node that has failed // a new node is to be inserted, the node that has failed
// the most times is replaced. If none of the nodes in the // the most times is replaced. If none of the nodes in the
// bucket has failed, then it is put in the replacement // bucket has failed, then it is put in the replacement
// cache (just like in the paper). // cache (just like in the paper).
class TORRENT_EXTRA_EXPORT routing_table class TORRENT_EXTRA_EXPORT routing_table : boost::noncopyable
{ {
public: public:
typedef std::vector<routing_table_node> table_t; typedef std::vector<routing_table_node> table_t;
routing_table(node_id const& id, int bucket_size routing_table(node_id const& id, int bucket_size
, dht_settings const& settings); , dht_settings const& settings);
void status(session_status& s) const; void status(session_status& s) const;
void node_failed(node_id const& id, udp::endpoint const& ep); void node_failed(node_id const& id, udp::endpoint const& ep);
// adds an endpoint that will never be added to // adds an endpoint that will never be added to
// the routing table // the routing table
void add_router_node(udp::endpoint router); void add_router_node(udp::endpoint router);
// iterates over the router nodes added // iterates over the router nodes added
typedef std::set<udp::endpoint>::const_iterator router_iterator; typedef std::set<udp::endpoint>::const_iterator router_iterator;
router_iterator router_begin() const { return m_router_nodes.begin() ; } router_iterator router_begin() const { return m_router_nodes.begin() ; }
router_iterator router_end() const { return m_router_nodes.end(); } router_iterator router_end() const { return m_router_nodes.end(); }
enum add_node_status_t {
failed_to_add = 0,
node_added,
need_bucket_split
};
add_node_status_t add_node_impl(node_entry e);
bool add_node(node_entry e); bool add_node(node_entry e);
// this function is called every time the node sees // this function is called every time the node sees
// a sign of a node being alive. This node will either // a sign of a node being alive. This node will either
// be inserted in the k-buckets or be moved to the top // be inserted in the k-buckets or be moved to the top
// of its bucket. // of its bucket.
bool node_seen(node_id const& id, udp::endpoint ep, int rtt); bool node_seen(node_id const& id, udp::endpoint ep, int rtt);
// this may add a node to the routing table and mark it as // this may add a node to the routing table and mark it as
// not pinged. If the bucket the node falls into is full, // not pinged. If the bucket the node falls into is full,
// the node will be ignored. // the node will be ignored.
void heard_about(node_id const& id, udp::endpoint const& ep); void heard_about(node_id const& id, udp::endpoint const& ep);
// if any bucket in the routing table needs to be refreshed node_entry const* next_refresh();
// this function will return true and set the target to an
// appropriate target inside that bucket
bool need_refresh(node_id& target) const;
enum enum
{ {
// nodes that have not been pinged are considered failed by this flag
include_failed = 1 include_failed = 1
}; };
// fills the vector with the count nodes from our buckets that // fills the vector with the count nodes from our buckets that
// are nearest to the given id. // are nearest to the given id.
void find_node(node_id const& id, std::vector<node_entry>& l void find_node(node_id const& id, std::vector<node_entry>& l
, int options, int count = 0); , int options, int count = 0);
void remove_node(node_entry* n void remove_node(node_entry* n
, table_t::iterator bucket) ; , table_t::iterator bucket) ;
int bucket_size(int bucket) const int bucket_size(int bucket) const
{ {
int num_buckets = m_buckets.size(); int num_buckets = m_buckets.size();
skipping to change at line 149 skipping to change at line 155
table_t::const_iterator i = m_buckets.begin(); table_t::const_iterator i = m_buckets.begin();
std::advance(i, bucket); std::advance(i, bucket);
return (int)i->live_nodes.size(); return (int)i->live_nodes.size();
} }
void for_each_node(void (*)(void*, node_entry const&) void for_each_node(void (*)(void*, node_entry const&)
, void (*)(void*, node_entry const&), void* userdata) const; , void (*)(void*, node_entry const&), void* userdata) const;
int bucket_size() const { return m_bucket_size; } int bucket_size() const { return m_bucket_size; }
boost::tuple<int, int> size() const; // returns the number of nodes in the main buckets, number of nodes
in the
// replacement buckets and the number of nodes in the main buckets t
hat have
// been pinged and confirmed up
boost::tuple<int, int, int> size() const;
size_type num_global_nodes() const; size_type num_global_nodes() const;
// the number of bits down we have full buckets // the number of bits down we have full buckets
// i.e. essentially the number of full buckets // i.e. essentially the number of full buckets
// we have // we have
int depth() const; int depth() const;
// returns true if there are no working nodes
// in the routing table
bool need_bootstrap() const;
int num_active_buckets() const { return m_buckets.size(); } int num_active_buckets() const { return m_buckets.size(); }
void replacement_cache(bucket_t& nodes) const; void replacement_cache(bucket_t& nodes) const;
#if defined TORRENT_DHT_VERBOSE_LOGGING || defined TORRENT_DEBUG #if defined TORRENT_DHT_VERBOSE_LOGGING || defined TORRENT_DEBUG
// used for debug and monitoring purposes. This will print out // used for debug and monitoring purposes. This will print out
// the state of the routing table to the given stream // the state of the routing table to the given stream
void print_state(std::ostream& os) const; void print_state(std::ostream& os) const;
#endif #endif
void touch_bucket(node_id const& target);
int bucket_limit(int bucket) const; int bucket_limit(int bucket) const;
#if TORRENT_USE_INVARIANT_CHECKS #if TORRENT_USE_INVARIANT_CHECKS
void check_invariant() const; void check_invariant() const;
#endif #endif
private: private:
table_t::iterator find_bucket(node_id const& id); table_t::iterator find_bucket(node_id const& id);
skipping to change at line 209 skipping to change at line 214
// bucket size nodes in it, another bucket is // bucket size nodes in it, another bucket is
// added to the end and it's split up between them // added to the end and it's split up between them
table_t m_buckets; table_t m_buckets;
node_id m_id; // our own node id node_id m_id; // our own node id
// the last seen depth (i.e. levels in the routing table) // the last seen depth (i.e. levels in the routing table)
// it's mutable because it's updated by depth(), which is const // it's mutable because it's updated by depth(), which is const
mutable int m_depth; mutable int m_depth;
// the last time need_bootstrap() returned true
mutable ptime m_last_bootstrap;
// the last time the routing table was refreshed.
// this is used to stagger buckets needing refresh
// to be at least 45 seconds apart.
mutable ptime m_last_refresh;
// the last time we refreshed our own bucket // the last time we refreshed our own bucket
// refreshed every 15 minutes // refreshed every 15 minutes
mutable ptime m_last_self_refresh; mutable ptime m_last_self_refresh;
// this is a set of all the endpoints that have // this is a set of all the endpoints that have
// been identified as router nodes. They will // been identified as router nodes. They will
// be used in searches, but they will never // be used in searches, but they will never
// be added to the routing table. // be added to the routing table.
std::set<udp::endpoint> m_router_nodes; std::set<udp::endpoint> m_router_nodes;
 End of changes. 11 change blocks. 
20 lines changed or deleted 19 lines changed or added


 session.hpp   session.hpp 
skipping to change at line 212 skipping to change at line 212
} }
// The destructor of session will notify all trackers that o ur torrents // The destructor of session will notify all trackers that o ur torrents
// have been shut down. If some trackers are down, they will time out. // have been shut down. If some trackers are down, they will time out.
// All this before the destructor of session returns. So, it 's advised // All this before the destructor of session returns. So, it 's advised
// that any kind of interface (such as windows) are closed b efore // that any kind of interface (such as windows) are closed b efore
// destructing the session object. Because it can take a few second for // destructing the session object. Because it can take a few second for
// it to finish. The timeout can be set with ``set_settings( )``. // it to finish. The timeout can be set with ``set_settings( )``.
~session(); ~session();
// TODO: 2 the ip filter should probably be saved here too
// flags that determines which aspects of the session should be // flags that determines which aspects of the session should be
// saved when calling save_state(). // saved when calling save_state().
enum save_state_flags_t enum save_state_flags_t
{ {
// saves settings (i.e. the session_settings) // saves settings (i.e. the session_settings)
save_settings = 0x001, save_settings = 0x001,
// saves dht_settings // saves dht_settings
save_dht_settings = 0x002, save_dht_settings = 0x002,
skipping to change at line 523 skipping to change at line 525
// posted. // posted.
void dht_get_item(boost::array<char, 32> key void dht_get_item(boost::array<char, 32> key
, std::string salt = std::string()); , std::string salt = std::string());
// store the given bencoded data as an immutable item in the DHT. // store the given bencoded data as an immutable item in the DHT.
// the returned hash is the key that is to be used to look t he item // the returned hash is the key that is to be used to look t he item
// up agan. It's just the sha-1 hash of the bencoded form of the // up agan. It's just the sha-1 hash of the bencoded form of the
// structure. // structure.
sha1_hash dht_put_item(entry data); sha1_hash dht_put_item(entry data);
// store an immutable item. The ``key`` is the public key th e blob is // store a mutable item. The ``key`` is the public key the b lob is
// to be stored under. The optional ``salt`` argument is a s tring that // to be stored under. The optional ``salt`` argument is a s tring that
// is to be mixed in with the key when determining where in the DHT // is to be mixed in with the key when determining where in the DHT
// the value is to be stored. The callback function is calle d from within // the value is to be stored. The callback function is calle d from within
// the libtorrent network thread once we've found where to s tore the blob, // the libtorrent network thread once we've found where to s tore the blob,
// possibly with the current value stored under the key. // possibly with the current value stored under the key.
// The values passed to the callback functions are: // The values passed to the callback functions are:
// //
// entry& value // entry& value
// the current value stored under the key (may be empty ). Also expected // the current value stored under the key (may be empty ). Also expected
// to be set to the value to be stored by the function. // to be set to the value to be stored by the function.
 End of changes. 2 change blocks. 
1 lines changed or deleted 3 lines changed or added


 session_status.hpp   session_status.hpp 
skipping to change at line 96 skipping to change at line 96
}; };
// holds dht routing table stats // holds dht routing table stats
struct TORRENT_EXPORT dht_routing_bucket struct TORRENT_EXPORT dht_routing_bucket
{ {
// the total number of nodes and replacement nodes // the total number of nodes and replacement nodes
// in the routing table // in the routing table
int num_nodes; int num_nodes;
int num_replacements; int num_replacements;
#ifndef TORRENT_NO_DEPRECATE
// number of seconds since last activity // number of seconds since last activity
int last_active; int last_active;
#endif
}; };
// holds counters and gauges for the uTP sockets // holds counters and gauges for the uTP sockets
struct TORRENT_EXPORT utp_status struct TORRENT_EXPORT utp_status
{ {
// gauges. These are snapshots of the number of // gauges. These are snapshots of the number of
// uTP sockets in each respective state // uTP sockets in each respective state
int num_idle; int num_idle;
int num_syn_sent; int num_syn_sent;
int num_connected; int num_connected;
 End of changes. 2 change blocks. 
0 lines changed or deleted 2 lines changed or added


 sliding_average.hpp   sliding_average.hpp 
skipping to change at line 37 skipping to change at line 37
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_SLIDING_AVERAGE_HPP_INCLUDED #ifndef TORRENT_SLIDING_AVERAGE_HPP_INCLUDED
#define TORRENT_SLIDING_AVERAGE_HPP_INCLUDED #define TORRENT_SLIDING_AVERAGE_HPP_INCLUDED
#include <boost/cstdint.hpp> #include <boost/cstdint.hpp>
#include <cstdlib> // for std::abs
namespace libtorrent namespace libtorrent
{ {
// an exponential moving average accumulator. Add samples to it and it keep s // an exponential moving average accumulator. Add samples to it and it keep s
// track of a moving mean value and an average deviation // track of a moving mean value and an average deviation
template <int inverted_gain> template <int inverted_gain>
struct sliding_average struct sliding_average
{ {
sliding_average(): m_mean(0), m_average_deviation(0), m_num_samples( 0) {} sliding_average(): m_mean(0), m_average_deviation(0), m_num_samples( 0) {}
void add_sample(int s) void add_sample(int s)
{ {
// fixed point // fixed point
s *= 64; s *= 64;
int deviation; int deviation;
if (m_num_samples > 0) if (m_num_samples > 0)
deviation = abs(m_mean - s); deviation = std::abs(m_mean - s);
if (m_num_samples < inverted_gain) if (m_num_samples < inverted_gain)
++m_num_samples; ++m_num_samples;
m_mean += (s - m_mean) / m_num_samples; m_mean += (s - m_mean) / m_num_samples;
if (m_num_samples > 1) { if (m_num_samples > 1) {
// the the exact same thing for deviation off the me an except -1 on // the the exact same thing for deviation off the me an except -1 on
// the samples, because the number of deviation samp les always lags // the samples, because the number of deviation samp les always lags
// behind by 1 (you need to actual samples to have a single deviation // behind by 1 (you need to actual samples to have a single deviation
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 socket.hpp   socket.hpp 
skipping to change at line 138 skipping to change at line 138
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>
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;
}; };
#endif #endif
#ifdef IPV6_TCLASS
struct traffic_class struct traffic_class
{ {
traffic_class(char val): m_value(val) {} traffic_class(char val): m_value(val) {}
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_TCLASS; } int name(Protocol const&) const { return IPV6_TCLASS; }
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;
}; };
#endif
struct type_of_service struct type_of_service
{ {
#ifdef WIN32 #ifdef WIN32
typedef DWORD tos_t; typedef DWORD tos_t;
#else #else
typedef int tos_t; typedef int tos_t;
#endif #endif
type_of_service(char val): m_value(val) {} type_of_service(char val): m_value(val) {}
template<class Protocol> template<class Protocol>
 End of changes. 2 change blocks. 
0 lines changed or deleted 2 lines changed or added


 socks5_stream.hpp   socks5_stream.hpp 
skipping to change at line 66 skipping to change at line 66
authentication_error, authentication_error,
username_required, username_required,
general_failure, general_failure,
command_not_supported, command_not_supported,
no_identd, no_identd,
identd_error, identd_error,
num_errors num_errors
}; };
// internal
TORRENT_EXPORT boost::system::error_code make_error_code(socks_error _code e); TORRENT_EXPORT boost::system::error_code make_error_code(socks_error _code e);
} // namespace socks_error } // namespace socks_error
// returns the error_category for SOCKS5 errors // returns the error_category for SOCKS5 errors
TORRENT_EXPORT boost::system::error_category& get_socks_category(); TORRENT_EXPORT boost::system::error_category& get_socks_category();
class socks5_stream : public proxy_base class socks5_stream : public proxy_base
{ {
public: public:
explicit socks5_stream(io_service& io_service) explicit socks5_stream(io_service& io_service)
 End of changes. 2 change blocks. 
0 lines changed or deleted 2 lines changed or added


 storage.hpp   storage.hpp 
skipping to change at line 433 skipping to change at line 433
// an empty vector. Any file whose index is not represented by the vector // an empty vector. Any file whose index is not represented by the vector
// (because the vector is too short) are assumed to have pri ority 1. // (because the vector is too short) are assumed to have pri ority 1.
// this is used to treat files with priority 0 slightly diff erently. // this is used to treat files with priority 0 slightly diff erently.
default_storage(file_storage const& fs, file_storage const* mapped default_storage(file_storage const& fs, file_storage const* mapped
, std::string const& path, file_pool& fp , std::string const& path, file_pool& fp
, std::vector<boost::uint8_t> const& file_prio); , std::vector<boost::uint8_t> const& file_prio);
// hidden // hidden
~default_storage(); ~default_storage();
// hidden
void set_file_priority(std::vector<boost::uint8_t> const& pr io); void set_file_priority(std::vector<boost::uint8_t> const& pr io);
#ifndef TORRENT_NO_DEPRECATE #ifndef TORRENT_NO_DEPRECATE
void finalize_file(int file); void finalize_file(int file);
#endif #endif
bool has_any_file(); bool has_any_file();
bool rename_file(int index, std::string const& new_filename) ; bool rename_file(int index, std::string const& new_filename) ;
bool release_files(); bool release_files();
bool delete_files(); bool delete_files();
bool initialize(bool allocate_files); bool initialize(bool allocate_files);
int move_storage(std::string const& save_path, int flags); int move_storage(std::string const& save_path, int flags);
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 torrent.hpp   torrent.hpp 
skipping to change at line 153 skipping to change at line 153
torrent(aux::session_impl& ses, tcp::endpoint const& net_int erface torrent(aux::session_impl& ses, tcp::endpoint const& net_int erface
, int block_size, int seq, add_torrent_params const& p , int block_size, int seq, add_torrent_params const& p
, sha1_hash const& info_hash); , sha1_hash const& info_hash);
~torrent(); ~torrent();
#ifndef TORRENT_DISABLE_ENCRYPTION #ifndef TORRENT_DISABLE_ENCRYPTION
sha1_hash const& obfuscated_hash() const sha1_hash const& obfuscated_hash() const
{ return m_obfuscated_hash; } { return m_obfuscated_hash; }
#endif #endif
sha1_hash const& info_hash() const // This may be called from multiple threads
{ sha1_hash const& info_hash() const { return m_info_hash; }
static sha1_hash empty;
return m_torrent_file ? m_torrent_file->info_hash()
: empty;
}
bool is_deleted() const { return m_deleted; } bool is_deleted() const { return m_deleted; }
// starts the announce timer // starts the announce timer
void start(); void start();
void start_download_url(); void start_download_url();
#ifndef TORRENT_DISABLE_EXTENSIONS #ifndef TORRENT_DISABLE_EXTENSIONS
void add_extension(boost::shared_ptr<torrent_plugin>); void add_extension(boost::shared_ptr<torrent_plugin>);
skipping to change at line 552 skipping to change at line 549
return m_super_seeding && is_seed(); return m_super_seeding && is_seed();
} }
void super_seeding(bool on); void super_seeding(bool on);
int get_piece_to_super_seed(bitfield const&); int get_piece_to_super_seed(bitfield const&);
// returns true if we have downloaded the given piece // returns true if we have downloaded the given piece
bool have_piece(int index) const bool have_piece(int index) const
{ {
if (!valid_metadata()) return false; if (!valid_metadata()) return false;
if (!has_picker()) return true; if (!has_picker()) return is_seed();
return m_picker->have_piece(index); return m_picker->have_piece(index);
} }
// called when we learn that we have a piece // called when we learn that we have a piece
// only once per piece // only once per piece
void we_have(int index); void we_have(int index);
int num_have() const int num_have() const
{ {
// pretend we have every piece when in seed mode // pretend we have every piece when in seed mode
skipping to change at line 1116 skipping to change at line 1113
// m_num_verified = m_verified.count() // m_num_verified = m_verified.count()
boost::uint32_t m_num_verified; boost::uint32_t m_num_verified;
#ifndef TORRENT_DISABLE_ENCRYPTION #ifndef TORRENT_DISABLE_ENCRYPTION
// this is SHA1("req2" + info-hash), used for // this is SHA1("req2" + info-hash), used for
// encrypted hand shakes // encrypted hand shakes
sha1_hash m_obfuscated_hash; sha1_hash m_obfuscated_hash;
#endif #endif
// keep a copy if the info-hash here, so it can be accessed
from multiple
// threads, and be cheap to access from the client
sha1_hash m_info_hash;
// the average time it takes to download one time critical p iece // the average time it takes to download one time critical p iece
boost::uint32_t m_average_piece_time; boost::uint32_t m_average_piece_time;
// the average piece download time deviation // the average piece download time deviation
boost::uint32_t m_piece_time_deviation; boost::uint32_t m_piece_time_deviation;
// the number of bytes that has been // the number of bytes that has been
// downloaded that failed the hash-test // downloaded that failed the hash-test
boost::uint32_t m_total_failed_bytes; boost::uint32_t m_total_failed_bytes;
boost::uint32_t m_total_redundant_bytes; boost::uint32_t m_total_redundant_bytes;
 End of changes. 3 change blocks. 
7 lines changed or deleted 8 lines changed or added


 torrent_handle.hpp   torrent_handle.hpp 
skipping to change at line 1149 skipping to change at line 1149
// all wstring APIs are deprecated since 0.16.11 // all wstring APIs are deprecated since 0.16.11
// instead, use the wchar -> utf8 conversion functions // instead, use the wchar -> utf8 conversion functions
// and pass in utf8 strings // and pass in utf8 strings
TORRENT_DEPRECATED_PREFIX TORRENT_DEPRECATED_PREFIX
void move_storage(std::wstring const& save_path, int flags = 0) const TORRENT_DEPRECATED; void move_storage(std::wstring const& save_path, int flags = 0) const TORRENT_DEPRECATED;
TORRENT_DEPRECATED_PREFIX TORRENT_DEPRECATED_PREFIX
void rename_file(int index, std::wstring const& new_name) co nst TORRENT_DEPRECATED; void rename_file(int index, std::wstring const& new_name) co nst TORRENT_DEPRECATED;
#endif // TORRENT_USE_WSTRING #endif // TORRENT_USE_WSTRING
#endif // TORRENT_NO_DEPRECATE #endif // TORRENT_NO_DEPRECATE
// Enables or disabled super seeding/initial seeding for thi // Enables or disabled super seeding/initial seeding for thi
s torrent. The torrent s torrent.
// needs to be a seed for this to take effect. // The torrent needs to be a seed for this to take effect.
void super_seeding(bool on) const; void super_seeding(bool on) const;
// ``info_hash()`` returns the info-hash for the torrent. // ``info_hash()`` returns the info-hash of the torrent. If
this handle
// is to a torrent that hasn't loaded yet (for instance by b
eing added)
// by a URL, the returned value is undefined.
sha1_hash info_hash() const; sha1_hash info_hash() const;
// comparison operators. The order of the torrents is unspec ified // comparison operators. The order of the torrents is unspec ified
// but stable. // but stable.
bool operator==(const torrent_handle& h) const bool operator==(const torrent_handle& h) const
{ return m_torrent.lock() == h.m_torrent.lock(); } { return m_torrent.lock() == h.m_torrent.lock(); }
bool operator!=(const torrent_handle& h) const bool operator!=(const torrent_handle& h) const
{ return m_torrent.lock() != h.m_torrent.lock(); } { return m_torrent.lock() != h.m_torrent.lock(); }
bool operator<(const torrent_handle& h) const bool operator<(const torrent_handle& h) const
{ return m_torrent.lock() < h.m_torrent.lock(); } { return m_torrent.lock() < h.m_torrent.lock(); }
 End of changes. 2 change blocks. 
4 lines changed or deleted 8 lines changed or added


 torrent_info.hpp   torrent_info.hpp 
skipping to change at line 312 skipping to change at line 312
#ifndef BOOST_NO_EXCEPTIONS #ifndef BOOST_NO_EXCEPTIONS
// for backwards compatibility with 0.14 // for backwards compatibility with 0.14
typedef libtorrent_exception invalid_torrent_file; typedef libtorrent_exception invalid_torrent_file;
#endif #endif
// This class represents the information stored in a .torrent file // This class represents the information stored in a .torrent file
class TORRENT_EXPORT torrent_info : public intrusive_ptr_base<torren t_info> class TORRENT_EXPORT torrent_info : public intrusive_ptr_base<torren t_info>
{ {
public: public:
// The constructor that takes an info-hash will initialize // The constructor that takes an info-hash will initialize
the info-hash to the given value, the info-hash
// but leave all other fields empty. This is used internally // to the given value, but leave all other fields empty. Thi
when downloading torrents without s is used
// the metadata. The metadata will be created by libtorrent // internally when downloading torrents without the metadata
as soon as it has been downloaded . The
// from the swarm. // metadata will be created by libtorrent as soon as it has
// been
// The constructor that takes a lazy_entry will create a tor // downloaded from the swarm.
rent_info object from the //
// information found in the given torrent_file. The lazy_ent // The constructor that takes a lazy_entry will create a tor
ry represents a tree node in rent_info
// an bencoded file. To load an ordinary .torrent file // object from the information found in the given torrent_fi
// into a lazy_entry, use lazy_bdecode(). le. The
// // lazy_entry represents a tree node in an bencoded file. To
// The version that takes a buffer pointer and a size will d load an
ecode it as a .torrent file and // ordinary .torrent file into a lazy_entry, use lazy_bdecod
// initialize the torrent_info object for you. e().
// //
// The version that takes a filename will simply load the to // The version that takes a buffer pointer and a size will d
rrent file and decode it inside ecode it as a
// the constructor, for convenience. This might not be the m // .torrent file and initialize the torrent_info object for
ost suitable for applications that you.
// want to be able to report detailed errors on what might g //
o wrong. // The version that takes a filename will simply load the to
// rrent file
// The overloads that takes an ``error_code const&`` never t // and decode it inside the constructor, for convenience. Th
hrows if an error occur, they is might not
// will simply set the error code to describe what went wron // be the most suitable for applications that want to be abl
g and not fully initialize the e to report
// torrent_info object. The overloads that do not take the e // detailed errors on what might go wrong.
xtra error_code parameter will //
// always throw if an error occurs. These overloads are not // There is an upper limit on the size of the torrent file t
available when building without hat will be
// exception support. // loaded by the overload taking a filename. If it's importa
nt that even
// very large torrent files are loaded, use one of the other
overloads.
//
// The overloads that takes an ``error_code const&`` never t
hrows if an
// error occur, they will simply set the error code to descr
ibe what went
// wrong and not fully initialize the torrent_info object. T
he overloads
// that do not take the extra error_code parameter will alwa
ys throw if
// an error occurs. These overloads are not available when b
uilding
// without exception support.
// //
// The ``flags`` argument is currently unused. // The ``flags`` argument is currently unused.
#ifndef BOOST_NO_EXCEPTIONS #ifndef BOOST_NO_EXCEPTIONS
torrent_info(lazy_entry const& torrent_file, int flags = 0); torrent_info(lazy_entry const& torrent_file, int flags = 0);
torrent_info(char const* buffer, int size, int flags = 0); torrent_info(char const* buffer, int size, int flags = 0);
torrent_info(std::string const& filename, int flags = 0); torrent_info(std::string const& filename, int flags = 0);
#ifndef TORRENT_NO_DEPRECATE #ifndef TORRENT_NO_DEPRECATE
#if TORRENT_USE_WSTRING #if TORRENT_USE_WSTRING
// all wstring APIs are deprecated since 0.16.11 // all wstring APIs are deprecated since 0.16.11
// instead, use the wchar -> utf8 conversion functions // instead, use the wchar -> utf8 conversion functions
 End of changes. 1 change blocks. 
35 lines changed or deleted 50 lines changed or added


 traversal_algorithm.hpp   traversal_algorithm.hpp 
skipping to change at line 87 skipping to change at line 87
node_id const& target() const { return m_target; } node_id const& target() const { return m_target; }
void resort_results(); void resort_results();
void add_entry(node_id const& id, udp::endpoint addr, unsigned char flags); void add_entry(node_id const& id, udp::endpoint addr, unsigned char flags);
traversal_algorithm(node_impl& node, node_id target); traversal_algorithm(node_impl& node, node_id target);
int invoke_count() const { return m_invoke_count; } int invoke_count() const { return m_invoke_count; }
int branch_factor() const { return m_branch_factor; } int branch_factor() const { return m_branch_factor; }
node_impl& node() const { return m_node; }
protected: protected:
// returns true if we're done // returns true if we're done
bool add_requests(); bool add_requests();
void add_router_entries(); void add_router_entries();
void init(); void init();
virtual void done(); virtual void done();
// should construct an algorithm dependent // should construct an algorithm dependent
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 upnp.hpp   upnp.hpp 
skipping to change at line 98 skipping to change at line 98
remote_host_must_be_wildcard = 726, remote_host_must_be_wildcard = 726,
// ExternalPort must be a wildcard and cannot be a // ExternalPort must be a wildcard and cannot be a
// specific port // specific port
external_port_must_be_wildcard = 727 external_port_must_be_wildcard = 727
}; };
// hidden // hidden
TORRENT_EXPORT boost::system::error_code make_error_code(err or_code_enum e); TORRENT_EXPORT boost::system::error_code make_error_code(err or_code_enum e);
} }
// the boost.system error category for UPnP errors
TORRENT_EXPORT boost::system::error_category& get_upnp_category(); TORRENT_EXPORT boost::system::error_category& get_upnp_category();
// int: port-mapping index // int: port-mapping index
// address: external address as queried from router // address: external address as queried from router
// int: external port // int: external port
// std::string: error message // std::string: error message
// an empty string as error means success // an empty string as error means success
// a port-mapping index of -1 means it's // a port-mapping index of -1 means it's
// an informational log message // an informational log message
typedef boost::function<void(int, address, int, error_code const&)> portmap _callback_t; typedef boost::function<void(int, address, int, error_code const&)> portmap _callback_t;
 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 1 #define LIBTORRENT_VERSION_MAJOR 1
#define LIBTORRENT_VERSION_MINOR 0 #define LIBTORRENT_VERSION_MINOR 0
#define LIBTORRENT_VERSION_TINY 2 #define LIBTORRENT_VERSION_TINY 3
// the format of this version is: MMmmtt // the format of this version is: MMmmtt
// M = Major version, m = minor version, t = tiny version // M = Major version, m = minor version, t = tiny version
#define LIBTORRENT_VERSION_NUM ((LIBTORRENT_VERSION_MAJOR * 10000) + (LIBTO RRENT_VERSION_MINOR * 100) + LIBTORRENT_VERSION_TINY) #define LIBTORRENT_VERSION_NUM ((LIBTORRENT_VERSION_MAJOR * 10000) + (LIBTO RRENT_VERSION_MINOR * 100) + LIBTORRENT_VERSION_TINY)
#define LIBTORRENT_VERSION "1.0.2.0" #define LIBTORRENT_VERSION "1.0.3.0"
#define LIBTORRENT_REVISION "$Rev: 10260 $" #define LIBTORRENT_REVISION "$Rev: 10402 $"
#endif #endif
 End of changes. 2 change blocks. 
3 lines changed or deleted 3 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/