diff -r -u deluge-orig/deluge-0.9.03/libtorrent/include/libtorrent/torrent_info.hpp deluge-0.9.03/libtorrent/include/libtorrent/torrent_info.hpp
old
|
new
|
|
85 | 85 | class TORRENT_EXPORT torrent_info : public intrusive_ptr_base<torrent_info> |
86 | 86 | { |
87 | 87 | public: |
88 | | |
| 88 | #ifdef BOOST_NO_EXCEPTIONS |
| 89 | torrent_info(); |
| 90 | #endif |
| 91 | |
89 | 92 | torrent_info(sha1_hash const& info_hash); |
90 | 93 | torrent_info(lazy_entry const& torrent_file); |
91 | 94 | torrent_info(char const* buffer, int size); |
diff -r -u deluge-orig/deluge-0.9.03/libtorrent/include/libtorrent/variant_stream.hpp deluge-0.9.03/libtorrent/include/libtorrent/variant_stream.hpp
old
|
new
|
|
218 | 218 | error_code& ec; |
219 | 219 | }; |
220 | 220 | |
| 221 | #ifndef BOOST_NO_EXCEPTIONS |
221 | 222 | struct close_visitor |
222 | 223 | : boost::static_visitor<> |
223 | 224 | { |
… |
… |
|
227 | 228 | |
228 | 229 | void operator()(boost::blank) const {} |
229 | 230 | }; |
230 | | |
| 231 | #endif |
231 | 232 | // -------------- remote_endpoint ----------- |
232 | 233 | |
233 | 234 | template <class EndpointType> |
… |
… |
|
658 | 659 | return boost::apply_visitor(aux::is_open_visitor(), m_variant); |
659 | 660 | } |
660 | 661 | |
661 | | void close() |
662 | | { |
663 | | if (!instantiated()) return; |
664 | | boost::apply_visitor(aux::close_visitor(), m_variant); |
665 | | } |
666 | | |
667 | 662 | void close(error_code& ec) |
668 | 663 | { |
669 | 664 | if (!instantiated()) return; |
… |
… |
|
672 | 667 | ); |
673 | 668 | } |
674 | 669 | |
| 670 | void close() |
| 671 | { |
| 672 | // if (!instantiated()) return; |
| 673 | // boost::apply_visitor(aux::close_visitor(), m_variant); |
| 674 | error_code ec; |
| 675 | close( ec ); |
| 676 | |
| 677 | } |
| 678 | |
675 | 679 | std::size_t in_avail() const |
676 | 680 | { |
677 | 681 | TORRENT_ASSERT(instantiated()); |
diff -r -u deluge-orig/deluge-0.9.03/libtorrent/src/error_code.cpp deluge-0.9.03/libtorrent/src/error_code.cpp
old
|
new
|
|
56 | 56 | |
57 | 57 | } |
58 | 58 | |
| 59 | #ifdef BOOST_NO_EXCEPTIONS |
| 60 | namespace boost |
| 61 | { |
| 62 | // did not know anything better... |
| 63 | void throw_exception(std::exception const & e) {} |
| 64 | } |
| 65 | #endif |
59 | 66 | #endif |
60 | 67 | |
diff -r -u deluge-orig/deluge-0.9.03/libtorrent/src/kademlia/dht_tracker.cpp deluge-0.9.03/libtorrent/src/kademlia/dht_tracker.cpp
old
|
new
|
|
69 | 69 | |
70 | 70 | namespace |
71 | 71 | { |
| 72 | |
| 73 | libtorrent::entry const& get_subentry_const( libtorrent::entry const& e, char const* key ) |
| 74 | { |
| 75 | #ifndef BOOST_NO_EXCEPTIONS |
| 76 | return e[key]; |
| 77 | #else |
| 78 | libtorrent::entry const* const s( e.find_key( key ) ); |
| 79 | if (!s) throw std::runtime_error("subentry not found"); |
| 80 | return *s; |
| 81 | #endif |
| 82 | } |
| 83 | |
72 | 84 | const int tick_period = 1; // minutes |
73 | 85 | |
74 | 86 | struct count_peers |
… |
… |
|
519 | 531 | |
520 | 532 | m.reply = true; |
521 | 533 | entry const& r = e["r"]; |
522 | | std::string const& id = r["id"].string(); |
| 534 | // std::string const& id = r["id"].string(); |
| 535 | std::string const& id = get_subentry_const( r, "id" ).string(); |
523 | 536 | if (id.size() != 20) throw std::runtime_error("invalid size of id"); |
524 | 537 | std::copy(id.begin(), id.end(), m.id.begin()); |
525 | 538 | |
… |
… |
|
598 | 611 | { |
599 | 612 | m.reply = false; |
600 | 613 | entry const& a = e["a"]; |
601 | | std::string const& id = a["id"].string(); |
| 614 | std::string const& id = get_subentry_const( a, "id" ).string(); |
602 | 615 | if (id.size() != 20) throw std::runtime_error("invalid size of id"); |
603 | 616 | std::copy(id.begin(), id.end(), m.id.begin()); |
604 | 617 | |
… |
… |
|
613 | 626 | } |
614 | 627 | else if (request_kind == "find_node") |
615 | 628 | { |
616 | | std::string const& target = a["target"].string(); |
| 629 | // std::string const& target = a["target"].string(); |
| 630 | std::string const& target = get_subentry_const( a, "target" ).string(); |
617 | 631 | if (target.size() != 20) throw std::runtime_error("invalid size of target id"); |
618 | 632 | std::copy(target.begin(), target.end(), m.info_hash.begin()); |
619 | 633 | #ifdef TORRENT_DHT_VERBOSE_LOGGING |
… |
… |
|
624 | 638 | } |
625 | 639 | else if (request_kind == "get_peers") |
626 | 640 | { |
627 | | std::string const& info_hash = a["info_hash"].string(); |
| 641 | // std::string const& info_hash = a["info_hash"].string(); |
| 642 | std::string const& info_hash = get_subentry_const( a, "info_hash" ).string(); |
628 | 643 | if (info_hash.size() != 20) throw std::runtime_error("invalid size of info-hash"); |
629 | 644 | std::copy(info_hash.begin(), info_hash.end(), m.info_hash.begin()); |
630 | 645 | m.message_id = libtorrent::dht::messages::get_peers; |
… |
… |
|
637 | 652 | #ifdef TORRENT_DHT_VERBOSE_LOGGING |
638 | 653 | ++m_announces; |
639 | 654 | #endif |
640 | | std::string const& info_hash = a["info_hash"].string(); |
| 655 | // std::string const& info_hash = a["info_hash"].string(); |
| 656 | std::string const& info_hash = get_subentry_const( a, "info_hash" ).string(); |
641 | 657 | if (info_hash.size() != 20) |
642 | 658 | throw std::runtime_error("invalid size of info-hash"); |
643 | 659 | std::copy(info_hash.begin(), info_hash.end(), m.info_hash.begin()); |
644 | | m.port = a["port"].integer(); |
645 | | m.write_token = a["token"]; |
| 660 | m.port = get_subentry_const( a, "port" ).integer(); |
| 661 | m.write_token = get_subentry_const( a, "token" ); |
646 | 662 | m.message_id = libtorrent::dht::messages::announce_peer; |
647 | 663 | #ifdef TORRENT_DHT_VERBOSE_LOGGING |
648 | 664 | log_line << " ih: " << boost::lexical_cast<std::string>(m.info_hash); |
diff -r -u deluge-orig/deluge-0.9.03/libtorrent/src/memdebug.cpp deluge-0.9.03/libtorrent/src/memdebug.cpp
old
|
new
|
|
30 | 30 | |
31 | 31 | */ |
32 | 32 | |
| 33 | #if 0 |
33 | 34 | #if defined __linux__ && defined __GNUC__ |
34 | 35 | #include <execinfo.h> |
35 | 36 | |
… |
… |
|
221 | 222 | } |
222 | 223 | |
223 | 224 | #endif |
224 | | |
| 225 | #endif |
diff -r -u deluge-orig/deluge-0.9.03/libtorrent/src/torrent_handle.cpp deluge-0.9.03/libtorrent/src/torrent_handle.cpp
old
|
new
|
|
530 | 530 | INVARIANT_CHECK; |
531 | 531 | |
532 | 532 | entry ret(entry::dictionary_t); |
533 | | TORRENT_FORWARD(write_resume_data(ret)); |
| 533 | // TORRENT_FORWARD(write_resume_data(ret)); |
| 534 | TORRENT_FORWARD_RETURN2(write_resume_data(ret), entry() ); |
534 | 535 | t->filesystem().write_resume_data(ret); |
535 | 536 | |
536 | 537 | return ret; |
diff -r -u deluge-orig/deluge-0.9.03/libtorrent/src/torrent_info.cpp deluge-0.9.03/libtorrent/src/torrent_info.cpp
old
|
new
|
|
297 | 297 | , m_piece_hashes(0) |
298 | 298 | {} |
299 | 299 | |
| 300 | #ifdef BOOST_NO_EXCEPTIONS |
| 301 | torrent_info::torrent_info() |
| 302 | : m_creation_date(pt::second_clock::universal_time()) |
| 303 | , m_multifile(false) |
| 304 | , m_private(false) |
| 305 | , m_info_section_size(0) |
| 306 | , m_piece_hashes(0) |
| 307 | {} |
| 308 | #endif |
300 | 309 | torrent_info::torrent_info(fs::path const& filename) |
301 | 310 | : m_creation_date(pt::ptime(pt::not_a_date_time)) |
302 | 311 | , m_multifile(false) |