Changeset 1623

Show
Ignore:
Timestamp:
29/04/2007 21:31:14 (3 years ago)
Author:
chris
Message:

Read any remaining data from the encoded stream (such as EOF marker)
before discarding it, to ensure that we don't break the protocol.
(refs #2, refs #3)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • box/chris/merge/bin/bbackupquery/BackupQueries.cpp

    r1622 r1623  
    16961696                                                        } 
    16971697 
    1698                                                         // Must always read the entire decoded string, if it's not a symlink 
     1698                                                        // Must always read the entire decoded stream, if it's not a symlink 
    16991699                                                        if(fileOnServerStream->StreamDataLeft()) 
    17001700                                                        { 
     
    17041704                                                                { 
    17051705                                                                        fileOnServerStream->Read(buffer, sizeof(buffer), mrConnection.GetTimeout()); 
     1706                                                                } 
     1707                                                        } 
     1708 
     1709                                                        // Must always read the entire encoded stream 
     1710                                                        if(objectStream->StreamDataLeft()) 
     1711                                                        { 
     1712                                                                // Absorb all the data remaining 
     1713                                                                char buffer[2048]; 
     1714                                                                while(objectStream->StreamDataLeft()) 
     1715                                                                { 
     1716                                                                        objectStream->Read(buffer, sizeof(buffer), mrConnection.GetTimeout()); 
    17061717                                                                } 
    17071718                                                        }