From: James Turner Date: Sun, 21 Feb 2016 19:49:02 +0000 (+0200) Subject: Optionally use HTTP repository. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d179fccfcbce8a03a2569b390414f180ef6efc85;p=simgear.git Optionally use HTTP repository. - disabled by default since needs much testing. --- diff --git a/simgear/scene/tsync/terrasync.cxx b/simgear/scene/tsync/terrasync.cxx index 952a4301..80cb914b 100644 --- a/simgear/scene/tsync/terrasync.cxx +++ b/simgear/scene/tsync/terrasync.cxx @@ -22,10 +22,7 @@ // // $Id$ -#ifdef HAVE_CONFIG_H -# include -#endif - +#include #include #ifdef HAVE_WINDOWS_H @@ -50,7 +47,6 @@ #include #include -#include #include #include "terrasync.hxx" @@ -64,6 +60,7 @@ #include #include #include +#include #include static const bool svn_built_in_available = true; @@ -258,6 +255,10 @@ public: void setSvnServer(string server) { _svn_server = stripPath(server);} void setSvnDataServer(string server) { _svn_data_server = stripPath(server);} + void setHTTPServer(const std::string& server) + { + _httpServer = stripPath(server); + } void setExtSvnUtility(string svn_util) { _svn_command = simgear::strutils::strip(svn_util);} void setRsyncServer(string server) { _rsync_server = simgear::strutils::strip(server);} @@ -324,6 +325,7 @@ private: string _rsync_server; string _local_dir; SGPath _persistentCachePath; + string _httpServer; }; SGTerraSync::SvnThread::SvnThread() : @@ -651,11 +653,16 @@ void SGTerraSync::SvnThread::updateSyncSlot(SyncSlot &slot) } // of creating directory step string serverUrl(_svn_server); - if (slot.currentItem._type == SyncItem::AIData) { - serverUrl = _svn_data_server; + if (!_httpServer.empty()) { + slot.repository.reset(new HTTPRepository(path, &_http)); + serverUrl = _httpServer; + } else { + if (slot.currentItem._type == SyncItem::AIData) { + serverUrl = _svn_data_server; + } + slot.repository.reset(new SVNRepository(path, &_http)); } - slot.repository.reset(new SVNRepository(path, &_http)); slot.repository->setBaseUrl(serverUrl + "/" + slot.currentItem._dir); slot.repository->update(); @@ -906,6 +913,7 @@ void SGTerraSync::reinit() if (_terraRoot->getBoolValue("enabled",false)) { _svnThread->setSvnServer(_terraRoot->getStringValue("svn-server","")); + _svnThread->setHTTPServer(_terraRoot->getStringValue("http-server","")); _svnThread->setSvnDataServer(_terraRoot->getStringValue("svn-data-server","")); _svnThread->setRsyncServer(_terraRoot->getStringValue("rsync-server","")); _svnThread->setLocalDir(_terraRoot->getStringValue("scenery-dir",""));