mirror of https://github.com/vitalif/grive2
Compare commits
2 Commits
5b31d7ab15
...
843c7e6093
Author | SHA1 | Date |
---|---|---|
Gianluca Recchia | 843c7e6093 | |
Gianluca Recchia | a85ab1cf2d |
|
@ -122,7 +122,10 @@ bool Syncer2::Move( Resource* res, Resource* newParentRes, std::string newFilena
|
||||||
hdr2.Add( "Content-Type: application/json" );
|
hdr2.Add( "Content-Type: application/json" );
|
||||||
http::ValResponse vrsp ;
|
http::ValResponse vrsp ;
|
||||||
// Don't change modified date because we're only moving
|
// Don't change modified date because we're only moving
|
||||||
long http_code = m_http->Put(
|
#ifndef NDEBUG
|
||||||
|
const long http_code =
|
||||||
|
#endif
|
||||||
|
m_http->Put(
|
||||||
feeds::files + "/" + res->ResourceID() + "?modifiedDateBehavior=noChange" + addRemoveParents,
|
feeds::files + "/" + res->ResourceID() + "?modifiedDateBehavior=noChange" + addRemoveParents,
|
||||||
json_meta, &vrsp, hdr2
|
json_meta, &vrsp, hdr2
|
||||||
) ;
|
) ;
|
||||||
|
@ -164,11 +167,19 @@ bool Syncer2::Upload( Resource *res, bool new_rev )
|
||||||
http::Header hdr2 ;
|
http::Header hdr2 ;
|
||||||
hdr2.Add( "Content-Type: application/json" );
|
hdr2.Add( "Content-Type: application/json" );
|
||||||
http::ValResponse vrsp ;
|
http::ValResponse vrsp ;
|
||||||
|
#ifndef NDEBUG
|
||||||
long http_code = 0;
|
long http_code = 0;
|
||||||
|
#endif
|
||||||
if ( res->ResourceID().empty() )
|
if ( res->ResourceID().empty() )
|
||||||
http_code = m_http->Post( feeds::files, json_meta, &vrsp, hdr2 ) ;
|
#ifndef NDEBUG
|
||||||
|
http_code =
|
||||||
|
#endif
|
||||||
|
m_http->Post( feeds::files, json_meta, &vrsp, hdr2 ) ;
|
||||||
else
|
else
|
||||||
http_code = m_http->Put( feeds::files + "/" + res->ResourceID(), json_meta, &vrsp, hdr2 ) ;
|
#ifndef NDEBUG
|
||||||
|
http_code =
|
||||||
|
#endif
|
||||||
|
m_http->Put( feeds::files + "/" + res->ResourceID(), json_meta, &vrsp, hdr2 ) ;
|
||||||
valr = vrsp.Response();
|
valr = vrsp.Response();
|
||||||
assert( http_code == 200 && !( valr["id"].Str().empty() ) );
|
assert( http_code == 200 && !( valr["id"].Str().empty() ) );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue