fix build issue, some warnings
This commit is contained in:
parent
b480f40a98
commit
71ee44ae5e
14
Jamfile
14
Jamfile
|
@ -717,7 +717,7 @@ ED25519_SOURCES =
|
||||||
verify
|
verify
|
||||||
;
|
;
|
||||||
|
|
||||||
local usage-requirements =
|
local usage-requirements =
|
||||||
<include>./include
|
<include>./include
|
||||||
<include>./include/libtorrent
|
<include>./include/libtorrent
|
||||||
<include>/usr/sfw/include
|
<include>/usr/sfw/include
|
||||||
|
@ -795,10 +795,10 @@ lib torrent
|
||||||
headers = [ path.glob-tree include/libtorrent : *.hpp ] ;
|
headers = [ path.glob-tree include/libtorrent : *.hpp ] ;
|
||||||
|
|
||||||
package.install install
|
package.install install
|
||||||
: <install-source-root>libtorrent
|
: <install-source-root>libtorrent
|
||||||
<install-no-version-symlinks>on
|
<install-no-version-symlinks>on
|
||||||
:
|
:
|
||||||
: torrent
|
: torrent
|
||||||
: $(headers)
|
: $(headers)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -418,11 +418,11 @@ namespace libtorrent
|
||||||
|
|
||||||
aux::session_settings const& settings() const;
|
aux::session_settings const& settings() const;
|
||||||
aux::session_interface& session() { return m_ses; }
|
aux::session_interface& session() { return m_ses; }
|
||||||
|
|
||||||
void set_sequential_download(bool sd);
|
void set_sequential_download(bool sd);
|
||||||
bool is_sequential_download() const
|
bool is_sequential_download() const
|
||||||
{ return m_sequential_download || m_auto_sequential; }
|
{ return m_sequential_download || m_auto_sequential; }
|
||||||
|
|
||||||
void queue_up();
|
void queue_up();
|
||||||
void queue_down();
|
void queue_down();
|
||||||
void set_queue_position(int p);
|
void set_queue_position(int p);
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace libtorrent
|
||||||
|
|
||||||
if (!m_alerts[m_generation].empty())
|
if (!m_alerts[m_generation].empty())
|
||||||
return m_alerts[m_generation].front();
|
return m_alerts[m_generation].front();
|
||||||
|
|
||||||
// this call can be interrupted prematurely by other signals
|
// this call can be interrupted prematurely by other signals
|
||||||
m_condition.wait_for(lock, max_wait);
|
m_condition.wait_for(lock, max_wait);
|
||||||
if (!m_alerts[m_generation].empty())
|
if (!m_alerts[m_generation].empty())
|
||||||
|
|
|
@ -531,7 +531,7 @@ void node::send_single_refresh(udp::endpoint const& ep, int bucket
|
||||||
node_id target = generate_secret_id() & ~mask;
|
node_id target = generate_secret_id() & ~mask;
|
||||||
target |= m_id & mask;
|
target |= m_id & mask;
|
||||||
|
|
||||||
// create a dummy traversal_algorithm
|
// create a dummy traversal_algorithm
|
||||||
// this is unfortunately necessary for the observer
|
// this is unfortunately necessary for the observer
|
||||||
// to free itself from the pool when it's being released
|
// to free itself from the pool when it's being released
|
||||||
boost::intrusive_ptr<traversal_algorithm> algo(
|
boost::intrusive_ptr<traversal_algorithm> algo(
|
||||||
|
|
|
@ -31,6 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h> // free and calloc
|
#include <stdlib.h> // free and calloc
|
||||||
|
#include <new> // for bad_alloc
|
||||||
#include "libtorrent/packet_buffer.hpp"
|
#include "libtorrent/packet_buffer.hpp"
|
||||||
#include "libtorrent/assert.hpp"
|
#include "libtorrent/assert.hpp"
|
||||||
#include "libtorrent/invariant_check.hpp"
|
#include "libtorrent/invariant_check.hpp"
|
||||||
|
|
|
@ -72,6 +72,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "libtorrent/natpmp.hpp"
|
#include "libtorrent/natpmp.hpp"
|
||||||
#include "libtorrent/upnp.hpp"
|
#include "libtorrent/upnp.hpp"
|
||||||
#include "libtorrent/magnet_uri.hpp"
|
#include "libtorrent/magnet_uri.hpp"
|
||||||
|
#include "libtorrent/lazy_entry.hpp"
|
||||||
|
|
||||||
#ifdef TORRENT_PROFILE_CALLS
|
#ifdef TORRENT_PROFILE_CALLS
|
||||||
#include <boost/unordered_map.hpp>
|
#include <boost/unordered_map.hpp>
|
||||||
|
@ -876,7 +877,7 @@ namespace libtorrent
|
||||||
std::vector<char> buf;
|
std::vector<char> buf;
|
||||||
bencode(std::back_inserter(buf), data);
|
bencode(std::back_inserter(buf), data);
|
||||||
sha1_hash ret = hasher(&buf[0], buf.size()).final();
|
sha1_hash ret = hasher(&buf[0], buf.size()).final();
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_DHT
|
#ifndef TORRENT_DISABLE_DHT
|
||||||
TORRENT_ASYNC_CALL2(dht_put_item, data, ret);
|
TORRENT_ASYNC_CALL2(dht_put_item, data, ret);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1046,7 +1047,7 @@ namespace libtorrent
|
||||||
|
|
||||||
apply_settings(pack);
|
apply_settings(pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy_settings session::i2p_proxy() const
|
proxy_settings session::i2p_proxy() const
|
||||||
{
|
{
|
||||||
proxy_settings ret;
|
proxy_settings ret;
|
||||||
|
|
|
@ -122,12 +122,12 @@ int print_failures()
|
||||||
return tests_failure;
|
return tests_failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<std::string, boost::uint64_t> get_counters(libtorrent::session& s)
|
std::map<std::string, boost::int64_t> get_counters(libtorrent::session& s)
|
||||||
{
|
{
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
s.post_session_stats();
|
s.post_session_stats();
|
||||||
|
|
||||||
std::map<std::string, boost::uint64_t> ret;
|
std::map<std::string, boost::int64_t> ret;
|
||||||
alert const* a = wait_for_alert(s, session_stats_alert::alert_type
|
alert const* a = wait_for_alert(s, session_stats_alert::alert_type
|
||||||
, "get_counters()");
|
, "get_counters()");
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ EXPORT libtorrent::address rand_v6();
|
||||||
EXPORT libtorrent::tcp::endpoint rand_tcp_ep();
|
EXPORT libtorrent::tcp::endpoint rand_tcp_ep();
|
||||||
EXPORT libtorrent::udp::endpoint rand_udp_ep();
|
EXPORT libtorrent::udp::endpoint rand_udp_ep();
|
||||||
|
|
||||||
EXPORT std::map<std::string, boost::uint64_t> get_counters(libtorrent::session& s);
|
EXPORT std::map<std::string, boost::int64_t> get_counters(libtorrent::session& s);
|
||||||
|
|
||||||
EXPORT libtorrent::alert const* wait_for_alert(
|
EXPORT libtorrent::alert const* wait_for_alert(
|
||||||
libtorrent::session& ses, int type, char const* name = "");
|
libtorrent::session& ses, int type, char const* name = "");
|
||||||
|
|
|
@ -94,7 +94,7 @@ void test_swarm()
|
||||||
|
|
||||||
boost::tie(tor1, tor2, tor3) = setup_transfer(&ses1, &ses2, &ses3, true, false, true, "_unchoke");
|
boost::tie(tor1, tor2, tor3) = setup_transfer(&ses1, &ses2, &ses3, true, false, true, "_unchoke");
|
||||||
|
|
||||||
std::map<std::string, boost::uint64_t> cnt = get_counters(ses1);
|
std::map<std::string, boost::int64_t> cnt = get_counters(ses1);
|
||||||
|
|
||||||
fprintf(stderr, "allowed_upload_slots: %d\n", int(cnt["ses.num_unchoke_slots"]));
|
fprintf(stderr, "allowed_upload_slots: %d\n", int(cnt["ses.num_unchoke_slots"]));
|
||||||
TEST_EQUAL(cnt["ses.num_unchoke_slots"], 1);
|
TEST_EQUAL(cnt["ses.num_unchoke_slots"], 1);
|
||||||
|
|
|
@ -46,7 +46,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
char const* pe_policy(boost::uint8_t policy)
|
char const* pe_policy(boost::uint8_t policy)
|
||||||
{
|
{
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
if (policy == settings_pack::pe_disabled) return "disabled";
|
if (policy == settings_pack::pe_disabled) return "disabled";
|
||||||
else if (policy == settings_pack::pe_enabled) return "enabled";
|
else if (policy == settings_pack::pe_enabled) return "enabled";
|
||||||
else if (policy == settings_pack::pe_forced) return "forced";
|
else if (policy == settings_pack::pe_forced) return "forced";
|
||||||
|
@ -56,11 +56,11 @@ char const* pe_policy(boost::uint8_t policy)
|
||||||
void display_settings(libtorrent::settings_pack const& s)
|
void display_settings(libtorrent::settings_pack const& s)
|
||||||
{
|
{
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
fprintf(stderr, "out_enc_policy - %s\tin_enc_policy - %s\n"
|
fprintf(stderr, "out_enc_policy - %s\tin_enc_policy - %s\n"
|
||||||
, pe_policy(s.get_int(settings_pack::out_enc_policy))
|
, pe_policy(s.get_int(settings_pack::out_enc_policy))
|
||||||
, pe_policy(s.get_int(settings_pack::in_enc_policy)));
|
, pe_policy(s.get_int(settings_pack::in_enc_policy)));
|
||||||
|
|
||||||
fprintf(stderr, "enc_level - %s\t\tprefer_rc4 - %s\n"
|
fprintf(stderr, "enc_level - %s\t\tprefer_rc4 - %s\n"
|
||||||
, s.get_int(settings_pack::allowed_enc_level) == settings_pack::pe_plaintext ? "plaintext"
|
, s.get_int(settings_pack::allowed_enc_level) == settings_pack::pe_plaintext ? "plaintext"
|
||||||
: s.get_int(settings_pack::allowed_enc_level) == settings_pack::pe_rc4 ? "rc4"
|
: s.get_int(settings_pack::allowed_enc_level) == settings_pack::pe_rc4 ? "rc4"
|
||||||
|
@ -85,7 +85,7 @@ void test_transfer(libtorrent::settings_pack::enc_policy policy
|
||||||
lt::session ses1(fingerprint("LT", 0, 1, 0, 0), std::make_pair(48800, 49000), "0.0.0.0", 0);
|
lt::session ses1(fingerprint("LT", 0, 1, 0, 0), std::make_pair(48800, 49000), "0.0.0.0", 0);
|
||||||
lt::session ses2(fingerprint("LT", 0, 1, 0, 0), std::make_pair(49800, 50000), "0.0.0.0", 0);
|
lt::session ses2(fingerprint("LT", 0, 1, 0, 0), std::make_pair(49800, 50000), "0.0.0.0", 0);
|
||||||
settings_pack s;
|
settings_pack s;
|
||||||
|
|
||||||
s.set_int(settings_pack::out_enc_policy, settings_pack::pe_enabled);
|
s.set_int(settings_pack::out_enc_policy, settings_pack::pe_enabled);
|
||||||
s.set_int(settings_pack::in_enc_policy, settings_pack::pe_enabled);
|
s.set_int(settings_pack::in_enc_policy, settings_pack::pe_enabled);
|
||||||
s.set_int(settings_pack::allowed_enc_level, settings_pack::pe_both);
|
s.set_int(settings_pack::allowed_enc_level, settings_pack::pe_both);
|
||||||
|
@ -108,7 +108,7 @@ void test_transfer(libtorrent::settings_pack::enc_policy policy
|
||||||
|
|
||||||
using boost::tuples::ignore;
|
using boost::tuples::ignore;
|
||||||
boost::tie(tor1, tor2, ignore) = setup_transfer(&ses1, &ses2, 0, true, false, true
|
boost::tie(tor1, tor2, ignore) = setup_transfer(&ses1, &ses2, 0, true, false, true
|
||||||
, "_pe", 16 * 1024, 0, false, 0, true);
|
, "_pe", 16 * 1024, 0, false, 0, true);
|
||||||
|
|
||||||
fprintf(stderr, "waiting for transfer to complete\n");
|
fprintf(stderr, "waiting for transfer to complete\n");
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ void test_transfer(libtorrent::settings_pack::enc_policy policy
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CHECK(tor2.status().is_seeding);
|
TEST_CHECK(tor2.status().is_seeding);
|
||||||
if (tor2.status().is_seeding) fprintf(stderr, "done\n");
|
if (tor2.status().is_seeding) fprintf(stderr, "done\n");
|
||||||
ses1.remove_torrent(tor1);
|
ses1.remove_torrent(tor1);
|
||||||
ses2.remove_torrent(tor2);
|
ses2.remove_torrent(tor2);
|
||||||
|
|
||||||
|
@ -146,13 +146,13 @@ void test_enc_handler(libtorrent::crypto_plugin* a, libtorrent::crypto_plugin* b
|
||||||
#endif
|
#endif
|
||||||
for (int rep = 0; rep < repcount; ++rep)
|
for (int rep = 0; rep < repcount; ++rep)
|
||||||
{
|
{
|
||||||
std::size_t buf_len = rand() % (512 * 1024);
|
int buf_len = rand() % (512 * 1024);
|
||||||
char* buf = new char[buf_len];
|
char* buf = new char[buf_len];
|
||||||
char* cmp_buf = new char[buf_len];
|
char* cmp_buf = new char[buf_len];
|
||||||
|
|
||||||
std::generate(buf, buf + buf_len, &std::rand);
|
std::generate(buf, buf + buf_len, &std::rand);
|
||||||
std::memcpy(cmp_buf, buf, buf_len);
|
std::memcpy(cmp_buf, buf, buf_len);
|
||||||
|
|
||||||
using namespace boost::asio;
|
using namespace boost::asio;
|
||||||
std::vector<mutable_buffer> iovec;
|
std::vector<mutable_buffer> iovec;
|
||||||
iovec.push_back(mutable_buffer(buf, buf_len));
|
iovec.push_back(mutable_buffer(buf, buf_len));
|
||||||
|
@ -169,7 +169,7 @@ void test_enc_handler(libtorrent::crypto_plugin* a, libtorrent::crypto_plugin* b
|
||||||
TEST_EQUAL(consume, 0);
|
TEST_EQUAL(consume, 0);
|
||||||
TEST_EQUAL(produce, buf_len);
|
TEST_EQUAL(produce, buf_len);
|
||||||
TEST_EQUAL(packet_size, 0);
|
TEST_EQUAL(packet_size, 0);
|
||||||
|
|
||||||
iovec.push_back(mutable_buffer(buf, buf_len));
|
iovec.push_back(mutable_buffer(buf, buf_len));
|
||||||
b->encrypt(iovec);
|
b->encrypt(iovec);
|
||||||
TEST_CHECK(!std::equal(buf, buf + buf_len, cmp_buf));
|
TEST_CHECK(!std::equal(buf, buf + buf_len, cmp_buf));
|
||||||
|
@ -184,7 +184,7 @@ void test_enc_handler(libtorrent::crypto_plugin* a, libtorrent::crypto_plugin* b
|
||||||
TEST_EQUAL(consume, 0);
|
TEST_EQUAL(consume, 0);
|
||||||
TEST_EQUAL(produce, buf_len);
|
TEST_EQUAL(produce, buf_len);
|
||||||
TEST_EQUAL(packet_size, 0);
|
TEST_EQUAL(packet_size, 0);
|
||||||
|
|
||||||
delete[] buf;
|
delete[] buf;
|
||||||
delete[] cmp_buf;
|
delete[] cmp_buf;
|
||||||
}
|
}
|
||||||
|
@ -207,10 +207,10 @@ int test_main()
|
||||||
for (int rep = 0; rep < repcount; ++rep)
|
for (int rep = 0; rep < repcount; ++rep)
|
||||||
{
|
{
|
||||||
dh_key_exchange DH1, DH2;
|
dh_key_exchange DH1, DH2;
|
||||||
|
|
||||||
DH1.compute_secret(DH2.get_local_key());
|
DH1.compute_secret(DH2.get_local_key());
|
||||||
DH2.compute_secret(DH1.get_local_key());
|
DH2.compute_secret(DH1.get_local_key());
|
||||||
|
|
||||||
TEST_CHECK(std::equal(DH1.get_secret(), DH1.get_secret() + 96, DH2.get_secret()));
|
TEST_CHECK(std::equal(DH1.get_secret(), DH1.get_secret() + 96, DH2.get_secret()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ int test_main()
|
||||||
rc42.set_incoming_key(&test1_key[0], 20);
|
rc42.set_incoming_key(&test1_key[0], 20);
|
||||||
rc42.set_outgoing_key(&test2_key[0], 20);
|
rc42.set_outgoing_key(&test2_key[0], 20);
|
||||||
test_enc_handler(&rc41, &rc42);
|
test_enc_handler(&rc41, &rc42);
|
||||||
|
|
||||||
#ifdef TORRENT_USE_VALGRIND
|
#ifdef TORRENT_USE_VALGRIND
|
||||||
const int timeout = 10;
|
const int timeout = 10;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -90,7 +90,7 @@ void test_running_torrent(boost::shared_ptr<torrent_info> info, boost::int64_t f
|
||||||
|
|
||||||
TEST_EQUAL(st.total_wanted, file_size * 2);
|
TEST_EQUAL(st.total_wanted, file_size * 2);
|
||||||
TEST_EQUAL(st.total_wanted_done, 0);
|
TEST_EQUAL(st.total_wanted_done, 0);
|
||||||
TEST_EQUAL(h.file_priorities().size(), info->num_files());
|
TEST_EQUAL(int(h.file_priorities().size()), info->num_files());
|
||||||
if (!st.is_seeding)
|
if (!st.is_seeding)
|
||||||
{
|
{
|
||||||
TEST_EQUAL(h.file_priorities()[0], 0);
|
TEST_EQUAL(h.file_priorities()[0], 0);
|
||||||
|
@ -261,7 +261,7 @@ int test_main()
|
||||||
for (int i = 0; i < fp.size(); ++i)
|
for (int i = 0; i < fp.size(); ++i)
|
||||||
sum += fp[i];
|
sum += fp[i];
|
||||||
|
|
||||||
TEST_EQUAL(sum, fs.piece_size(idx));
|
TEST_EQUAL(int(sum), fs.piece_size(idx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ int test_main()
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
test_transfer();
|
test_transfer();
|
||||||
|
|
||||||
error_code ec;
|
error_code ec;
|
||||||
remove_all("./tmp1_utp", ec);
|
remove_all("./tmp1_utp", ec);
|
||||||
remove_all("./tmp2_utp", ec);
|
remove_all("./tmp2_utp", ec);
|
||||||
|
|
|
@ -105,7 +105,7 @@ void test_transfer(lt::session& ses, boost::shared_ptr<torrent_info> torrent_fil
|
||||||
, keepalive ? "yes" : "no");
|
, keepalive ? "yes" : "no");
|
||||||
|
|
||||||
int proxy_port = 0;
|
int proxy_port = 0;
|
||||||
|
|
||||||
if (proxy)
|
if (proxy)
|
||||||
{
|
{
|
||||||
proxy_port = start_proxy(proxy);
|
proxy_port = start_proxy(proxy);
|
||||||
|
@ -160,7 +160,7 @@ void test_transfer(lt::session& ses, boost::shared_ptr<torrent_info> torrent_fil
|
||||||
}
|
}
|
||||||
|
|
||||||
peer_disconnects = 0;
|
peer_disconnects = 0;
|
||||||
std::map<std::string, boost::uint64_t> cnt = get_counters(ses);
|
std::map<std::string, boost::int64_t> cnt = get_counters(ses);
|
||||||
|
|
||||||
for (int i = 0; i < 40; ++i)
|
for (int i = 0; i < 40; ++i)
|
||||||
{
|
{
|
||||||
|
@ -395,7 +395,7 @@ int EXPORT run_http_suite(int proxy, char const* protocol, bool test_url_seed
|
||||||
|
|
||||||
test_transfer(ses, torrent_file, proxy, port, protocol, test_url_seed
|
test_transfer(ses, torrent_file, proxy, port, protocol, test_url_seed
|
||||||
, chunked_encoding, test_ban, keepalive);
|
, chunked_encoding, test_ban, keepalive);
|
||||||
|
|
||||||
if (test_url_seed && test_rename)
|
if (test_url_seed && test_rename)
|
||||||
{
|
{
|
||||||
torrent_file->rename_file(0, combine_path(save_path, combine_path("torrent_dir", "renamed_test1")));
|
torrent_file->rename_file(0, combine_path(save_path, combine_path("torrent_dir", "renamed_test1")));
|
||||||
|
|
|
@ -24,8 +24,11 @@ def update_file(name):
|
||||||
f.close()
|
f.close()
|
||||||
open(name, 'w+').write(subst)
|
open(name, 'w+').write(subst)
|
||||||
|
|
||||||
for i in glob.glob('src/*.cpp') + glob.glob('include/libtorrent/*.hpp') + \
|
for i in glob.glob('src/*.cpp') + \
|
||||||
glob.glob('include/libtorrent/kademlia/*.hpp') + glob.glob('src/kademlia/*.cpp') + \
|
glob.glob('include/libtorrent/*.hpp') + \
|
||||||
|
glob.glob('include/libtorrent/extensions/*.hpp') + \
|
||||||
|
glob.glob('include/libtorrent/kademlia/*.hpp') + \
|
||||||
|
glob.glob('src/kademlia/*.cpp') + \
|
||||||
['COPYING', 'LICENSE']:
|
['COPYING', 'LICENSE']:
|
||||||
update_file(i)
|
update_file(i)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue