Show
Ignore:
Timestamp:
08/25/10 03:14:19 (21 months ago)
Author:
rakshasa
Message:

* Some debugging tools added.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/libtorrent/src/data/chunk_part.cc

    r939 r1172  
    6262 
    6363uint32_t 
    64 ChunkPart::incore_length(uint32_t pos) { 
     64ChunkPart::incore_length(uint32_t pos, uint32_t length) { 
    6565  // Do we want to use this? 
    66   pos -= m_position; 
     66  length = std::min(length, remaining_from(pos)); 
     67  pos = pos - m_position; 
    6768 
    6869  if (pos >= size()) 
    6970    throw internal_error("ChunkPart::incore_length(...) got invalid position"); 
    7071 
    71   int length = size() - pos; 
    7272  int touched = m_chunk.pages_touched(pos, length); 
    7373  char buf[touched];