Ticket #392: deluge-0.9.03.diff

File deluge-0.9.03.diff, 7.9 KB (added by Filodej <philodej@…>, 16 years ago)
  • deluge-0.9.03/libtorrent/include/libtorrent/socket.hpp

    diff -r -u deluge-orig/deluge-0.9.03/libtorrent/include/libtorrent/socket.hpp deluge-0.9.03/libtorrent/include/libtorrent/socket.hpp
    old new  
    7575#include "libtorrent/time.hpp" 
    7676#include "libtorrent/error_code.hpp" 
    7777 
     78#define IPV6_V6ONLY             26 
     79 
    7880#ifdef _MSC_VER 
    7981#pragma warning(pop) 
    8082#endif 
  • deluge-0.9.03/libtorrent/include/libtorrent/torrent_info.hpp

    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  
    8585        class TORRENT_EXPORT torrent_info : public intrusive_ptr_base<torrent_info> 
    8686        { 
    8787        public: 
    88  
     88#ifdef BOOST_NO_EXCEPTIONS 
     89                torrent_info(); 
     90#endif 
     91     
    8992                torrent_info(sha1_hash const& info_hash); 
    9093                torrent_info(lazy_entry const& torrent_file); 
    9194                torrent_info(char const* buffer, int size); 
  • deluge-0.9.03/libtorrent/include/libtorrent/variant_stream.hpp

    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  
    218218      error_code& ec; 
    219219  }; 
    220220 
     221#ifndef BOOST_NO_EXCEPTIONS 
    221222  struct close_visitor 
    222223    : boost::static_visitor<> 
    223224  { 
     
    227228 
    228229      void operator()(boost::blank) const {} 
    229230  }; 
    230  
     231#endif 
    231232// -------------- remote_endpoint ----------- 
    232233 
    233234  template <class EndpointType> 
     
    658659        return boost::apply_visitor(aux::is_open_visitor(), m_variant); 
    659660    } 
    660661 
    661     void close() 
    662     { 
    663         if (!instantiated()) return; 
    664         boost::apply_visitor(aux::close_visitor(), m_variant); 
    665     } 
    666  
    667662    void close(error_code& ec) 
    668663    { 
    669664        if (!instantiated()) return; 
     
    672667        ); 
    673668    } 
    674669 
     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     
    675679    std::size_t in_avail() const 
    676680    { 
    677681        TORRENT_ASSERT(instantiated()); 
  • deluge-0.9.03/libtorrent/src/error_code.cpp

    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  
    5656 
    5757} 
    5858 
     59#ifdef BOOST_NO_EXCEPTIONS 
     60namespace boost 
     61{ 
     62// did not know anything better... 
     63void throw_exception(std::exception const & e) {} 
     64} 
     65#endif 
    5966#endif 
    6067 
  • deluge-0.9.03/libtorrent/src/kademlia/dht_tracker.cpp

    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  
    6969 
    7070namespace 
    7171{ 
     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 
    7284        const int tick_period = 1; // minutes 
    7385 
    7486        struct count_peers 
     
    519531 
    520532                                m.reply = true; 
    521533                                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(); 
    523536                                if (id.size() != 20) throw std::runtime_error("invalid size of id"); 
    524537                                std::copy(id.begin(), id.end(), m.id.begin()); 
    525538 
     
    598611                        { 
    599612                                m.reply = false; 
    600613                                entry const& a = e["a"]; 
    601                                 std::string const& id = a["id"].string(); 
     614                                std::string const& id = get_subentry_const( a, "id" ).string(); 
    602615                                if (id.size() != 20) throw std::runtime_error("invalid size of id"); 
    603616                                std::copy(id.begin(), id.end(), m.id.begin()); 
    604617 
     
    613626                                } 
    614627                                else if (request_kind == "find_node") 
    615628                                { 
    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(); 
    617631                                        if (target.size() != 20) throw std::runtime_error("invalid size of target id"); 
    618632                                        std::copy(target.begin(), target.end(), m.info_hash.begin()); 
    619633#ifdef TORRENT_DHT_VERBOSE_LOGGING 
     
    624638                                } 
    625639                                else if (request_kind == "get_peers") 
    626640                                { 
    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(); 
    628643                                        if (info_hash.size() != 20) throw std::runtime_error("invalid size of info-hash"); 
    629644                                        std::copy(info_hash.begin(), info_hash.end(), m.info_hash.begin()); 
    630645                                        m.message_id = libtorrent::dht::messages::get_peers; 
     
    637652#ifdef TORRENT_DHT_VERBOSE_LOGGING 
    638653                                        ++m_announces; 
    639654#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(); 
    641657                                        if (info_hash.size() != 20) 
    642658                                                throw std::runtime_error("invalid size of info-hash"); 
    643659                                        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" ); 
    646662                                        m.message_id = libtorrent::dht::messages::announce_peer; 
    647663#ifdef TORRENT_DHT_VERBOSE_LOGGING 
    648664                                        log_line << " ih: " << boost::lexical_cast<std::string>(m.info_hash); 
  • deluge-0.9.03/libtorrent/src/memdebug.cpp

    diff -r -u deluge-orig/deluge-0.9.03/libtorrent/src/memdebug.cpp deluge-0.9.03/libtorrent/src/memdebug.cpp
    old new  
    3030 
    3131*/ 
    3232 
     33#if 0 
    3334#if defined __linux__ && defined __GNUC__ 
    3435#include <execinfo.h> 
    3536 
     
    221222} 
    222223 
    223224#endif 
    224  
     225#endif 
  • deluge-0.9.03/libtorrent/src/torrent_handle.cpp

    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  
    530530                INVARIANT_CHECK; 
    531531 
    532532                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() ); 
    534535                t->filesystem().write_resume_data(ret); 
    535536 
    536537                return ret; 
  • deluge-0.9.03/libtorrent/src/torrent_info.cpp

    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  
    297297                , m_piece_hashes(0) 
    298298        {} 
    299299 
     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                                                                                                           
    300309        torrent_info::torrent_info(fs::path const& filename) 
    301310                : m_creation_date(pt::ptime(pt::not_a_date_time)) 
    302311                , m_multifile(false)