Changeset 3758

Show
Ignore:
Timestamp:
08/26/08 01:03:39 (4 months ago)
Author:
andar
Message:

lt sync 2637

Files:
12 modified

Legend:

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

    r3740 r3758  
    10101010                { 
    10111011                        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(); 
    10151014                } 
    10161015        }; 
     
    10321031                { 
    10331032                        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); 
    10361034                } 
    10371035        }; 
  • branches/1.0.0_RC/libtorrent/include/libtorrent/piece_picker.hpp

    r3330 r3758  
    162162                void we_dont_have(int index); 
    163163 
     164                // sets all pieces to dont-have 
    164165                void init(int blocks_per_piece, int total_num_blocks); 
    165166                int num_pieces() const { return int(m_piece_map.size()); } 
  • branches/1.0.0_RC/libtorrent/src/peer_connection.cpp

    r3751 r3758  
    15891589#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING 
    15901590                        (*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"; 
    15931593#endif 
    15941594 
  • branches/1.0.0_RC/libtorrent/src/piece_picker.cpp

    r3732 r3758  
    8282                m_piece_map.resize((total_num_blocks + blocks_per_piece-1) / blocks_per_piece 
    8383                        , 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                } 
    8496 
    8597                // the piece index is stored in 20 bits, which limits the allowed 
     
    10751087                 
    10761088                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())); 
    10781090 
    10791091                bool ret = false; 
     
    11011113 
    11021114                if (prev_priority == new_priority) return ret; 
    1103  
    1104                 TORRENT_ASSERT(prev_priority < int(m_priority_boundries.size())); 
    11051115 
    11061116                if (m_dirty) return ret; 
  • branches/1.0.0_RC/libtorrent/src/session_impl.cpp

    r3512 r3758  
    602602                } 
    603603                s.external_port = s.sock->local_endpoint(ec).port(); 
    604                 s.sock->listen(0, ec); 
     604                s.sock->listen(5, ec); 
    605605                if (ec) 
    606606                { 
     
    725725                        } 
    726726                } 
     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 
    727731        } 
    728732 
     
    23732377                TORRENT_ASSERT(ip != address()); 
    23742378 
     2379                if (is_local(ip)) return; 
     2380                if (is_loopback(ip)) return; 
    23752381                if (m_external_address == ip) return; 
    23762382 
  • branches/1.0.0_RC/libtorrent/src/torrent.cpp

    r3740 r3758  
    668668                        , m_storage_mode); 
    669669                m_storage = m_owning_storage.get(); 
    670                 m_picker.reset(new piece_picker); 
    671670                m_picker->init(m_torrent_file->piece_length() / m_block_size 
    672671                        , int((m_torrent_file->total_size()+m_block_size-1)/m_block_size)); 
  • trunk/libtorrent/include/libtorrent/alert_types.hpp

    r3739 r3758  
    10101010                { 
    10111011                        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(); 
    10151014                } 
    10161015        }; 
     
    10321031                { 
    10331032                        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); 
    10361034                } 
    10371035        }; 
  • trunk/libtorrent/include/libtorrent/piece_picker.hpp

    r3330 r3758  
    162162                void we_dont_have(int index); 
    163163 
     164                // sets all pieces to dont-have 
    164165                void init(int blocks_per_piece, int total_num_blocks); 
    165166                int num_pieces() const { return int(m_piece_map.size()); } 
  • trunk/libtorrent/src/peer_connection.cpp

    r3751 r3758  
    15891589#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING 
    15901590                        (*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"; 
    15931593#endif 
    15941594 
  • trunk/libtorrent/src/piece_picker.cpp

    r3731 r3758  
    8282                m_piece_map.resize((total_num_blocks + blocks_per_piece-1) / blocks_per_piece 
    8383                        , 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                } 
    8496 
    8597                // the piece index is stored in 20 bits, which limits the allowed 
     
    10751087                 
    10761088                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())); 
    10781090 
    10791091                bool ret = false; 
     
    11011113 
    11021114                if (prev_priority == new_priority) return ret; 
    1103  
    1104                 TORRENT_ASSERT(prev_priority < int(m_priority_boundries.size())); 
    11051115 
    11061116                if (m_dirty) return ret; 
  • trunk/libtorrent/src/session_impl.cpp

    r3512 r3758  
    602602                } 
    603603                s.external_port = s.sock->local_endpoint(ec).port(); 
    604                 s.sock->listen(0, ec); 
     604                s.sock->listen(5, ec); 
    605605                if (ec) 
    606606                { 
     
    725725                        } 
    726726                } 
     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 
    727731        } 
    728732 
     
    23732377                TORRENT_ASSERT(ip != address()); 
    23742378 
     2379                if (is_local(ip)) return; 
     2380                if (is_loopback(ip)) return; 
    23752381                if (m_external_address == ip) return; 
    23762382 
  • trunk/libtorrent/src/torrent.cpp

    r3739 r3758  
    668668                        , m_storage_mode); 
    669669                m_storage = m_owning_storage.get(); 
    670                 m_picker.reset(new piece_picker); 
    671670                m_picker->init(m_torrent_file->piece_length() / m_block_size 
    672671                        , int((m_torrent_file->total_size()+m_block_size-1)/m_block_size));