Ignore:
Timestamp:
21/08/2008 12:14:23 (3 years ago)
Author:
chris
Message:

Use SelfFlushingStream? to ensure that protocol streams are always
flushed, fixes a problem where local file is not readable during
compare, and stream was not flushed, breaking the rest of the compare.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/bin/bbackupquery/BackupQueries.cpp

    r2259 r2260  
    17101710                                                // Compare contents, if it's a regular file not a link 
    17111711                                                // Remember, we MUST read the entire stream from the server. 
     1712                                                SelfFlushingStream flushObject(*objectStream); 
     1713 
    17121714                                                if(!fileOnServerStream->IsSymLink()) 
    17131715                                                { 
     1716                                                        SelfFlushingStream flushFile(*fileOnServerStream); 
    17141717                                                        // Open the local file 
    17151718                                                        FileStream l(localPath.c_str()); 
     
    17411744                                                        { 
    17421745                                                                equal = false; 
    1743                                                         } 
    1744  
    1745                                                         // Must always read the entire decoded stream, if it's not a symlink 
    1746                                                         if(fileOnServerStream->StreamDataLeft()) 
    1747                                                         { 
    1748                                                                 // Absorb all the data remaining 
    1749                                                                 char buffer[2048]; 
    1750                                                                 while(fileOnServerStream->StreamDataLeft()) 
    1751                                                                 { 
    1752                                                                         fileOnServerStream->Read(buffer, sizeof(buffer), mrConnection.GetTimeout()); 
    1753                                                                 } 
    1754                                                         } 
    1755  
    1756                                                         // Must always read the entire encoded stream 
    1757                                                         if(objectStream->StreamDataLeft()) 
    1758                                                         { 
    1759                                                                 // Absorb all the data remaining 
    1760                                                                 char buffer[2048]; 
    1761                                                                 while(objectStream->StreamDataLeft()) 
    1762                                                                 { 
    1763                                                                         objectStream->Read(buffer, sizeof(buffer), mrConnection.GetTimeout()); 
    1764                                                                 } 
    17651746                                                        } 
    17661747                                                } 
Note: See TracChangeset for help on using the changeset viewer.