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/data/entry_list.cc

    r777 r800  
    9898 
    9999  try { 
    100     if (::mkdir(m_rootDir.c_str(), 0777) && errno != EEXIST) 
     100    if (::mkdir(m_rootDir.c_str(), 0777) != 0 && errno != EEXIST) 
    101101      throw storage_error("Could not create directory '" + m_rootDir + "': " + strerror(errno)); 
    102102   
     
    205205      break; 
    206206 
    207     if (::mkdir(path.c_str(), 0777) && errno != EEXIST) 
     207    if (::mkdir(path.c_str(), 0777) != 0 && errno != EEXIST) 
    208208      throw storage_error("Could not create directory '" + path + "': " + strerror(errno)); 
    209209  } 
     
    223223  } 
    224224 
     225  rak::error_number::clear_global(); 
     226 
    225227  make_directory(path->begin(), path->end(), firstMismatch); 
    226228 
     
    229231  if (path->back().empty()) 
    230232    return node->size() == 0; 
     233 
     234  rak::file_stat fileStat; 
     235 
     236  if (fileStat.update(node->file_meta()->get_path()) && 
     237      !fileStat.is_regular() && !fileStat.is_link()) { 
     238    // Might also bork on other kinds of file types, but there's no 
     239    // suitable errno for all cases. 
     240    rak::error_number::set_global(rak::error_number::e_isdir); 
     241    return false; 
     242  } 
    231243 
    232244  return