Changeset 3732

Show
Ignore:
Timestamp:
08/19/08 07:45:23 (5 months ago)
Author:
andar
Message:

lt sync 2613

Location:
branches/1.0.0_RC/libtorrent
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/1.0.0_RC/libtorrent/include/libtorrent/alert_types.hpp

    r3439 r3732  
    167167                { 
    168168                        static char const* state_str[] = 
    169                                 {"checking (q)", "checking", "connecting", "dl metadata" 
     169                                {"checking (q)", "checking", "dl metadata" 
    170170                                , "downloading", "finished", "seeding", "allocating"}; 
    171171 
  • branches/1.0.0_RC/libtorrent/src/piece_picker.cpp

    r3675 r3732  
    11001100                int new_priority = p.priority(this); 
    11011101 
    1102                 if (prev_priority == new_priority) return false; 
     1102                if (prev_priority == new_priority) return ret; 
    11031103 
    11041104                TORRENT_ASSERT(prev_priority < int(m_priority_boundries.size())); 
  • branches/1.0.0_RC/libtorrent/src/torrent.cpp

    r3675 r3732  
    18011801 
    18021802                if (m_torrent_file->num_pieces() == 0) return; 
    1803                 bool was_finished = is_finished(); 
    18041803 
    18051804                size_type position = 0; 
     
    18271826                } 
    18281827                prioritize_pieces(pieces); 
    1829                 update_peer_interest(was_finished); 
    18301828        } 
    18311829 
     
    18371835                        (*i)->update_interest(); 
    18381836 
    1839                 // if we used to be finished, but we aren't anymore 
    1840                 // we may need to connect to peers again 
    1841                 if (!is_finished() && was_finished) 
    1842                         m_policy.recalculate_connect_candidates(); 
    1843          
    18441837                // the torrent just became finished 
    18451838                if (is_finished() && !was_finished) 
     1839                { 
    18461840                        finished(); 
     1841                } 
    18471842                else if (!is_finished() && was_finished) 
     1843                { 
     1844                        // if we used to be finished, but we aren't anymore 
     1845                        // we may need to connect to peers again 
    18481846                        resume_download(); 
     1847                        m_policy.recalculate_connect_candidates(); 
     1848                } 
    18491849        } 
    18501850 
     
    31483148                if (is_seed()) completed(); 
    31493149 
    3150         // disconnect all seeds 
    3151         // TODO: should disconnect all peers that have the pieces we have 
    3152         // not just seeds 
     3150                // disconnect all seeds 
     3151                // TODO: should disconnect all peers that have the pieces we have 
     3152                // not just seeds 
    31533153                std::vector<peer_connection*> seeds; 
    31543154                for (peer_iterator i = m_connections.begin(); 
     
    32663266                set_state(torrent_status::downloading); 
    32673267 
     3268                if (m_ses.m_alerts.should_post<torrent_checked_alert>()) 
     3269                { 
     3270                        m_ses.m_alerts.post_alert(torrent_checked_alert( 
     3271                                get_handle())); 
     3272                } 
     3273                 
    32683274                if (!is_seed()) 
    32693275                { 
     
    32753281                        if (m_ses.m_auto_manage_time_scaler > 1) 
    32763282                                m_ses.m_auto_manage_time_scaler = 1; 
     3283 
     3284                        if (is_finished()) finished(); 
     3285                } 
     3286                else 
     3287                { 
     3288                        m_complete_sent = true; 
     3289                        finished(); 
    32773290                } 
    32783291 
     
    32903303                } 
    32913304#endif 
    3292  
    3293                 if (is_seed()) 
    3294                 { 
    3295                         m_complete_sent = true; 
    3296                         finished(); 
    3297                 } 
    32983305 
    32993306                if (!m_connections_initialized) 
     
    33123319                } 
    33133320 
    3314                 if (m_ses.m_alerts.should_post<torrent_checked_alert>()) 
    3315                 { 
    3316                         m_ses.m_alerts.post_alert(torrent_checked_alert( 
    3317                                 get_handle())); 
    3318                 } 
    3319                  
    33203321                m_files_checked = true; 
    33213322