Show
Ignore:
Timestamp:
11/04/06 11:05:28 (6 years ago)
Author:
rakshasa
Message:

* Properly nul-terminate the info hash and client id in the tracker
request.

* Implemented options for read-ahead of
chunks. 'preload_min_pipelined', 'preload_min_size' and
'preload_required_rate' are used to decide when to read-ahead a chunk.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/libtorrent/src/torrent/hash_string.h

    r799 r800  
    8686  void                assign(const value_type* src)     { std::memcpy(data(), src, size()); } 
    8787 
    88   bool                compare(const char* hash)         { return std::memcmp(m_data, hash, size()); } 
     88  bool                equal_to(const char* hash) const     { return std::memcmp(m_data, hash, size()) == 0; } 
     89  bool                not_equal_to(const char* hash) const { return std::memcmp(m_data, hash, size()) == 1; } 
    8990 
    9091private: 
     
    107108} 
    108109 
    109 inline bool 
    110 operator == (const HashString& one, const char* two) { 
    111   return std::memcmp(one.begin(), two, HashString::size_data) == 0; 
    112 } 
    113  
    114 inline bool 
    115 operator != (const HashString& one, const char* two) { 
    116   return std::memcmp(one.begin(), two, HashString::size_data) != 0; 
    117 } 
    118  
    119 inline bool 
    120 operator == (const char* one, const HashString& two) { 
    121   return std::memcmp(one, two.begin(), HashString::size_data) == 0; 
    122 } 
    123  
    124 inline bool 
    125 operator != (const char* one, const HashString& two) { 
    126   return std::memcmp(one, two.begin(), HashString::size_data) != 0; 
    127 } 
    128  
    129110} 
    130111