Changeset 3758
- Timestamp:
- 08/26/08 01:03:39 (4 months ago)
- Files:
-
- 12 modified
-
branches/1.0.0_RC/libtorrent/include/libtorrent/alert_types.hpp (modified) (2 diffs)
-
branches/1.0.0_RC/libtorrent/include/libtorrent/piece_picker.hpp (modified) (1 diff)
-
branches/1.0.0_RC/libtorrent/src/peer_connection.cpp (modified) (1 diff)
-
branches/1.0.0_RC/libtorrent/src/piece_picker.cpp (modified) (3 diffs)
-
branches/1.0.0_RC/libtorrent/src/session_impl.cpp (modified) (3 diffs)
-
branches/1.0.0_RC/libtorrent/src/torrent.cpp (modified) (1 diff)
-
trunk/libtorrent/include/libtorrent/alert_types.hpp (modified) (2 diffs)
-
trunk/libtorrent/include/libtorrent/piece_picker.hpp (modified) (1 diff)
-
trunk/libtorrent/src/peer_connection.cpp (modified) (1 diff)
-
trunk/libtorrent/src/piece_picker.cpp (modified) (3 diffs)
-
trunk/libtorrent/src/session_impl.cpp (modified) (3 diffs)
-
trunk/libtorrent/src/torrent.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0.0_RC/libtorrent/include/libtorrent/alert_types.hpp
r3740 r3758 1010 1010 { 1011 1011 error_code ec; 1012 return "listening on " + endpoint.address().to_string(ec) + ":" 1013 + boost::lexical_cast<std::string>(endpoint.port()) + " failed: " 1014 + error.message(); 1012 return "listening on " + boost::lexical_cast<std::string>(endpoint) 1013 + " failed: " + error.message(); 1015 1014 } 1016 1015 }; … … 1032 1031 { 1033 1032 error_code ec; 1034 return "successfully listening on " + endpoint.address().to_string(ec) 1035 + ":" + boost::lexical_cast<std::string>(endpoint.port()); 1033 return "successfully listening on " + boost::lexical_cast<std::string>(endpoint); 1036 1034 } 1037 1035 }; -
branches/1.0.0_RC/libtorrent/include/libtorrent/piece_picker.hpp
r3330 r3758 162 162 void we_dont_have(int index); 163 163 164 // sets all pieces to dont-have 164 165 void init(int blocks_per_piece, int total_num_blocks); 165 166 int num_pieces() const { return int(m_piece_map.size()); } -
branches/1.0.0_RC/libtorrent/src/peer_connection.cpp
r3751 r3758 1589 1589 #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING 1590 1590 (*m_logger) << time_now_string() 1591 << " *** SKIPPED_PIECE [ piece: " << eq.block.piece_index << " | "1592 "b: " << eq.block.block_index << " ] ***\n";1591 << " *** SKIPPED_PIECE [ piece: " << qe.block.piece_index << " | " 1592 "b: " << qe.block.block_index << " ] ***\n"; 1593 1593 #endif 1594 1594 -
branches/1.0.0_RC/libtorrent/src/piece_picker.cpp
r3732 r3758 82 82 m_piece_map.resize((total_num_blocks + blocks_per_piece-1) / blocks_per_piece 83 83 , piece_pos(0, 0)); 84 85 m_num_filtered += m_num_have_filtered; 86 m_num_have_filtered = 0; 87 m_num_have = 0; 88 m_dirty = true; 89 for (std::vector<piece_pos>::iterator i = m_piece_map.begin() 90 , end(m_piece_map.end()); i != end; ++i) 91 { 92 i->peer_count = 0; 93 i->downloading = 0; 94 i->index = 0; 95 } 84 96 85 97 // the piece index is stored in 20 bits, which limits the allowed … … 1075 1087 1076 1088 int prev_priority = p.priority(this); 1077 TORRENT_ASSERT( prev_priority < int(m_priority_boundries.size()));1089 TORRENT_ASSERT(m_dirty | prev_priority < int(m_priority_boundries.size())); 1078 1090 1079 1091 bool ret = false; … … 1101 1113 1102 1114 if (prev_priority == new_priority) return ret; 1103 1104 TORRENT_ASSERT(prev_priority < int(m_priority_boundries.size()));1105 1115 1106 1116 if (m_dirty) return ret; -
branches/1.0.0_RC/libtorrent/src/session_impl.cpp
r3512 r3758 602 602 } 603 603 s.external_port = s.sock->local_endpoint(ec).port(); 604 s.sock->listen( 0, ec);604 s.sock->listen(5, ec); 605 605 if (ec) 606 606 { … … 725 725 } 726 726 } 727 728 #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING 729 m_logger = create_log("main_session", listen_port(), false); 730 #endif 727 731 } 728 732 … … 2373 2377 TORRENT_ASSERT(ip != address()); 2374 2378 2379 if (is_local(ip)) return; 2380 if (is_loopback(ip)) return; 2375 2381 if (m_external_address == ip) return; 2376 2382 -
branches/1.0.0_RC/libtorrent/src/torrent.cpp
r3740 r3758 668 668 , m_storage_mode); 669 669 m_storage = m_owning_storage.get(); 670 m_picker.reset(new piece_picker);671 670 m_picker->init(m_torrent_file->piece_length() / m_block_size 672 671 , int((m_torrent_file->total_size()+m_block_size-1)/m_block_size)); -
trunk/libtorrent/include/libtorrent/alert_types.hpp
r3739 r3758 1010 1010 { 1011 1011 error_code ec; 1012 return "listening on " + endpoint.address().to_string(ec) + ":" 1013 + boost::lexical_cast<std::string>(endpoint.port()) + " failed: " 1014 + error.message(); 1012 return "listening on " + boost::lexical_cast<std::string>(endpoint) 1013 + " failed: " + error.message(); 1015 1014 } 1016 1015 }; … … 1032 1031 { 1033 1032 error_code ec; 1034 return "successfully listening on " + endpoint.address().to_string(ec) 1035 + ":" + boost::lexical_cast<std::string>(endpoint.port()); 1033 return "successfully listening on " + boost::lexical_cast<std::string>(endpoint); 1036 1034 } 1037 1035 }; -
trunk/libtorrent/include/libtorrent/piece_picker.hpp
r3330 r3758 162 162 void we_dont_have(int index); 163 163 164 // sets all pieces to dont-have 164 165 void init(int blocks_per_piece, int total_num_blocks); 165 166 int num_pieces() const { return int(m_piece_map.size()); } -
trunk/libtorrent/src/peer_connection.cpp
r3751 r3758 1589 1589 #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING 1590 1590 (*m_logger) << time_now_string() 1591 << " *** SKIPPED_PIECE [ piece: " << eq.block.piece_index << " | "1592 "b: " << eq.block.block_index << " ] ***\n";1591 << " *** SKIPPED_PIECE [ piece: " << qe.block.piece_index << " | " 1592 "b: " << qe.block.block_index << " ] ***\n"; 1593 1593 #endif 1594 1594 -
trunk/libtorrent/src/piece_picker.cpp
r3731 r3758 82 82 m_piece_map.resize((total_num_blocks + blocks_per_piece-1) / blocks_per_piece 83 83 , piece_pos(0, 0)); 84 85 m_num_filtered += m_num_have_filtered; 86 m_num_have_filtered = 0; 87 m_num_have = 0; 88 m_dirty = true; 89 for (std::vector<piece_pos>::iterator i = m_piece_map.begin() 90 , end(m_piece_map.end()); i != end; ++i) 91 { 92 i->peer_count = 0; 93 i->downloading = 0; 94 i->index = 0; 95 } 84 96 85 97 // the piece index is stored in 20 bits, which limits the allowed … … 1075 1087 1076 1088 int prev_priority = p.priority(this); 1077 TORRENT_ASSERT( prev_priority < int(m_priority_boundries.size()));1089 TORRENT_ASSERT(m_dirty | prev_priority < int(m_priority_boundries.size())); 1078 1090 1079 1091 bool ret = false; … … 1101 1113 1102 1114 if (prev_priority == new_priority) return ret; 1103 1104 TORRENT_ASSERT(prev_priority < int(m_priority_boundries.size()));1105 1115 1106 1116 if (m_dirty) return ret; -
trunk/libtorrent/src/session_impl.cpp
r3512 r3758 602 602 } 603 603 s.external_port = s.sock->local_endpoint(ec).port(); 604 s.sock->listen( 0, ec);604 s.sock->listen(5, ec); 605 605 if (ec) 606 606 { … … 725 725 } 726 726 } 727 728 #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING 729 m_logger = create_log("main_session", listen_port(), false); 730 #endif 727 731 } 728 732 … … 2373 2377 TORRENT_ASSERT(ip != address()); 2374 2378 2379 if (is_local(ip)) return; 2380 if (is_loopback(ip)) return; 2375 2381 if (m_external_address == ip) return; 2376 2382 -
trunk/libtorrent/src/torrent.cpp
r3739 r3758 668 668 , m_storage_mode); 669 669 m_storage = m_owning_storage.get(); 670 m_picker.reset(new piece_picker);671 670 m_picker->init(m_torrent_file->piece_length() / m_block_size 672 671 , int((m_torrent_file->total_size()+m_block_size-1)/m_block_size));
