GeoIP.h | GeoIP.h | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
#define GEOIP_H | #define GEOIP_H | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
#include<stdio.h> | #include<stdio.h> | |||
#include<stdlib.h> | #include<stdlib.h> | |||
#include<string.h> | #include<string.h> | |||
#include <sys/types.h> /* for fstat */ | #include <sys/types.h> /* for fstat */ | |||
#include <sys/stat.h> /* for fstat */ | ||||
#define SEGMENT_RECORD_LENGTH 3 | #define SEGMENT_RECORD_LENGTH 3 | |||
#define STANDARD_RECORD_LENGTH 3 | #define STANDARD_RECORD_LENGTH 3 | |||
#define ORG_RECORD_LENGTH 4 | #define ORG_RECORD_LENGTH 4 | |||
#define MAX_RECORD_LENGTH 4 | #define MAX_RECORD_LENGTH 4 | |||
#define NUM_DB_TYPES 20 | #define NUM_DB_TYPES 20 | |||
typedef struct GeoIPTag { | typedef struct GeoIPTag { | |||
FILE *GeoIPDatabase; | FILE *GeoIPDatabase; | |||
char *file_path; | char *file_path; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 0 lines changed or added | |||
alloca.hpp | alloca.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_ALLOCA | #ifndef TORRENT_ALLOCA | |||
#include "libtorrent/config.hpp" | #include "libtorrent/config.hpp" | |||
#if defined TORRENT_WINDOWS | #if defined TORRENT_WINDOWS || defined TORRENT_MINGW | |||
#include <malloc.h> | #include <malloc.h> | |||
#define TORRENT_ALLOCA(t, n) static_cast<t*>(_alloca(sizeof(t) * (n))) | #define TORRENT_ALLOCA(t, n) static_cast<t*>(_alloca(sizeof(t) * (n))) | |||
#elif defined TORRENT_BSD | #elif defined TORRENT_BSD | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#define TORRENT_ALLOCA(t, n) static_cast<t*>(alloca(sizeof(t) * (n))) | #define TORRENT_ALLOCA(t, n) static_cast<t*>(alloca(sizeof(t) * (n))) | |||
#else | #else | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
config.hpp | config.hpp | |||
---|---|---|---|---|
skipping to change at line 145 | skipping to change at line 145 | |||
#elif defined BOOST_MSVC | #elif defined BOOST_MSVC | |||
#pragma warning(disable: 4258) | #pragma warning(disable: 4258) | |||
#pragma warning(disable: 4251) | #pragma warning(disable: 4251) | |||
// class X needs to have dll-interface to be used by clients of class Y | // class X needs to have dll-interface to be used by clients of class Y | |||
#pragma warning(disable:4251) | #pragma warning(disable:4251) | |||
// '_vsnprintf': This function or variable may be unsafe | // '_vsnprintf': This function or variable may be unsafe | |||
#pragma warning(disable:4996) | #pragma warning(disable:4996) | |||
// 'strdup': The POSIX name for this item is deprecated. Instead, use the I | ||||
SO C++ conformant name: _strdup | ||||
#pragma warning(disable: 4996) | ||||
#define strdup _strdup | ||||
#define TORRENT_DEPRECATED_PREFIX __declspec(deprecated) | #define TORRENT_DEPRECATED_PREFIX __declspec(deprecated) | |||
#endif | #endif | |||
// ======= PLATFORMS ========= | // ======= PLATFORMS ========= | |||
// set up defines for target environments | // set up defines for target environments | |||
// ==== AMIGA === | // ==== AMIGA === | |||
#if defined __AMIGA__ || defined __amigaos__ || defined __AROS__ | #if defined __AMIGA__ || defined __amigaos__ || defined __AROS__ | |||
skipping to change at line 443 | skipping to change at line 440 | |||
// if set to true, piece picker will use less RAM | // if set to true, piece picker will use less RAM | |||
// but only support up to ~260000 pieces in a torrent | // but only support up to ~260000 pieces in a torrent | |||
#ifndef TORRENT_COMPACT_PICKER | #ifndef TORRENT_COMPACT_PICKER | |||
#define TORRENT_COMPACT_PICKER 0 | #define TORRENT_COMPACT_PICKER 0 | |||
#endif | #endif | |||
#ifndef TORRENT_USE_I2P | #ifndef TORRENT_USE_I2P | |||
#define TORRENT_USE_I2P 1 | #define TORRENT_USE_I2P 1 | |||
#endif | #endif | |||
#ifndef TORRENT_HAS_STRDUP | ||||
#define TORRENT_HAS_STRDUP 1 | ||||
#endif | ||||
#if !defined TORRENT_IOV_MAX | #if !defined TORRENT_IOV_MAX | |||
#ifdef IOV_MAX | #ifdef IOV_MAX | |||
#define TORRENT_IOV_MAX IOV_MAX | #define TORRENT_IOV_MAX IOV_MAX | |||
#else | #else | |||
#define TORRENT_IOV_MAX INT_MAX | #define TORRENT_IOV_MAX INT_MAX | |||
#endif | #endif | |||
#endif | #endif | |||
#if !defined(TORRENT_READ_HANDLER_MAX_SIZE) | #if !defined(TORRENT_READ_HANDLER_MAX_SIZE) | |||
# define TORRENT_READ_HANDLER_MAX_SIZE 300 | # define TORRENT_READ_HANDLER_MAX_SIZE 300 | |||
skipping to change at line 500 | skipping to change at line 493 | |||
#elif defined(TORRENT_AMIGA) | #elif defined(TORRENT_AMIGA) | |||
#define TORRENT_USE_ECLOCK 1 | #define TORRENT_USE_ECLOCK 1 | |||
#elif defined(TORRENT_BEOS) | #elif defined(TORRENT_BEOS) | |||
#define TORRENT_USE_SYSTEM_TIME 1 | #define TORRENT_USE_SYSTEM_TIME 1 | |||
#else | #else | |||
#define TORRENT_USE_BOOST_DATE_TIME 1 | #define TORRENT_USE_BOOST_DATE_TIME 1 | |||
#endif | #endif | |||
#endif | #endif | |||
#if !TORRENT_HAS_STRDUP | ||||
inline char* strdup(char const* str) | ||||
{ | ||||
if (str == 0) return 0; | ||||
char* tmp = (char*)malloc(strlen(str) + 1); | ||||
if (tmp == 0) return 0; | ||||
strcpy(tmp, str); | ||||
return tmp; | ||||
} | ||||
#endif | ||||
// for non-exception builds | // for non-exception builds | |||
#ifdef BOOST_NO_EXCEPTIONS | #ifdef BOOST_NO_EXCEPTIONS | |||
#define TORRENT_TRY if (true) | #define TORRENT_TRY if (true) | |||
#define TORRENT_CATCH(x) else if (false) | #define TORRENT_CATCH(x) else if (false) | |||
#define TORRENT_DECLARE_DUMMY(x, y) x y | #define TORRENT_DECLARE_DUMMY(x, y) x y | |||
#else | #else | |||
#define TORRENT_TRY try | #define TORRENT_TRY try | |||
#define TORRENT_CATCH(x) catch(x) | #define TORRENT_CATCH(x) catch(x) | |||
#define TORRENT_DECLARE_DUMMY(x, y) | #define TORRENT_DECLARE_DUMMY(x, y) | |||
#endif // BOOST_NO_EXCEPTIONS | #endif // BOOST_NO_EXCEPTIONS | |||
End of changes. 3 change blocks. | ||||
19 lines changed or deleted | 0 lines changed or added | |||
debug.hpp | debug.hpp | |||
---|---|---|---|---|
skipping to change at line 110 | skipping to change at line 110 | |||
printf("%s: (%d)\n%s\n", i->first.c_str(), i->second .refs, i->second.stack.c_str()); | printf("%s: (%d)\n%s\n", i->first.c_str(), i->second .refs, i->second.stack.c_str()); | |||
} | } | |||
return ret; | return ret; | |||
} | } | |||
} | } | |||
#endif | #endif | |||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined T ORRENT_ERROR_LOGGING | #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined T ORRENT_ERROR_LOGGING | |||
#include <string> | #include <cstring> | |||
#include "libtorrent/config.hpp" | #include "libtorrent/config.hpp" | |||
#include "libtorrent/file.hpp" | #include "libtorrent/file.hpp" | |||
#include "libtorrent/thread.hpp" | #include "libtorrent/thread.hpp" | |||
#if TORRENT_USE_IOSTREAM | #if TORRENT_USE_IOSTREAM | |||
#include <string> | ||||
#include <fstream> | #include <fstream> | |||
#include <iostream> | #include <iostream> | |||
#endif | #endif | |||
namespace libtorrent | namespace libtorrent | |||
{ | { | |||
// DEBUG API | // DEBUG API | |||
struct logger | struct logger | |||
{ | { | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||
error_code.hpp | error_code.hpp | |||
---|---|---|---|---|
skipping to change at line 50 | skipping to change at line 50 | |||
// asio assumes that the windows error codes are defined already | // asio assumes that the windows error codes are defined already | |||
#include <winsock2.h> | #include <winsock2.h> | |||
#endif | #endif | |||
#if BOOST_VERSION < 103500 | #if BOOST_VERSION < 103500 | |||
#include <asio/error_code.hpp> | #include <asio/error_code.hpp> | |||
#else | #else | |||
#include <boost/system/error_code.hpp> | #include <boost/system/error_code.hpp> | |||
#endif | #endif | |||
#include <string.h> // strdup | #include "libtorrent/string_util.hpp" // for allocate_string_copy | |||
#include <stdlib.h> // free | #include <stdlib.h> // free | |||
namespace libtorrent | namespace libtorrent | |||
{ | { | |||
namespace errors | namespace errors | |||
{ | { | |||
enum error_code_enum | enum error_code_enum | |||
{ | { | |||
no_error = 0, | no_error = 0, | |||
skipping to change at line 367 | skipping to change at line 367 | |||
namespace errors | namespace errors | |||
{ | { | |||
inline boost::system::error_code make_error_code(error_code_ enum e) | inline boost::system::error_code make_error_code(error_code_ enum e) | |||
{ | { | |||
return boost::system::error_code(e, get_libtorrent_c ategory()); | return boost::system::error_code(e, get_libtorrent_c ategory()); | |||
} | } | |||
} | } | |||
using boost::system::error_code; | using boost::system::error_code; | |||
#if BOOST_VERSION < 104400 | ||||
inline boost::system::error_category const& get_system_category() | inline boost::system::error_category const& get_system_category() | |||
{ return boost::system::get_system_category(); } | { return boost::system::get_system_category(); } | |||
#else | ||||
inline boost::system::error_category const& get_system_category() | ||||
{ return boost::system::system_category(); } | ||||
#endif | ||||
inline boost::system::error_category const& get_posix_category() | inline boost::system::error_category const& get_posix_category() | |||
#if BOOST_VERSION < 103600 | #if BOOST_VERSION < 103600 | |||
{ return boost::system::get_posix_category(); } | { return boost::system::get_posix_category(); } | |||
#else | #elif BOOST_VERSION < 104400 | |||
{ return boost::system::get_generic_category(); } | { return boost::system::get_generic_category(); } | |||
#else | ||||
{ return boost::system::generic_category(); } | ||||
#endif // BOOST_VERSION < 103600 | #endif // BOOST_VERSION < 103600 | |||
#endif // BOOST_VERSION < 103500 | #endif // BOOST_VERSION < 103500 | |||
#ifndef BOOST_NO_EXCEPTIONS | #ifndef BOOST_NO_EXCEPTIONS | |||
struct TORRENT_EXPORT libtorrent_exception: std::exception | struct TORRENT_EXPORT libtorrent_exception: std::exception | |||
{ | { | |||
libtorrent_exception(error_code const& s): m_error(s), m_msg (0) {} | libtorrent_exception(error_code const& s): m_error(s), m_msg (0) {} | |||
virtual const char* what() const throw() | virtual const char* what() const throw() | |||
{ | { | |||
if (!m_msg) | if (!m_msg) | |||
{ | { | |||
std::string msg = m_error.message(); | std::string msg = m_error.message(); | |||
m_msg = strdup(msg.c_str()); | m_msg = allocate_string_copy(msg.c_str()); | |||
} | } | |||
return m_msg; | return m_msg; | |||
} | } | |||
virtual ~libtorrent_exception() throw() { free(m_msg); } | virtual ~libtorrent_exception() throw() { free(m_msg); } | |||
error_code error() const { return m_error; } | error_code error() const { return m_error; } | |||
private: | private: | |||
error_code m_error; | error_code m_error; | |||
mutable char* m_msg; | mutable char* m_msg; | |||
}; | }; | |||
End of changes. 6 change blocks. | ||||
3 lines changed or deleted | 12 lines changed or added | |||
escape_string.hpp | escape_string.hpp | |||
---|---|---|---|---|
skipping to change at line 46 | skipping to change at line 46 | |||
#include <string> | #include <string> | |||
#include <boost/limits.hpp> | #include <boost/limits.hpp> | |||
#include <boost/array.hpp> | #include <boost/array.hpp> | |||
#include "libtorrent/config.hpp" | #include "libtorrent/config.hpp" | |||
#include "libtorrent/size_type.hpp" | #include "libtorrent/size_type.hpp" | |||
#include "libtorrent/error_code.hpp" | #include "libtorrent/error_code.hpp" | |||
namespace libtorrent | namespace libtorrent | |||
{ | { | |||
TORRENT_EXTRA_EXPORT boost::array<char, 4 + std::numeric_limits<size _type>::digits10> to_string(size_type n); | TORRENT_EXTRA_EXPORT boost::array<char, 4 + std::numeric_limits<size _type>::digits10> to_string(size_type n); | |||
TORRENT_EXTRA_EXPORT bool is_alpha(char c); | ||||
TORRENT_EXPORT bool is_digit(char c); | ||||
TORRENT_EXTRA_EXPORT bool is_print(char c); | ||||
TORRENT_EXTRA_EXPORT bool is_space(char c); | ||||
TORRENT_EXTRA_EXPORT char to_lower(char c); | ||||
TORRENT_EXTRA_EXPORT int split_string(char const** tags, int buf_siz | ||||
e, char* in); | ||||
TORRENT_EXTRA_EXPORT bool string_begins_no_case(char const* s1, char | ||||
const* s2); | ||||
TORRENT_EXTRA_EXPORT bool string_equal_no_case(char const* s1, char | ||||
const* s2); | ||||
TORRENT_EXTRA_EXPORT void url_random(char* begin, char* end); | ||||
TORRENT_EXTRA_EXPORT std::string unescape_string(std::string const& s, error_code& ec); | TORRENT_EXTRA_EXPORT std::string unescape_string(std::string const& s, error_code& ec); | |||
// replaces all disallowed URL characters by their %-encoding | // replaces all disallowed URL characters by their %-encoding | |||
TORRENT_EXTRA_EXPORT std::string escape_string(const char* str, int len); | TORRENT_EXTRA_EXPORT std::string escape_string(const char* str, int len); | |||
// same as escape_string but does not encode '/' | // same as escape_string but does not encode '/' | |||
TORRENT_EXTRA_EXPORT std::string escape_path(const char* str, int le n); | TORRENT_EXTRA_EXPORT std::string escape_path(const char* str, int le n); | |||
// if the url does not appear to be encoded, and it contains illegal url characters | // if the url does not appear to be encoded, and it contains illegal url characters | |||
// it will be encoded | // it will be encoded | |||
TORRENT_EXTRA_EXPORT std::string maybe_url_encode(std::string const& url); | TORRENT_EXTRA_EXPORT std::string maybe_url_encode(std::string const& url); | |||
End of changes. 1 change blocks. | ||||
14 lines changed or deleted | 0 lines changed or added | |||
file.hpp | file.hpp | |||
---|---|---|---|---|
skipping to change at line 62 | skipping to change at line 62 | |||
#include "libtorrent/intrusive_ptr_base.hpp" | #include "libtorrent/intrusive_ptr_base.hpp" | |||
#ifdef TORRENT_WINDOWS | #ifdef TORRENT_WINDOWS | |||
// windows part | // windows part | |||
#ifndef WIN32_LEAN_AND_MEAN | #ifndef WIN32_LEAN_AND_MEAN | |||
#define WIN32_LEAN_AND_MEAN | #define WIN32_LEAN_AND_MEAN | |||
#endif | #endif | |||
#include <windows.h> | #include <windows.h> | |||
#include <winioctl.h> | #include <winioctl.h> | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include <sys/stat.h> | ||||
#else | #else | |||
// posix part | // posix part | |||
#define _FILE_OFFSET_BITS 64 | #define _FILE_OFFSET_BITS 64 | |||
#ifndef _GNU_SOURCE | #ifndef _GNU_SOURCE | |||
#define _GNU_SOURCE | #define _GNU_SOURCE | |||
#endif | #endif | |||
#ifndef _XOPEN_SOURCE | #ifndef _XOPEN_SOURCE | |||
#define _XOPEN_SOURCE 600 | #define _XOPEN_SOURCE 600 | |||
skipping to change at line 95 | skipping to change at line 94 | |||
namespace libtorrent | namespace libtorrent | |||
{ | { | |||
struct file_status | struct file_status | |||
{ | { | |||
size_type file_size; | size_type file_size; | |||
time_t atime; | time_t atime; | |||
time_t mtime; | time_t mtime; | |||
time_t ctime; | time_t ctime; | |||
enum { | enum { | |||
#if defined TORRENT_WINDOWS | #if defined TORRENT_WINDOWS | |||
directory = _S_IFDIR, | fifo = 0x1000, // named pipe (fifo) | |||
regular_file = _S_IFREG | character_special = 0x2000, // character special | |||
directory = 0x4000, // directory | ||||
regular_file = 0x8000 // regular | ||||
#else | #else | |||
fifo = S_IFIFO, | fifo = 0010000, // named pipe (fifo) | |||
character_special = S_IFCHR, | character_special = 0020000, // character special | |||
directory = S_IFDIR, | directory = 0040000, // directory | |||
block_special = S_IFBLK, | block_special = 0060000, // block special | |||
regular_file = S_IFREG, | regular_file = 0100000, // regular | |||
link = S_IFLNK, | link = 0120000, // symbolic link | |||
socket = S_IFSOCK | socket = 0140000 // socket | |||
#endif | #endif | |||
} modes_t; | } modes_t; | |||
int mode; | int mode; | |||
}; | }; | |||
enum stat_flags_t { dont_follow_links = 1 }; | enum stat_flags_t { dont_follow_links = 1 }; | |||
TORRENT_EXPORT void stat_file(std::string f, file_status* s | TORRENT_EXPORT void stat_file(std::string f, file_status* s | |||
, error_code& ec, int flags = 0); | , error_code& ec, int flags = 0); | |||
TORRENT_EXPORT void rename(std::string const& f | TORRENT_EXPORT void rename(std::string const& f | |||
, std::string const& newf, error_code& ec); | , std::string const& newf, error_code& ec); | |||
End of changes. 3 change blocks. | ||||
10 lines changed or deleted | 11 lines changed or added | |||
policy.hpp | policy.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_POLICY_HPP_INCLUDED | #ifndef TORRENT_POLICY_HPP_INCLUDED | |||
#define TORRENT_POLICY_HPP_INCLUDED | #define TORRENT_POLICY_HPP_INCLUDED | |||
#include <algorithm> | #include <algorithm> | |||
#include <deque> | #include <deque> | |||
#include "libtorrent/string_util.hpp" // for allocate_string_copy | ||||
#include "libtorrent/peer.hpp" | #include "libtorrent/peer.hpp" | |||
#include "libtorrent/piece_picker.hpp" | #include "libtorrent/piece_picker.hpp" | |||
#include "libtorrent/socket.hpp" | #include "libtorrent/socket.hpp" | |||
#include "libtorrent/address.hpp" | #include "libtorrent/address.hpp" | |||
#include "libtorrent/size_type.hpp" | #include "libtorrent/size_type.hpp" | |||
#include "libtorrent/invariant_check.hpp" | #include "libtorrent/invariant_check.hpp" | |||
#include "libtorrent/config.hpp" | #include "libtorrent/config.hpp" | |||
namespace libtorrent | namespace libtorrent | |||
skipping to change at line 490 | skipping to change at line 491 | |||
#if TORRENT_USE_IPV6 | #if TORRENT_USE_IPV6 | |||
is_v6_addr = false; | is_v6_addr = false; | |||
#endif | #endif | |||
#if TORRENT_USE_I2P | #if TORRENT_USE_I2P | |||
is_i2p_addr = false; | is_i2p_addr = false; | |||
#endif | #endif | |||
} | } | |||
#if TORRENT_USE_I2P | #if TORRENT_USE_I2P | |||
inline policy::i2p_peer::i2p_peer(char const* dest, bool connectable , int src) | inline policy::i2p_peer::i2p_peer(char const* dest, bool connectable , int src) | |||
: peer(0, connectable, src), destination(strdup(dest)) | : peer(0, connectable, src), destination(allocate_string_cop y(dest)) | |||
{ | { | |||
#if TORRENT_USE_IPV6 | #if TORRENT_USE_IPV6 | |||
is_v6_addr = false; | is_v6_addr = false; | |||
#endif | #endif | |||
is_i2p_addr = true; | is_i2p_addr = true; | |||
} | } | |||
inline policy::i2p_peer::~i2p_peer() | inline policy::i2p_peer::~i2p_peer() | |||
{ free(destination); } | { free(destination); } | |||
#endif // TORRENT_USE_I2P | #endif // TORRENT_USE_I2P | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||
session_impl.hpp | session_impl.hpp | |||
---|---|---|---|---|
skipping to change at line 1152 | skipping to change at line 1152 | |||
#endif | #endif | |||
}; | }; | |||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined T ORRENT_ERROR_LOGGING | #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined T ORRENT_ERROR_LOGGING | |||
struct tracker_logger : request_callback | struct tracker_logger : request_callback | |||
{ | { | |||
tracker_logger(session_impl& ses): m_ses(ses) {} | tracker_logger(session_impl& ses): m_ses(ses) {} | |||
void tracker_warning(tracker_request const& req | void tracker_warning(tracker_request const& req | |||
, std::string const& str) | , std::string const& str) | |||
{ | { | |||
debug_log("*** tracker warning: " + str); | debug_log("*** tracker warning: %s", str.c_s tr()); | |||
} | } | |||
void tracker_response(tracker_request const& | void tracker_response(tracker_request const& | |||
, libtorrent::address const& tracker_ip | , libtorrent::address const& tracker_ip | |||
, std::list<address> const& ip_list | , std::list<address> const& ip_list | |||
, std::vector<peer_entry>& peers | , std::vector<peer_entry>& peers | |||
, int interval | , int interval | |||
, int min_interval | , int min_interval | |||
, int complete | , int complete | |||
, int incomplete | , int incomplete | |||
skipping to change at line 1183 | skipping to change at line 1183 | |||
{ | { | |||
char pid[41]; | char pid[41]; | |||
to_hex((const char*)&i->pid[0], 20, pid); | to_hex((const char*)&i->pid[0], 20, pid); | |||
if (i->pid.is_all_zeros()) pid[0] = 0; | if (i->pid.is_all_zeros()) pid[0] = 0; | |||
snprintf(tmp, 200, " %-16s %-5d %s\n ", i->ip.c_str(), i->port, pid); | snprintf(tmp, 200, " %-16s %-5d %s\n ", i->ip.c_str(), i->port, pid); | |||
s += tmp; | s += tmp; | |||
} | } | |||
snprintf(tmp, 200, "external ip: %s\n", prin t_address(external_ip).c_str()); | snprintf(tmp, 200, "external ip: %s\n", prin t_address(external_ip).c_str()); | |||
s += tmp; | s += tmp; | |||
debug_log(s); | debug_log("%s", s.c_str()); | |||
} | } | |||
void tracker_request_timed_out( | void tracker_request_timed_out( | |||
tracker_request const&) | tracker_request const&) | |||
{ | { | |||
debug_log("*** tracker timed out"); | debug_log("*** tracker timed out"); | |||
} | } | |||
void tracker_request_error(tracker_request const& r | void tracker_request_error(tracker_request const& r | |||
, int response_code, error_code const& ec, c onst std::string& str | , int response_code, error_code const& ec, c onst std::string& str | |||
, int retry_interval) | , int retry_interval) | |||
{ | { | |||
char msg[256]; | debug_log("*** tracker error: %d: %s %s" | |||
snprintf(msg, sizeof(msg), "*** tracker erro | ||||
r: %d: %s %s" | ||||
, response_code, ec.message().c_str( ), str.c_str()); | , response_code, ec.message().c_str( ), str.c_str()); | |||
debug_log(msg); | ||||
} | } | |||
void debug_log(const std::string& line) | void debug_log(const char* fmt, ...) const | |||
{ | { | |||
(*m_ses.m_logger) << time_now_string() << " | if (!m_ses.m_logger) return; | |||
" << line << "\n"; | ||||
va_list v; | ||||
va_start(v, fmt); | ||||
char usr[1024]; | ||||
vsnprintf(usr, sizeof(usr), fmt, v); | ||||
va_end(v); | ||||
char buf[1280]; | ||||
snprintf(buf, sizeof(buf), "%s: %s\n", time_ | ||||
now_string(), usr); | ||||
(*m_ses.m_logger) << buf; | ||||
} | } | |||
session_impl& m_ses; | session_impl& m_ses; | |||
}; | }; | |||
#endif | #endif | |||
} | } | |||
} | } | |||
#endif | #endif | |||
End of changes. 6 change blocks. | ||||
9 lines changed or deleted | 16 lines changed or added | |||
torrent.hpp | torrent.hpp | |||
---|---|---|---|---|
skipping to change at line 715 | skipping to change at line 715 | |||
void write_resume_data(entry& rd) const; | void write_resume_data(entry& rd) const; | |||
void read_resume_data(lazy_entry const& rd); | void read_resume_data(lazy_entry const& rd); | |||
void seen_complete() { m_last_seen_complete = time(0); } | void seen_complete() { m_last_seen_complete = time(0); } | |||
int time_since_complete() const { return int(time(0) - m_las t_seen_complete); } | int time_since_complete() const { return int(time(0) - m_las t_seen_complete); } | |||
time_t last_seen_complete() const { return m_last_seen_compl ete; } | time_t last_seen_complete() const { return m_last_seen_compl ete; } | |||
// LOGGING | // LOGGING | |||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined T ORRENT_ERROR_LOGGING | #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined T ORRENT_ERROR_LOGGING | |||
virtual void debug_log(const std::string& line); | virtual void debug_log(const char* fmt, ...) const; | |||
#endif | #endif | |||
// DEBUG | // DEBUG | |||
#ifdef TORRENT_DEBUG | #ifdef TORRENT_DEBUG | |||
void check_invariant() const; | void check_invariant() const; | |||
#endif | #endif | |||
// -------------------------------------------- | // -------------------------------------------- | |||
// RESOURCE MANAGEMENT | // RESOURCE MANAGEMENT | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
torrent_handle.hpp | torrent_handle.hpp | |||
---|---|---|---|---|
skipping to change at line 73 | skipping to change at line 73 | |||
{ | { | |||
namespace aux | namespace aux | |||
{ | { | |||
struct session_impl; | struct session_impl; | |||
} | } | |||
struct torrent_plugin; | struct torrent_plugin; | |||
struct peer_info; | struct peer_info; | |||
struct peer_list_entry; | struct peer_list_entry; | |||
struct torrent_status; | struct torrent_status; | |||
class torrent; | ||||
TORRENT_EXPORT std::size_t hash_value(torrent_status const& ts); | TORRENT_EXPORT std::size_t hash_value(torrent_status const& ts); | |||
#ifndef BOOST_NO_EXCEPTIONS | #ifndef BOOST_NO_EXCEPTIONS | |||
// for compatibility with 0.14 | // for compatibility with 0.14 | |||
typedef libtorrent_exception duplicate_torrent; | typedef libtorrent_exception duplicate_torrent; | |||
typedef libtorrent_exception invalid_handle; | typedef libtorrent_exception invalid_handle; | |||
void throw_invalid_handle(); | void throw_invalid_handle(); | |||
#endif | #endif | |||
skipping to change at line 420 | skipping to change at line 421 | |||
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(); } | |||
boost::shared_ptr<torrent> native_handle() const; | ||||
private: | private: | |||
torrent_handle(boost::weak_ptr<torrent> const& t) | torrent_handle(boost::weak_ptr<torrent> const& t) | |||
: m_torrent(t) | : m_torrent(t) | |||
{} | {} | |||
#ifdef TORRENT_DEBUG | #ifdef TORRENT_DEBUG | |||
void check_invariant() const; | void check_invariant() const; | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added | |||
tracker_manager.hpp | tracker_manager.hpp | |||
---|---|---|---|---|
skipping to change at line 170 | skipping to change at line 170 | |||
virtual void tracker_request_error( | virtual void tracker_request_error( | |||
tracker_request const& req | tracker_request const& req | |||
, int response_code | , int response_code | |||
, error_code const& ec | , error_code const& ec | |||
, const std::string& msg | , const std::string& msg | |||
, int retry_interval) = 0; | , int retry_interval) = 0; | |||
union_endpoint m_tracker_address; | union_endpoint m_tracker_address; | |||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined T ORRENT_ERROR_LOGGING | #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined T ORRENT_ERROR_LOGGING | |||
virtual void debug_log(const std::string& line) = 0; | virtual void debug_log(const char* fmt, ...) const = 0; | |||
#else | #else | |||
private: | private: | |||
#endif | #endif | |||
tracker_manager* m_manager; | tracker_manager* m_manager; | |||
}; | }; | |||
struct TORRENT_EXTRA_EXPORT timeout_handler | struct TORRENT_EXTRA_EXPORT timeout_handler | |||
: intrusive_ptr_base<timeout_handler> | : intrusive_ptr_base<timeout_handler> | |||
, boost::noncopyable | , boost::noncopyable | |||
{ | { | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
version.hpp | version.hpp | |||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |||
POSSIBILITY OF SUCH DAMAGE. | POSSIBILITY OF SUCH DAMAGE. | |||
*/ | */ | |||
#ifndef TORRENT_VERSION_HPP_INCLUDED | #ifndef TORRENT_VERSION_HPP_INCLUDED | |||
#define TORRENT_VERSION_HPP_INCLUDED | #define TORRENT_VERSION_HPP_INCLUDED | |||
#define LIBTORRENT_VERSION_MAJOR 0 | #define LIBTORRENT_VERSION_MAJOR 0 | |||
#define LIBTORRENT_VERSION_MINOR 16 | #define LIBTORRENT_VERSION_MINOR 16 | |||
#define LIBTORRENT_VERSION_TINY 3 | #define LIBTORRENT_VERSION_TINY 4 | |||
// 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 "0.16.3.0" | #define LIBTORRENT_VERSION "0.16.4.0" | |||
#define LIBTORRENT_REVISION "$Rev: 7334 $" | #define LIBTORRENT_REVISION "$Rev: 7478 $" | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||