Changeset 2095

Show
Ignore:
Timestamp:
10/31/07 07:49:48 (14 months ago)
Author:
markybob
Message:

fixing up libtorrent and tagging 0.5.6.2

Files:
26 modified
14 copied

Legend:

Unmodified
Added
Removed
  • tags/deluge-0.5.6.2/ChangeLog

    r2092 r2095  
    22  * Set default piece size to 256-KiB in TorrentCreator plugin and add 2048KiB 
    33  as a size option. 
     4  * Fix a bug in Debian package that caused the UI to completely freeze when a  
     5  torrent finished 
    46  * Find and fix another shutdown bug that mostly Gutsy users were incountering 
    57  * Fix a couple of WebUI bugs, including the "index" page erroring out 
  • tags/deluge-0.5.6.2/libtorrent/include/libtorrent/aux_/session_impl.hpp

    r2069 r2095  
    376376                        boost::pool<> m_send_buffers; 
    377377 
     378                        // this is where all active sockets are stored. 
     379                        // the selector can sleep while there's no activity on 
     380                        // them 
     381                        io_service m_io_service; 
     382                        asio::strand m_strand; 
     383 
    378384                        // the file pool that all storages in this session's 
    379385                        // torrents uses. It sets a limit on the number of 
     
    389395                        // object. 
    390396                        disk_io_thread m_disk_thread; 
    391  
    392                         // this is where all active sockets are stored. 
    393                         // the selector can sleep while there's no activity on 
    394                         // them 
    395                         io_service m_io_service; 
    396                         asio::strand m_strand; 
    397397 
    398398                        // this is a list of half-open tcp connections 
     
    647647                        void debug_log(const std::string& line) 
    648648                        { 
    649                                 (*m_ses.m_logger) << time_now_string() << " " << line << "\n"; 
     649                                (*m_ses.m_logger) << line << "\n"; 
    650650                        } 
    651651                        session_impl& m_ses; 
  • tags/deluge-0.5.6.2/libtorrent/include/libtorrent/connection_queue.hpp

    r2069 r2095  
    5757        void limit(int limit); 
    5858        int limit() const; 
    59         void close(); 
    6059 
    6160#ifndef NDEBUG 
  • tags/deluge-0.5.6.2/libtorrent/include/libtorrent/http_tracker_connection.hpp

    r2069 r2095  
    131131                        , std::string const& password = ""); 
    132132 
    133                 void close(); 
    134  
    135133        private: 
    136134 
  • tags/deluge-0.5.6.2/libtorrent/include/libtorrent/tracker_manager.hpp

    r2069 r2095  
    203203                void fail(int code, char const* msg); 
    204204                void fail_timeout(); 
    205                 virtual void close(); 
     205                void close(); 
    206206                address const& bind_interface() const { return m_bind_interface; } 
    207207 
  • tags/deluge-0.5.6.2/libtorrent/include/libtorrent/udp_tracker_connection.hpp

    r2069 r2095  
    7575                        , session_settings const& stn); 
    7676 
    77                 void close(); 
    78  
    7977        private: 
    8078 
  • tags/deluge-0.5.6.2/libtorrent/src/connection_queue.cpp

    r2069 r2095  
    8787        } 
    8888 
    89         void connection_queue::close() 
    90         { 
    91                 m_timer.cancel(); 
    92         } 
    93  
    9489        void connection_queue::limit(int limit) 
    9590        { m_half_open_limit = limit; } 
  • tags/deluge-0.5.6.2/libtorrent/src/http_tracker_connection.cpp

    r2069 r2095  
    490490                m_name_lookup.async_resolve(q, m_strand.wrap( 
    491491                        boost::bind(&http_tracker_connection::name_lookup, self(), _1, _2))); 
    492                 set_timeout(req.event == tracker_request::stopped 
    493                         ? m_settings.stop_tracker_timeout 
    494                         : m_settings.tracker_completion_timeout 
     492                set_timeout(m_settings.tracker_completion_timeout 
    495493                        , m_settings.tracker_receive_timeout); 
    496494        } 
     
    504502                m_connection_ticket = -1; 
    505503                fail_timeout(); 
    506         } 
    507  
    508         void http_tracker_connection::close() 
    509         { 
    510                 asio::error_code ec; 
    511                 m_socket.close(ec); 
    512                 m_name_lookup.cancel(); 
    513                 if (m_connection_ticket > -1) m_cc.done(m_connection_ticket); 
    514                 m_connection_ticket = -1; 
    515                 m_timed_out = true; 
    516                 tracker_connection::close(); 
    517504        } 
    518505 
     
    773760                { 
    774761                        fail(m_parser.status_code(), m_parser.message().c_str()); 
     762                        close(); 
    775763                        return; 
    776764                } 
     
    834822                } 
    835823                #endif 
    836                 close(); 
    837824        } 
    838825 
  • tags/deluge-0.5.6.2/libtorrent/src/session_impl.cpp

    r2089 r2095  
    548548                , char const* listen_interface) 
    549549                : m_send_buffers(send_buffer_size) 
     550                , m_strand(m_io_service) 
    550551                , m_files(40) 
    551                 , m_strand(m_io_service) 
    552552                , m_half_open(m_io_service) 
    553553                , m_download_channel(m_io_service, peer_connection::download_channel) 
     
    676676#endif 
    677677                m_timer.cancel(); 
    678  
    679                 // close the listen sockets 
    680                 for (std::list<listen_socket_t>::iterator i = m_listen_sockets.begin() 
    681                         , end(m_listen_sockets.end()); i != end; ++i) 
    682                 { 
    683                         i->sock->close(); 
    684                 } 
    685  
    686 #if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) 
    687                 (*m_logger) << time_now_string() << " aborting all torrents\n"; 
    688 #endif 
    689678                // abort all torrents 
    690679                for (torrent_map::iterator i = m_torrents.begin() 
     
    694683                } 
    695684 
    696 #if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) 
    697                 (*m_logger) << time_now_string() << " aborting all connections\n"; 
    698 #endif 
    699                 // abort all connections 
    700                 for (connection_map::iterator i = m_connections.begin() 
    701                         , end(m_connections.end()); i != end; ++i) 
    702                 { 
    703                         i->second->disconnect(); 
    704                 } 
    705                  
    706 #if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) 
    707                 (*m_logger) << time_now_string() << " aborting all tracker requests\n"; 
    708 #endif 
    709                 m_tracker_manager.abort_all_requests(); 
    710  
    711 #if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) 
    712                 (*m_logger) << time_now_string() << " shutting down connection queue\n"; 
    713 #endif 
    714                 m_half_open.close(); 
     685                m_io_service.stop();  
    715686 
    716687                mutex::scoped_lock l2(m_checker_impl.m_mutex); 
     
    15151486 
    15161487                deadline_timer tracker_timer(m_io_service); 
     1488                // this will remove the port mappings 
     1489                if (m_natpmp.get()) 
     1490                        m_natpmp->close(); 
     1491                if (m_upnp.get()) 
     1492                        m_upnp->close(); 
    15171493 
    15181494#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) 
     
    15211497                session_impl::mutex_t::scoped_lock l(m_mutex); 
    15221498 
     1499#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) 
     1500                (*m_logger) << time_now_string() << " aborting all tracker requests\n"; 
     1501#endif 
    15231502                m_tracker_manager.abort_all_requests(); 
    15241503#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) 
     
    21232102        entry session_impl::dht_state() const 
    21242103        { 
    2125                 mutex_t::scoped_lock l(m_mutex); 
    2126                 if (!m_dht) return entry(); 
     2104                TORRENT_ASSERT(m_dht); 
     2105                mutex_t::scoped_lock l(m_mutex); 
    21272106                return m_dht->state(); 
    21282107        } 
     
    21602139        session_impl::~session_impl() 
    21612140        { 
     2141                abort(); 
     2142 
    21622143#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) 
    21632144                (*m_logger) << time_now_string() << "\n\n *** shutting down session *** \n\n"; 
    21642145#endif 
    2165                 abort(); 
     2146                // lock the main thread and abort it 
     2147                mutex_t::scoped_lock l(m_mutex); 
     2148                m_abort = true; 
     2149                m_io_service.stop(); 
     2150                l.unlock(); 
    21662151 
    21672152#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) 
  • tags/deluge-0.5.6.2/libtorrent/src/torrent.cpp

    r2069 r2095  
    30563056        void torrent::debug_log(const std::string& line) 
    30573057        { 
    3058                 (*m_ses.m_logger) << time_now_string() << " " << line << "\n"; 
     3058                (*m_ses.m_logger) << line << "\n"; 
    30593059        } 
    30603060#endif 
  • tags/deluge-0.5.6.2/libtorrent/src/tracker_manager.cpp

    r2072 r2095  
    303303                m_completion_timeout = completion_timeout; 
    304304                m_read_timeout = read_timeout; 
    305                 m_start_time = m_read_time = time_now(); 
     305                m_start_time = time_now(); 
     306                m_read_time = time_now(); 
    306307 
    307308                m_timeout.expires_at((std::min)( 
    308309                        m_read_time + seconds(m_read_timeout) 
    309                         , m_start_time + seconds((std::min)(m_completion_timeout 
    310                         , m_read_timeout)))); 
     310                        , m_start_time + seconds(m_completion_timeout))); 
    311311                m_timeout.async_wait(m_strand.wrap(bind( 
    312312                        &timeout_handler::timeout_callback, self(), _1))); 
     
    344344                m_timeout.expires_at((std::min)( 
    345345                        m_read_time + seconds(m_read_timeout) 
    346                         , m_start_time + seconds((std::min)(m_completion_timeout 
    347                         , m_read_timeout)))); 
     346                        , m_start_time + seconds(m_completion_timeout))); 
    348347                m_timeout.async_wait(m_strand.wrap( 
    349348                        bind(&timeout_handler::timeout_callback, self(), _1))); 
  • tags/deluge-0.5.6.2/libtorrent/src/udp_tracker_connection.cpp

    r2069 r2095  
    9797                        , m_strand.wrap(boost::bind( 
    9898                        &udp_tracker_connection::name_lookup, self(), _1, _2))); 
    99                 set_timeout(req.event == tracker_request::stopped 
    100                         ? m_settings.stop_tracker_timeout 
    101                         : m_settings.tracker_completion_timeout 
     99                set_timeout(m_settings.tracker_completion_timeout 
    102100                        , m_settings.tracker_receive_timeout); 
    103101        } 
     
    159157        void udp_tracker_connection::on_timeout() 
    160158        { 
    161                 asio::error_code ec; 
    162                 m_socket.close(ec); 
     159                m_socket.close(); 
    163160                m_name_lookup.cancel(); 
    164161                fail_timeout(); 
    165         } 
    166  
    167         void udp_tracker_connection::close() 
    168         { 
    169                 asio::error_code ec; 
    170                 m_socket.close(ec); 
    171                 m_name_lookup.cancel(); 
    172                 tracker_connection::close(); 
    173162        } 
    174163 
     
    480469 
    481470                m_man.remove_request(this); 
    482                 close(); 
    483471                return; 
    484472        } 
     
    556544                { 
    557545                        m_man.remove_request(this); 
    558                         close(); 
    559546                        return; 
    560547                } 
     
    565552 
    566553                m_man.remove_request(this); 
    567                 close(); 
    568554        } 
    569555        catch (std::exception& e) 
  • tags/deluge-0.5.6.2/setup.py

    r2079 r2095  
    2929NAME = "deluge" 
    3030FULLNAME = "Deluge BitTorrent Client" 
    31 VERSION    = "0.5.6.15" 
     31VERSION    = "0.5.6.2" 
    3232AUTHOR = "Zach Tibbitts, Alon Zakai, Marcos Pinto, Andrew Resch, Alex Dedul" 
    3333EMAIL = "zach@collegegeek.org, kripkensteiner@gmail.com, marcospinto@dipconsultants.com, alonzakai@gmail.com, rotmer@gmail.com" 
  • tags/deluge-0.5.6.2/src/common.py

    r2057 r2095  
    3333 
    3434PROGRAM_NAME = "Deluge" 
    35 PROGRAM_VERSION = "0.5.6.15" 
     35PROGRAM_VERSION = "0.5.6.2" 
    3636 
    3737CLIENT_CODE = "DE" 
  • trunk/ChangeLog

    r2092 r2095  
    22  * Set default piece size to 256-KiB in TorrentCreator plugin and add 2048KiB 
    33  as a size option. 
     4  * Fix a bug in Debian package that caused the UI to completely freeze when a  
     5  torrent finished 
    46  * Find and fix another shutdown bug that mostly Gutsy users were incountering 
    57  * Fix a couple of WebUI bugs, including the "index" page erroring out 
  • trunk/libtorrent/include/libtorrent/aux_/session_impl.hpp

    r2069 r2095  
    376376                        boost::pool<> m_send_buffers; 
    377377 
     378                        // this is where all active sockets are stored. 
     379                        // the selector can sleep while there's no activity on 
     380                        // them 
     381                        io_service m_io_service; 
     382                        asio::strand m_strand; 
     383 
    378384                        // the file pool that all storages in this session's 
    379385                        // torrents uses. It sets a limit on the number of 
     
    389395                        // object. 
    390396                        disk_io_thread m_disk_thread; 
    391  
    392                         // this is where all active sockets are stored. 
    393                         // the selector can sleep while there's no activity on 
    394                         // them 
    395                         io_service m_io_service; 
    396                         asio::strand m_strand; 
    397397 
    398398                        // this is a list of half-open tcp connections 
     
    647647                        void debug_log(const std::string& line) 
    648648                        { 
    649                                 (*m_ses.m_logger) << time_now_string() << " " << line << "\n"; 
     649                                (*m_ses.m_logger) << line << "\n"; 
    650650                        } 
    651651                        session_impl& m_ses; 
  • trunk/libtorrent/include/libtorrent/connection_queue.hpp

    r2069 r2095  
    5757        void limit(int limit); 
    5858        int limit() const; 
    59         void close(); 
    6059 
    6160#ifndef NDEBUG 
  • trunk/libtorrent/include/libtorrent/http_tracker_connection.hpp

    r2069 r2095  
    131131                        , std::string const& password = ""); 
    132132 
    133                 void close(); 
    134  
    135133        private: 
    136134 
  • trunk/libtorrent/include/libtorrent/tracker_manager.hpp

    r2069 r2095  
    203203                void fail(int code, char const* msg); 
    204204                void fail_timeout(); 
    205                 virtual void close(); 
     205                void close(); 
    206206                address const& bind_interface() const { return m_bind_interface; } 
    207207 
  • trunk/libtorrent/include/libtorrent/udp_tracker_connection.hpp

    r2069 r2095  
    7575                        , session_settings const& stn); 
    7676 
    77                 void close(); 
    78  
    7977        private: 
    8078 
  • trunk/libtorrent/src/connection_queue.cpp

    r2069 r2095  
    8787        } 
    8888 
    89         void connection_queue::close() 
    90         { 
    91                 m_timer.cancel(); 
    92         } 
    93  
    9489        void connection_queue::limit(int limit) 
    9590        { m_half_open_limit = limit; } 
  • trunk/libtorrent/src/http_tracker_connection.cpp

    r2069 r2095  
    490490                m_name_lookup.async_resolve(q, m_strand.wrap( 
    491491                        boost::bind(&http_tracker_connection::name_lookup, self(), _1, _2))); 
    492                 set_timeout(req.event == tracker_request::stopped 
    493                         ? m_settings.stop_tracker_timeout 
    494                         : m_settings.tracker_completion_timeout 
     492                set_timeout(m_settings.tracker_completion_timeout 
    495493                        , m_settings.tracker_receive_timeout); 
    496494        } 
     
    504502                m_connection_ticket = -1; 
    505503                fail_timeout(); 
    506         } 
    507  
    508         void http_tracker_connection::close() 
    509         { 
    510                 asio::error_code ec; 
    511                 m_socket.close(ec); 
    512                 m_name_lookup.cancel(); 
    513                 if (m_connection_ticket > -1) m_cc.done(m_connection_ticket);