mirror of https://github.com/vitalif/grive2
renamed HTTP.(hh|cc) to Agent
parent
b51e5c593f
commit
efaa5df229
|
@ -22,7 +22,7 @@
|
|||
#include "CommonUri.hh"
|
||||
#include "Entry.hh"
|
||||
|
||||
#include "http/HTTP.hh"
|
||||
#include "http/Agent.hh"
|
||||
#include "http/XmlResponse.hh"
|
||||
#include "protocol/Json.hh"
|
||||
#include "protocol/JsonResponse.hh"
|
||||
|
@ -188,12 +188,12 @@ void Drive::UpdateFile( const Json& entry )
|
|||
if ( pit != m_coll.end() )
|
||||
path = pit->Dir() / file.Filename() ;
|
||||
}
|
||||
|
||||
|
||||
// compare checksum first if file exists
|
||||
std::ifstream ifile( path.Str().c_str(), std::ios::binary | std::ios::in ) ;
|
||||
if ( ifile && file.ServerMD5() == crypt::MD5(ifile.rdbuf()) )
|
||||
changed = false ;
|
||||
|
||||
|
||||
// if the checksum is different, file is changed and we need to update
|
||||
if ( changed )
|
||||
{
|
||||
|
|
|
@ -46,6 +46,10 @@ Entry::Entry( const Json& entry )
|
|||
Update( entry ) ;
|
||||
}
|
||||
|
||||
Entry::Entry( const xml::Node& n )
|
||||
{
|
||||
}
|
||||
|
||||
Entry::Entry( const std::string& title, const std::string& href ) :
|
||||
m_title( title ),
|
||||
m_self_href( href )
|
||||
|
|
|
@ -21,13 +21,18 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "http/HTTP.hh"
|
||||
#include "http/Agent.hh"
|
||||
#include "util/DateTime.hh"
|
||||
|
||||
#include <iosfwd>
|
||||
|
||||
namespace gr {
|
||||
|
||||
namespace xml
|
||||
{
|
||||
class Node ;
|
||||
}
|
||||
|
||||
class Json ;
|
||||
class OAuth2 ;
|
||||
class Path ;
|
||||
|
@ -37,6 +42,7 @@ class Entry
|
|||
public :
|
||||
explicit Entry( const Path& file ) ;
|
||||
explicit Entry( const Json& entry ) ;
|
||||
explicit Entry( const xml::Node& n ) ;
|
||||
Entry( const std::string& title, const std::string& href ) ;
|
||||
|
||||
std::string Title() const ;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "HTTP.hh"
|
||||
#include "Agent.hh"
|
||||
|
||||
#include "Download.hh"
|
||||
#include "Exception.hh"
|
|
@ -22,7 +22,7 @@
|
|||
#include "JsonResponse.hh"
|
||||
#include "Json.hh"
|
||||
|
||||
#include "http/HTTP.hh"
|
||||
#include "http/Agent.hh"
|
||||
|
||||
// for debugging
|
||||
#include <iostream>
|
||||
|
|
Loading…
Reference in New Issue