Skip to content

Commit

Permalink
ignoring files with missing MD5 checksum in remote feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
nestal committed Jul 16, 2012
1 parent 593c335 commit 94383e0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions libgrive/src/drive/Resource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ void Resource::FromRemoteFile( const Entry& remote, const DateTime& last_sync )
}
}

// remote checksum unknown, assume the file is not changed in remote
else if ( remote.MD5().empty() )
{
Log( "file %1% has unknown checksum in remote. assuned in sync",
Path(), log::verbose ) ;
m_state = sync ;
}

// if checksum is equal, no need to compare the mtime
else if ( remote.MD5() == m_md5 )
{
Expand Down Expand Up @@ -259,10 +267,7 @@ void Resource::FromLocal( const DateTime& last_sync )
// remote_deleted first, it will be updated to sync/remote_changed
// in FromRemote()
else
{
m_state = ( m_mtime > last_sync ? local_new : remote_deleted ) ;
// Trace( "file %1% mtime %2%, last_sync %3%, state (%4%)", path, m_mtime, last_sync, m_state ) ;
}

m_name = Path2Str( path.filename() ) ;
m_kind = fs::is_directory(path) ? "folder" : "file" ;
Expand Down

0 comments on commit 94383e0

Please sign in to comment.