forked from premiere/premiere-libtorrent
remove debug logging to print field offsets and struct sizes
This commit is contained in:
parent
356332a93b
commit
a05103154b
|
@ -102,7 +102,6 @@ nobase_include_HEADERS = \
|
|||
storage.hpp \
|
||||
storage_defs.hpp \
|
||||
string_util.hpp \
|
||||
struct_debug.hpp \
|
||||
thread.hpp \
|
||||
time.hpp \
|
||||
timestamp_history.hpp \
|
||||
|
|
|
@ -228,6 +228,7 @@ namespace libtorrent
|
|||
entry* find_key(std::string const& key);
|
||||
entry const* find_key(std::string const& key) const;
|
||||
|
||||
// TODO: could this be removed?
|
||||
#if (defined TORRENT_VERBOSE_LOGGING || defined TORRENT_DEBUG) && TORRENT_USE_IOSTREAM
|
||||
void print(std::ostream& os, int indent = 0) const;
|
||||
#endif
|
||||
|
|
|
@ -188,11 +188,7 @@ namespace libtorrent
|
|||
boost::uint64_t symlink_attribute:1;
|
||||
|
||||
// make it available for logging
|
||||
#if !defined TORRENT_VERBOSE_LOGGING \
|
||||
&& !defined TORRENT_LOGGING \
|
||||
&& !defined TORRENT_ERROR_LOGGING
|
||||
private:
|
||||
#endif
|
||||
// This string is not necessarily null terminated!
|
||||
// that's why it's private, to keep people away from it
|
||||
char const* name;
|
||||
|
@ -516,11 +512,7 @@ namespace libtorrent
|
|||
size_type file_offset(internal_file_entry const& fe) const TORRENT_DEPRECATED;
|
||||
#endif
|
||||
|
||||
#if !defined TORRENT_VERBOSE_LOGGING \
|
||||
&& !defined TORRENT_LOGGING \
|
||||
&& !defined TORRENT_ERROR_LOGGING
|
||||
private:
|
||||
#endif
|
||||
|
||||
void update_path_index(internal_file_entry& e);
|
||||
void reorder_file(int index, int dst);
|
||||
|
|
|
@ -75,12 +75,8 @@ namespace libtorrent
|
|||
|
||||
intrusive_ptr_base(): m_refs(0) {}
|
||||
|
||||
// so that we can access this when logging
|
||||
#if !defined TORRENT_LOGGING \
|
||||
&& !defined TORRENT_VERBOSE_LOGGING \
|
||||
&& !defined TORRENT_ERROR_LOGGING
|
||||
private:
|
||||
#endif
|
||||
|
||||
// reference counter for intrusive_ptr
|
||||
mutable boost::detail::atomic_count m_refs;
|
||||
};
|
||||
|
|
|
@ -44,7 +44,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#if defined(TORRENT_LOGGING) || defined(TORRENT_VERBOSE_LOGGING)
|
||||
#include <fstream>
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
namespace libtorrent
|
||||
|
|
|
@ -43,10 +43,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "libtorrent/config.hpp"
|
||||
#include "libtorrent/assert.hpp"
|
||||
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
#include "libtorrent/debug.hpp" // for logger
|
||||
#endif
|
||||
|
||||
namespace libtorrent
|
||||
{
|
||||
class TORRENT_EXTRA_EXPORT stat_channel
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
/*
|
||||
|
||||
Copyright (c) 2011-2012, Arvid Norberg
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the author nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
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
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef TORRENT_STRUCT_DEBUG
|
||||
#define TORRENT_STRUCT_DEBUG
|
||||
|
||||
#define PRINT_SIZEOF(x) snprintf(tmp, sizeof(tmp), "\nsizeof(" #x ") = %d\n", int(sizeof(x))); \
|
||||
l << tmp; \
|
||||
temp = 0; \
|
||||
prev_size = 0;
|
||||
|
||||
#define PRINT_OFFSETOF(x, y) if (offsetof(x, y) > 0) { \
|
||||
snprintf(tmp, sizeof(tmp), "\tsize: %-3d\tpadding: %-3d\n" \
|
||||
, prev_size \
|
||||
, int((offsetof(x, y) - temp)) - prev_size); \
|
||||
l << tmp; \
|
||||
} \
|
||||
snprintf(tmp, sizeof(tmp), "%-50s: %-3d" \
|
||||
, #x "::" #y \
|
||||
, int(offsetof(x, y))); \
|
||||
temp = offsetof(x, y); \
|
||||
prev_size = sizeof(reinterpret_cast<x*>(0)->y); \
|
||||
l << tmp;
|
||||
|
||||
#define PRINT_OFFSETOF_END(x) snprintf(tmp, sizeof(tmp), "\tsize: %-3d\tpadding: %-3d\n" \
|
||||
, prev_size, int((sizeof(x) - temp) - prev_size)); \
|
||||
l << tmp;
|
||||
|
||||
#endif // TORRENT_STRUCT_DEBUG
|
||||
|
|
@ -851,10 +851,6 @@ namespace libtorrent
|
|||
// that are not private
|
||||
void lsd_announce();
|
||||
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
static void print_size(logger& l);
|
||||
#endif
|
||||
|
||||
void update_last_upload() { m_last_upload = 0; }
|
||||
|
||||
void set_apply_ip_filter(bool b);
|
||||
|
@ -976,13 +972,7 @@ namespace libtorrent
|
|||
void init_ssl(std::string const& cert);
|
||||
#endif
|
||||
|
||||
#ifdef TORRENT_DEBUG
|
||||
public:
|
||||
#endif
|
||||
std::set<peer_connection*> m_connections;
|
||||
#ifdef TORRENT_DEBUG
|
||||
private:
|
||||
#endif
|
||||
|
||||
// of all peers in m_connections, this is the number
|
||||
// of peers that are outgoing and still waiting to
|
||||
|
|
|
@ -660,11 +660,7 @@ namespace libtorrent
|
|||
bool is_merkle_torrent() const { return !m_merkle_tree.empty(); }
|
||||
|
||||
// if we're logging member offsets, we need access to them
|
||||
#if !defined TORRENT_LOGGING \
|
||||
&& !defined TORRENT_VERBOSE_LOGGING \
|
||||
&& !defined TORRENT_ERROR_LOGGING
|
||||
private:
|
||||
#endif
|
||||
|
||||
#ifdef TORRENT_DEBUG
|
||||
friend class invariant_access;
|
||||
|
|
|
@ -190,12 +190,7 @@ namespace libtorrent
|
|||
|
||||
io_service& get_io_service() { return m_timeout.get_io_service(); }
|
||||
|
||||
#if !defined TORRENT_VERBOSE_LOGGING \
|
||||
&& !defined TORRENT_LOGGING \
|
||||
&& !defined TORRENT_ERROR_LOGGING
|
||||
// necessary for logging member offsets
|
||||
private:
|
||||
#endif
|
||||
|
||||
void timeout_callback(error_code const&);
|
||||
|
||||
|
@ -246,12 +241,7 @@ namespace libtorrent
|
|||
boost::intrusive_ptr<tracker_connection> self()
|
||||
{ return boost::intrusive_ptr<tracker_connection>(this); }
|
||||
|
||||
#if !defined TORRENT_VERBOSE_LOGGING \
|
||||
&& !defined TORRENT_LOGGING \
|
||||
&& !defined TORRENT_ERROR_LOGGING
|
||||
// necessary for logging member offsets
|
||||
protected:
|
||||
#endif
|
||||
|
||||
void fail_impl(error_code const& ec, int code = -1, std::string msg = std::string()
|
||||
, int interval = 0, int min_interval = 0);
|
||||
|
@ -260,12 +250,7 @@ namespace libtorrent
|
|||
|
||||
tracker_manager& m_man;
|
||||
|
||||
#if !defined TORRENT_VERBOSE_LOGGING \
|
||||
&& !defined TORRENT_LOGGING \
|
||||
&& !defined TORRENT_ERROR_LOGGING
|
||||
// necessary for logging member offsets
|
||||
private:
|
||||
#endif
|
||||
|
||||
const tracker_request m_req;
|
||||
};
|
||||
|
|
|
@ -156,11 +156,6 @@ namespace libtorrent
|
|||
}
|
||||
|
||||
private:
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING \
|
||||
|| defined TORRENT_ERROR_LOGGING
|
||||
// necessary for logging member offsets
|
||||
public:
|
||||
#endif
|
||||
|
||||
// observers on this udp socket
|
||||
std::vector<udp_socket_observer*> m_observers;
|
||||
|
|
|
@ -78,12 +78,7 @@ namespace libtorrent
|
|||
void start();
|
||||
void close();
|
||||
|
||||
#if !defined TORRENT_VERBOSE_LOGGING \
|
||||
&& !defined TORRENT_LOGGING \
|
||||
&& !defined TORRENT_ERROR_LOGGING
|
||||
// necessary for logging member offsets
|
||||
private:
|
||||
#endif
|
||||
|
||||
enum action_t
|
||||
{
|
||||
|
|
|
@ -415,7 +415,8 @@ namespace libtorrent
|
|||
|
||||
void session::set_log_path(std::string const& p)
|
||||
{
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING \
|
||||
|| defined TORRENT_ERROR_LOGGING
|
||||
m_impl->set_log_path(p);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -99,7 +99,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
// for logging stat layout
|
||||
#include "libtorrent/stat.hpp"
|
||||
#include "libtorrent/struct_debug.hpp"
|
||||
|
||||
// for logging the size of DHT structures
|
||||
#ifndef TORRENT_DISABLE_DHT
|
||||
|
@ -871,184 +870,7 @@ namespace aux {
|
|||
, LIBTORRENT_REVISION);
|
||||
(*m_logger) << tmp;
|
||||
|
||||
logger& l = *m_logger;
|
||||
|
||||
int temp = 0;
|
||||
int prev_size = 0;
|
||||
|
||||
PRINT_SIZEOF(announce_entry)
|
||||
PRINT_OFFSETOF(announce_entry, url)
|
||||
PRINT_OFFSETOF(announce_entry, trackerid)
|
||||
PRINT_OFFSETOF(announce_entry, message)
|
||||
PRINT_OFFSETOF(announce_entry, last_error)
|
||||
PRINT_OFFSETOF(announce_entry, next_announce)
|
||||
PRINT_OFFSETOF(announce_entry, min_announce)
|
||||
PRINT_OFFSETOF(announce_entry, tier)
|
||||
PRINT_OFFSETOF(announce_entry, fail_limit)
|
||||
PRINT_OFFSETOF_END(announce_entry)
|
||||
|
||||
PRINT_SIZEOF(torrent_info)
|
||||
PRINT_OFFSETOF(torrent_info, m_refs)
|
||||
PRINT_OFFSETOF(torrent_info, m_merkle_first_leaf)
|
||||
PRINT_OFFSETOF(torrent_info, m_files)
|
||||
PRINT_OFFSETOF(torrent_info, m_orig_files)
|
||||
PRINT_OFFSETOF(torrent_info, m_urls)
|
||||
PRINT_OFFSETOF(torrent_info, m_web_seeds)
|
||||
PRINT_OFFSETOF(torrent_info, m_nodes)
|
||||
PRINT_OFFSETOF(torrent_info, m_merkle_tree)
|
||||
PRINT_OFFSETOF(torrent_info, m_info_section)
|
||||
PRINT_OFFSETOF(torrent_info, m_piece_hashes)
|
||||
PRINT_OFFSETOF(torrent_info, m_comment)
|
||||
PRINT_OFFSETOF(torrent_info, m_created_by)
|
||||
PRINT_OFFSETOF(torrent_info, m_info_dict)
|
||||
PRINT_OFFSETOF(torrent_info, m_creation_date)
|
||||
PRINT_OFFSETOF(torrent_info, m_info_hash)
|
||||
PRINT_OFFSETOF_END(torrent_info)
|
||||
|
||||
PRINT_SIZEOF(union_endpoint)
|
||||
PRINT_SIZEOF(request_callback)
|
||||
PRINT_SIZEOF(stat)
|
||||
PRINT_SIZEOF(bandwidth_channel)
|
||||
PRINT_SIZEOF(policy)
|
||||
(*m_logger) << "sizeof(utp_socket_impl): " << socket_impl_size() << "\n";
|
||||
|
||||
PRINT_SIZEOF(file_entry)
|
||||
PRINT_SIZEOF(internal_file_entry)
|
||||
PRINT_OFFSETOF(internal_file_entry, name)
|
||||
PRINT_OFFSETOF(internal_file_entry, path_index)
|
||||
PRINT_OFFSETOF_END(internal_file_entry)
|
||||
|
||||
PRINT_SIZEOF(file_storage)
|
||||
PRINT_OFFSETOF(file_storage, m_files)
|
||||
PRINT_OFFSETOF(file_storage, m_file_hashes)
|
||||
PRINT_OFFSETOF(file_storage, m_symlinks)
|
||||
PRINT_OFFSETOF(file_storage, m_mtime)
|
||||
PRINT_OFFSETOF(file_storage, m_file_base)
|
||||
PRINT_OFFSETOF(file_storage, m_paths)
|
||||
PRINT_OFFSETOF(file_storage, m_name)
|
||||
PRINT_OFFSETOF(file_storage, m_total_size)
|
||||
PRINT_OFFSETOF(file_storage, m_num_pieces)
|
||||
PRINT_OFFSETOF(file_storage, m_piece_length)
|
||||
PRINT_OFFSETOF_END(file_storage)
|
||||
|
||||
// PRINT_SIZEOF(stat_channel)
|
||||
// PRINT_OFFSETOF(stat_channel, m_counter)
|
||||
// PRINT_OFFSETOF(stat_channel, m_average)
|
||||
// PRINT_OFFSETOF(stat_channel, m_total_counter)
|
||||
|
||||
torrent::print_size(*m_logger);
|
||||
|
||||
PRINT_SIZEOF(peer_connection)
|
||||
PRINT_SIZEOF(bt_peer_connection)
|
||||
PRINT_SIZEOF(address)
|
||||
PRINT_SIZEOF(address_v4)
|
||||
PRINT_SIZEOF(address_v4::bytes_type)
|
||||
#if TORRENT_USE_IPV6
|
||||
PRINT_SIZEOF(address_v6)
|
||||
PRINT_SIZEOF(address_v6::bytes_type)
|
||||
#endif
|
||||
PRINT_SIZEOF(void*)
|
||||
#ifndef TORRENT_DISABLE_DHT
|
||||
PRINT_SIZEOF(dht::node_entry)
|
||||
#endif
|
||||
|
||||
PRINT_SIZEOF(policy::peer)
|
||||
PRINT_OFFSETOF(policy::peer, prev_amount_upload)
|
||||
PRINT_OFFSETOF(policy::peer, prev_amount_download)
|
||||
PRINT_OFFSETOF(policy::peer, connection)
|
||||
#ifndef TORRENT_DISABLE_GEO_IP
|
||||
#ifdef TORRENT_DEBUG
|
||||
PRINT_OFFSETOF(policy::peer, inet_as_num)
|
||||
#endif
|
||||
PRINT_OFFSETOF(policy::peer, inet_as)
|
||||
#endif
|
||||
PRINT_OFFSETOF(policy::peer, last_optimistically_unchoked)
|
||||
PRINT_OFFSETOF(policy::peer, last_connected)
|
||||
PRINT_OFFSETOF(policy::peer, port)
|
||||
PRINT_OFFSETOF(policy::peer, upload_rate_limit)
|
||||
PRINT_OFFSETOF(policy::peer, download_rate_limit)
|
||||
PRINT_OFFSETOF(policy::peer, hashfails)
|
||||
PRINT_OFFSETOF_END(policy::peer)
|
||||
|
||||
PRINT_SIZEOF(policy::ipv4_peer)
|
||||
#if TORRENT_USE_IPV6
|
||||
PRINT_SIZEOF(policy::ipv6_peer)
|
||||
#endif
|
||||
|
||||
PRINT_SIZEOF(udp_socket)
|
||||
PRINT_OFFSETOF(udp_socket, m_ipv4_sock)
|
||||
PRINT_OFFSETOF(udp_socket, m_buf)
|
||||
#if TORRENT_USE_IPV6
|
||||
PRINT_OFFSETOF(udp_socket, m_ipv6_sock)
|
||||
#endif
|
||||
PRINT_OFFSETOF(udp_socket, m_bind_port)
|
||||
PRINT_OFFSETOF(udp_socket, m_v4_outstanding)
|
||||
#if TORRENT_USE_IPV6
|
||||
PRINT_OFFSETOF(udp_socket, m_v6_outstanding)
|
||||
#endif
|
||||
PRINT_OFFSETOF(udp_socket, m_socks5_sock)
|
||||
PRINT_OFFSETOF(udp_socket, m_connection_ticket)
|
||||
PRINT_OFFSETOF(udp_socket, m_proxy_settings)
|
||||
#ifndef _MSC_VER
|
||||
PRINT_OFFSETOF(udp_socket, m_cc)
|
||||
#endif
|
||||
PRINT_OFFSETOF(udp_socket, m_resolver)
|
||||
PRINT_OFFSETOF(udp_socket, m_tmp_buf)
|
||||
PRINT_OFFSETOF(udp_socket, m_queue_packets)
|
||||
PRINT_OFFSETOF(udp_socket, m_tunnel_packets)
|
||||
PRINT_OFFSETOF(udp_socket, m_abort)
|
||||
PRINT_OFFSETOF(udp_socket, m_proxy_addr)
|
||||
PRINT_OFFSETOF(udp_socket, m_queue)
|
||||
PRINT_OFFSETOF(udp_socket, m_outstanding_ops)
|
||||
#ifdef TORRENT_DEBUG
|
||||
PRINT_OFFSETOF(udp_socket, m_started)
|
||||
PRINT_OFFSETOF(udp_socket, m_magic)
|
||||
PRINT_OFFSETOF(udp_socket, m_outstanding_when_aborted)
|
||||
#endif
|
||||
PRINT_OFFSETOF_END(udp_socket)
|
||||
|
||||
PRINT_SIZEOF(tracker_connection)
|
||||
PRINT_SIZEOF(http_tracker_connection)
|
||||
|
||||
PRINT_SIZEOF(udp_tracker_connection)
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_refs)
|
||||
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_start_time)
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_read_time)
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_timeout)
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_completion_timeout)
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_read_timeout)
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_mutex)
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_requester)
|
||||
#ifndef _MSC_VER
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_man)
|
||||
#endif
|
||||
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_req)
|
||||
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_abort)
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_hostname)
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_target)
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_endpoints)
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_transaction_id)
|
||||
#ifndef _MSC_VER
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_ses)
|
||||
#endif
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_attempts)
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_state)
|
||||
PRINT_OFFSETOF(udp_tracker_connection, m_proxy)
|
||||
PRINT_OFFSETOF_END(udp_tracker_connection)
|
||||
|
||||
#ifndef TORRENT_DISABLE_DHT
|
||||
PRINT_SIZEOF(dht::find_data_observer)
|
||||
PRINT_SIZEOF(dht::announce_observer)
|
||||
PRINT_SIZEOF(dht::null_observer)
|
||||
#endif
|
||||
#undef PRINT_OFFSETOF_END
|
||||
#undef PRINT_OFFSETOF
|
||||
#undef PRINT_SIZEOF
|
||||
|
||||
#endif
|
||||
#endif // TORRENT_VERBOSE_LOGGING
|
||||
|
||||
#ifdef TORRENT_STATS
|
||||
|
||||
|
|
115
src/torrent.cpp
115
src/torrent.cpp
|
@ -87,10 +87,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#endif // BOOST_VERSION
|
||||
#endif // TORRENT_USE_OPENSSL
|
||||
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
#include "libtorrent/struct_debug.hpp"
|
||||
#endif
|
||||
|
||||
using namespace libtorrent;
|
||||
using boost::tuples::tuple;
|
||||
using boost::tuples::get;
|
||||
|
@ -204,117 +200,6 @@ namespace
|
|||
|
||||
namespace libtorrent
|
||||
{
|
||||
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
|
||||
void torrent::print_size(logger& l)
|
||||
{
|
||||
char tmp[300];
|
||||
int temp = 0;
|
||||
int prev_size = 0;
|
||||
PRINT_SIZEOF(torrent)
|
||||
|
||||
PRINT_OFFSETOF(torrent, m_tracker_address)
|
||||
PRINT_OFFSETOF(torrent, m_manager)
|
||||
PRINT_OFFSETOF(torrent, m_policy)
|
||||
PRINT_OFFSETOF(torrent, m_total_uploaded)
|
||||
PRINT_OFFSETOF(torrent, m_total_downloaded)
|
||||
PRINT_OFFSETOF(torrent, m_started)
|
||||
PRINT_OFFSETOF(torrent, m_torrent_file)
|
||||
PRINT_OFFSETOF(torrent, m_owning_storage)
|
||||
PRINT_OFFSETOF(torrent, m_storage)
|
||||
PRINT_OFFSETOF(torrent, m_connections)
|
||||
PRINT_OFFSETOF(torrent, m_web_seeds)
|
||||
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||
PRINT_OFFSETOF(torrent, m_extensions)
|
||||
#endif
|
||||
PRINT_OFFSETOF(torrent, m_tracker_timer)
|
||||
PRINT_OFFSETOF(torrent, m_stat)
|
||||
// some compilers don't like using offsetof on references it seems
|
||||
#ifndef _MSC_VER
|
||||
PRINT_OFFSETOF(torrent, m_ses)
|
||||
#endif
|
||||
PRINT_OFFSETOF(torrent, m_file_priority)
|
||||
PRINT_OFFSETOF(torrent, m_file_progress)
|
||||
PRINT_OFFSETOF(torrent, m_picker)
|
||||
PRINT_OFFSETOF(torrent, m_trackers)
|
||||
PRINT_OFFSETOF(torrent, m_time_critical_pieces)
|
||||
PRINT_OFFSETOF(torrent, m_username)
|
||||
PRINT_OFFSETOF(torrent, m_password)
|
||||
PRINT_OFFSETOF(torrent, m_net_interfaces)
|
||||
PRINT_OFFSETOF(torrent, m_save_path)
|
||||
PRINT_OFFSETOF(torrent, m_url)
|
||||
PRINT_OFFSETOF(torrent, m_uuid)
|
||||
PRINT_OFFSETOF(torrent, m_source_feed_url)
|
||||
PRINT_OFFSETOF(torrent, m_torrent_file_buf)
|
||||
PRINT_OFFSETOF(torrent, m_verified)
|
||||
PRINT_OFFSETOF(torrent, m_error)
|
||||
PRINT_OFFSETOF(torrent, m_error_file)
|
||||
PRINT_OFFSETOF(torrent, m_resume_data)
|
||||
PRINT_OFFSETOF(torrent, m_resume_entry)
|
||||
PRINT_OFFSETOF(torrent, m_name)
|
||||
PRINT_OFFSETOF(torrent, m_storage_constructor)
|
||||
PRINT_OFFSETOF(torrent, m_added_time)
|
||||
PRINT_OFFSETOF(torrent, m_completed_time)
|
||||
PRINT_OFFSETOF(torrent, m_last_saved_resume)
|
||||
PRINT_OFFSETOF(torrent, m_last_seen_complete)
|
||||
PRINT_OFFSETOF(torrent, m_swarm_last_seen_complete)
|
||||
PRINT_OFFSETOF(torrent, m_num_verified)
|
||||
#ifndef TORRENT_DISABLE_ENCRYPTION
|
||||
PRINT_OFFSETOF(torrent, m_obfuscated_hash)
|
||||
#endif
|
||||
PRINT_OFFSETOF(torrent, m_ratio)
|
||||
PRINT_OFFSETOF(torrent, m_available_free_upload)
|
||||
PRINT_OFFSETOF(torrent, m_average_piece_time)
|
||||
PRINT_OFFSETOF(torrent, m_piece_time_deviation)
|
||||
PRINT_OFFSETOF(torrent, m_total_failed_bytes)
|
||||
PRINT_OFFSETOF(torrent, m_total_redundant_bytes)
|
||||
// PRINT_OFFSETOF(torrent, m_upload_mode_time:24)
|
||||
// PRINT_OFFSETOF(torrent, m_state:3)
|
||||
// PRINT_OFFSETOF(torrent, m_storage_mode:2)
|
||||
// PRINT_OFFSETOF(torrent, m_announcing:1)
|
||||
// PRINT_OFFSETOF(torrent, m_waiting_tracker:1)
|
||||
// PRINT_OFFSETOF(torrent, m_seed_mode:1)
|
||||
// PRINT_OFFSETOF(torrent, m_active_time:24)
|
||||
PRINT_OFFSETOF(torrent, m_last_working_tracker)
|
||||
// PRINT_OFFSETOF(torrent, m_finished_time:24)
|
||||
// PRINT_OFFSETOF(torrent, m_sequential_download:1)
|
||||
// PRINT_OFFSETOF(torrent, m_got_tracker_response:1)
|
||||
// PRINT_OFFSETOF(torrent, m_connections_initialized:1)
|
||||
// PRINT_OFFSETOF(torrent, m_super_seeding:1)
|
||||
// PRINT_OFFSETOF(torrent, m_override_resume_data:1)
|
||||
// PRINT_OFFSETOF(torrent, m_resolving_country:1)
|
||||
// PRINT_OFFSETOF(torrent, m_resolve_countries:1)
|
||||
// PRINT_OFFSETOF(torrent, m_need_save_resume_data:1)
|
||||
// PRINT_OFFSETOF(torrent, m_seeding_time:24)
|
||||
PRINT_OFFSETOF(torrent, m_time_scaler)
|
||||
// PRINT_OFFSETOF(torrent, m_max_uploads:24)
|
||||
// PRINT_OFFSETOF(torrent, m_num_uploads:24)
|
||||
// PRINT_OFFSETOF(torrent, m_block_size_shift:5)
|
||||
// PRINT_OFFSETOF(torrent, m_has_incoming:1)
|
||||
// PRINT_OFFSETOF(torrent, m_files_checked:1)
|
||||
// PRINT_OFFSETOF(torrent, m_queued_for_checking:1)
|
||||
// PRINT_OFFSETOF(torrent, m_max_connections:24)
|
||||
// PRINT_OFFSETOF(torrent, m_padding:24)
|
||||
PRINT_OFFSETOF(torrent, m_sequence_number)
|
||||
// PRINT_OFFSETOF(torrent, m_complete:24)
|
||||
// PRINT_OFFSETOF(torrent, m_priority)
|
||||
// PRINT_OFFSETOF(torrent, m_incomplete:24)
|
||||
// PRINT_OFFSETOF(torrent, m_progress_ppm:20)
|
||||
// PRINT_OFFSETOF(torrent, m_abort:1)
|
||||
// PRINT_OFFSETOF(torrent, m_announce_to_dht:1)
|
||||
// PRINT_OFFSETOF(torrent, m_announce_to_trackers:1)
|
||||
// PRINT_OFFSETOF(torrent, m_announce_to_lsd:1)
|
||||
// PRINT_OFFSETOF(torrent, m_allow_peers:1)
|
||||
// PRINT_OFFSETOF(torrent, m_upload_mode:1)
|
||||
// PRINT_OFFSETOF(torrent, m_auto_managed:1)
|
||||
// PRINT_OFFSETOF(torrent, m_last_scrape)
|
||||
}
|
||||
#undef PRINT_SIZEOF
|
||||
#undef PRINT_OFFSETOF
|
||||
|
||||
#endif
|
||||
|
||||
int root2(int x)
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
Loading…
Reference in New Issue