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