Changeset 4027

Show
Ignore:
Timestamp:
10/17/08 17:54:07 (3 months ago)
Author:
andar
Message:

lt sync 2823

Files:
8 modified

Legend:

Unmodified
Added
Removed
  • branches/1.0.0_RC/libtorrent/src/peer_connection.cpp

    r4013 r4027  
    305305                boost::shared_ptr<torrent> t2 = rhs.associated_torrent().lock(); 
    306306                TORRENT_ASSERT(t2); 
    307                 if (!is_choked()) c1 -= t1->torrent_file().piece_length(); 
    308                 if (!rhs.is_choked()) c2 -= t2->torrent_file().piece_length(); 
     307                if (!is_choked()) c1 -= (std::max)(t1->torrent_file().piece_length(), 256 * 1024); 
     308                if (!rhs.is_choked()) c2 -= (std::max)(t2->torrent_file().piece_length(), 256 * 1024); 
    309309                 
    310310                return c1 < c2; 
  • branches/1.0.0_RC/libtorrent/src/piece_picker.cpp

    r4002 r4027  
    996996#ifdef TORRENT_PICKER_LOG 
    997997                print_pieces(); 
    998 #endif 
    999  
    1000 #ifndef NDEBUG 
    1001                 check_invariant(); 
    1002998#endif 
    1003999        } 
  • branches/1.0.0_RC/libtorrent/src/policy.cpp

    r4013 r4027  
    339339                if (m_torrent->has_picker()) 
    340340                        p = &m_torrent->picker(); 
    341                 for (iterator i = m_peers.begin() 
    342                         , end(m_peers.end()); i != end;) 
     341                for (iterator i = m_peers.begin(); i != m_peers.end();) 
    343342                { 
    344343                        if ((ses.m_ip_filter.access(i->second.addr) & ip_filter::blocked) == 0) 
  • branches/1.0.0_RC/libtorrent/src/torrent_info.cpp

    r3942 r4027  
    310310                if (ret < 0) return; 
    311311 
     312                if (buf.empty()) 
     313#ifndef BOOST_NO_EXCEPTIONS 
     314                        throw invalid_torrent_file(); 
     315#else 
     316                        return; 
     317#endif 
     318 
    312319                lazy_entry e; 
    313320                lazy_bdecode(&buf[0], &buf[0] + buf.size(), e); 
  • trunk/libtorrent/src/peer_connection.cpp

    r4013 r4027  
    305305                boost::shared_ptr<torrent> t2 = rhs.associated_torrent().lock(); 
    306306                TORRENT_ASSERT(t2); 
    307                 if (!is_choked()) c1 -= t1->torrent_file().piece_length(); 
    308                 if (!rhs.is_choked()) c2 -= t2->torrent_file().piece_length(); 
     307                if (!is_choked()) c1 -= (std::max)(t1->torrent_file().piece_length(), 256 * 1024); 
     308                if (!rhs.is_choked()) c2 -= (std::max)(t2->torrent_file().piece_length(), 256 * 1024); 
    309309                 
    310310                return c1 < c2; 
  • trunk/libtorrent/src/piece_picker.cpp

    r4002 r4027  
    996996#ifdef TORRENT_PICKER_LOG 
    997997                print_pieces(); 
    998 #endif 
    999  
    1000 #ifndef NDEBUG 
    1001                 check_invariant(); 
    1002998#endif 
    1003999        } 
  • trunk/libtorrent/src/policy.cpp

    r4013 r4027  
    339339                if (m_torrent->has_picker()) 
    340340                        p = &m_torrent->picker(); 
    341                 for (iterator i = m_peers.begin() 
    342                         , end(m_peers.end()); i != end;) 
     341                for (iterator i = m_peers.begin(); i != m_peers.end();) 
    343342                { 
    344343                        if ((ses.m_ip_filter.access(i->second.addr) & ip_filter::blocked) == 0) 
  • trunk/libtorrent/src/torrent_info.cpp

    r3942 r4027  
    310310                if (ret < 0) return; 
    311311 
     312                if (buf.empty()) 
     313#ifndef BOOST_NO_EXCEPTIONS 
     314                        throw invalid_torrent_file(); 
     315#else 
     316                        return; 
     317#endif 
     318 
    312319                lazy_entry e; 
    313320                lazy_bdecode(&buf[0], &buf[0] + buf.size(), e);