disable an unimportant assertion and replace it with a warning

pull/40/head
Nestal Wan 2012-06-20 22:46:17 +08:00
parent a799e7a611
commit c5a5221f4b
3 changed files with 7 additions and 5 deletions

View File

@ -130,13 +130,14 @@ int Main( int argc, char **argv )
// log grive version to log file
file_log->Log( log::Fmt("grive version " VERSION " " __DATE__ " " __TIME__), log::verbose ) ;
file_log->Log( log::Fmt("current time: %1%") % DateTime::Now(), log::verbose ) ;
comp_log->Add( file_log ) ;
}
if ( vm.count( "version" ) )
{
std::cout
<< "grive version " VERSION " " __DATE__ " " __TIME__ << std::endl ;
<< "grive version " << VERSION << ' ' << __DATE__ << ' ' << __TIME__ << std::endl ;
return 0 ;
}
if ( vm.count( "verbose" ) )

View File

@ -66,13 +66,12 @@ Drive::Drive( OAuth2& auth, const Json& options ) :
http::CurlAgent http ;
long prev_stamp = m_state.ChangeStamp() ;
Trace( "previous time stamp is %1%", prev_stamp ) ;
Trace( "previous change stamp is %1%", prev_stamp ) ;
// get metadata
http::XmlResponse xrsp ;
// http::ResponseLog log( "meta-", ".xml", &xrsp ) ;
http.Get( "https://docs.google.com/feeds/metadata/default", &xrsp, m_http_hdr ) ;
Trace( "return %1%", xrsp.Response()["docs:largestChangestamp"] ) ;
m_state.ChangeStamp(
std::atoi(xrsp.Response()["docs:largestChangestamp"]["@value"].front().Value().c_str()) ) ;

View File

@ -502,8 +502,10 @@ void Resource::Download( http::Agent* http, const fs::path& file, const http::He
long r = http->Get( m_content, &dl, auth ) ;
if ( r <= 400 )
{
assert( m_mtime != DateTime() ) ;
os::SetFileTime( file, m_mtime ) ;
if ( m_mtime != DateTime() )
os::SetFileTime( file, m_mtime ) ;
else
Log( "encountered zero date time after downloading %1%", file, log::warning ) ;
}
}