Changeset 3013

Show
Ignore:
Timestamp:
07/30/06 13:37:33 (2 years ago)
Author:
madcat
Message:

If there are no chunks in the file, fall back to standard getNextChunk() method when generating used range.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • hydranode/hncore/partdata.cpp

    r3009 r3013  
    465465        const boost::filesystem::path &path, MetaData *md, 
    466466        RangeList64 completed, RangeList64 verified 
    467 ) : Object(0), m_size(md->getSize()), m_loc(path), m_complete(completed),  
    468 m_verified(verified), m_chunks(new ChunkMap), m_toFlush(), m_md(md),  
    469 m_pendingHashes(), m_sourceCnt(), m_fullSourceCnt(), m_paused(), m_stopped(),  
     467) : Object(0), m_size(md->getSize()), m_loc(path), m_complete(completed), 
     468m_verified(verified), m_chunks(new ChunkMap), m_toFlush(), m_md(md), 
     469m_pendingHashes(), m_sourceCnt(), m_fullSourceCnt(), m_paused(), m_stopped(), 
    470470m_autoPaused() { 
    471471        initSignals(); 
     
    769769                boost::make_tuple(false, true) 
    770770        ); 
     771        if (!std::distance(r.first, r.second)) { 
     772                return getNextChunk(size, pred); 
     773        } 
     774 
    771775        uint32_t hopCnt = 0; 
    772776        for (SIter i = r.first; i != r.second; ++i) { 
     
    14971501                } catch (std::exception &e) { 
    14981502                        logDebug( 
    1499                                 boost::format("Deleting file %s: %s")  
     1503                                boost::format("Deleting file %s: %s") 
    15001504                                % m_loc.native_file_string() % e.what() 
    15011505                        ); 
     
    15071511                } catch (std::exception &e) { 
    15081512                        logDebug( 
    1509                                 boost::format("Deleting file %s: %s")  
     1513                                boost::format("Deleting file %s: %s") 
    15101514                                % tmp.native_file_string() % e.what() 
    15111515                        ); 
     
    15171521                } catch (std::exception &e) { 
    15181522                        logDebug( 
    1519                                 boost::format("Deleting file %s: %s")  
     1523                                boost::format("Deleting file %s: %s") 
    15201524                                % tmp.native_file_string() % e.what() 
    15211525                        ); 
     
    16501654        for (size_t i = 0; i < fname.size(); ++i) { 
    16511655                if ( 
    1652                         fname[i] == '\\' || fname[i] == '/' ||  
     1656                        fname[i] == '\\' || fname[i] == '/' || 
    16531657                        fname[i] == '*'  || fname[i] == ':' || 
    16541658                        fname[i] == '"'  || fname[i] == '?' || 
     
    16681672        } 
    16691673        logMsg( 
    1670                 boost::format("Allocating %d disk space for download %s.")  
     1674                boost::format("Allocating %d disk space for download %s.") 
    16711675                % Utils::bytesToString(m_size) % getName() 
    16721676        );