Changeset 3732
- Timestamp:
- 08/19/08 07:45:23 (5 months ago)
- Location:
- branches/1.0.0_RC/libtorrent
- Files:
-
- 3 modified
-
include/libtorrent/alert_types.hpp (modified) (1 diff)
-
src/piece_picker.cpp (modified) (1 diff)
-
src/torrent.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0.0_RC/libtorrent/include/libtorrent/alert_types.hpp
r3439 r3732 167 167 { 168 168 static char const* state_str[] = 169 {"checking (q)", "checking", " connecting", "dl metadata"169 {"checking (q)", "checking", "dl metadata" 170 170 , "downloading", "finished", "seeding", "allocating"}; 171 171 -
branches/1.0.0_RC/libtorrent/src/piece_picker.cpp
r3675 r3732 1100 1100 int new_priority = p.priority(this); 1101 1101 1102 if (prev_priority == new_priority) return false;1102 if (prev_priority == new_priority) return ret; 1103 1103 1104 1104 TORRENT_ASSERT(prev_priority < int(m_priority_boundries.size())); -
branches/1.0.0_RC/libtorrent/src/torrent.cpp
r3675 r3732 1801 1801 1802 1802 if (m_torrent_file->num_pieces() == 0) return; 1803 bool was_finished = is_finished();1804 1803 1805 1804 size_type position = 0; … … 1827 1826 } 1828 1827 prioritize_pieces(pieces); 1829 update_peer_interest(was_finished);1830 1828 } 1831 1829 … … 1837 1835 (*i)->update_interest(); 1838 1836 1839 // if we used to be finished, but we aren't anymore1840 // we may need to connect to peers again1841 if (!is_finished() && was_finished)1842 m_policy.recalculate_connect_candidates();1843 1844 1837 // the torrent just became finished 1845 1838 if (is_finished() && !was_finished) 1839 { 1846 1840 finished(); 1841 } 1847 1842 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 1848 1846 resume_download(); 1847 m_policy.recalculate_connect_candidates(); 1848 } 1849 1849 } 1850 1850 … … 3148 3148 if (is_seed()) completed(); 3149 3149 3150 // disconnect all seeds3151 // TODO: should disconnect all peers that have the pieces we have3152 // not just seeds3150 // disconnect all seeds 3151 // TODO: should disconnect all peers that have the pieces we have 3152 // not just seeds 3153 3153 std::vector<peer_connection*> seeds; 3154 3154 for (peer_iterator i = m_connections.begin(); … … 3266 3266 set_state(torrent_status::downloading); 3267 3267 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 3268 3274 if (!is_seed()) 3269 3275 { … … 3275 3281 if (m_ses.m_auto_manage_time_scaler > 1) 3276 3282 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(); 3277 3290 } 3278 3291 … … 3290 3303 } 3291 3304 #endif 3292 3293 if (is_seed())3294 {3295 m_complete_sent = true;3296 finished();3297 }3298 3305 3299 3306 if (!m_connections_initialized) … … 3312 3319 } 3313 3320 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 3320 3321 m_files_checked = true; 3321 3322
