1 // HTTPRepository.cxx -- plain HTTP TerraSync remote client
3 // Copyright (C) 20126 James Turner <zakalawe@mac.com>
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 2 of the
8 // License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #include "HTTPRepository.hxx"
21 #include <simgear_config.h>
36 #include "simgear/debug/logstream.hxx"
37 #include "simgear/misc/strutils.hxx"
38 #include <simgear/misc/sg_dir.hxx>
39 #include <simgear/io/HTTPClient.hxx>
40 #include <simgear/io/sg_file.hxx>
41 #include <simgear/misc/sgstream.hxx>
42 #include <simgear/structure/exception.hxx>
43 #include <simgear/timing/timestamp.hxx>
45 #include <simgear/misc/sg_hash.hxx>
47 #if defined(SG_WINDOWS)
50 * public domain strtok_r() by Charlie Gordon
52 * from comp.lang.c 9/14/2007
54 * http://groups.google.com/group/comp.lang.c/msg/2ab1ecbb86646684
56 * (Declaration that it's public domain):
57 * http://groups.google.com/group/comp.lang.c/msg/7c7b39328fefab9c
72 str += strspn(str, delim);
81 str += strcspn(str, delim);
99 class HTTPRepoGetRequest : public HTTP::Request
102 HTTPRepoGetRequest(HTTPDirectory* d, const std::string& u) :
108 virtual void cancel();
110 size_t contentSize() const
115 void setContentSize(size_t sz)
120 HTTPDirectory* _directory;
124 typedef SGSharedPtr<HTTPRepoGetRequest> RepoRequestPtr;
126 class HTTPRepoPrivate
129 struct HashCacheEntry
131 std::string filePath;
138 typedef std::vector<HashCacheEntry> HashCache;
145 AbstractRepository::ResultCode error;
148 typedef std::vector<Failure> FailureList;
149 FailureList failures;
151 HTTPRepoPrivate(HTTPRepository* parent) :
152 hashCacheDirty(false),
155 status(AbstractRepository::REPO_NO_ERROR),
161 HTTPRepository* p; // link back to outer
166 AbstractRepository::ResultCode status;
167 HTTPDirectory* rootDir;
168 size_t totalDownloaded;
170 HTTP::Request_ptr updateFile(HTTPDirectory* dir, const std::string& name,
172 HTTP::Request_ptr updateDir(HTTPDirectory* dir, const std::string& hash,
175 std::string hashForPath(const SGPath& p);
176 void updatedFileContents(const SGPath& p, const std::string& newHash);
177 void parseHashCache();
178 std::string computeHashForPath(const SGPath& p);
179 void writeHashCache();
181 void failedToGetRootIndex(AbstractRepository::ResultCode st);
182 void failedToUpdateChild(const SGPath& relativePath,
183 AbstractRepository::ResultCode fileStatus);
185 typedef std::vector<RepoRequestPtr> RequestVector;
186 RequestVector queuedRequests,
189 void makeRequest(RepoRequestPtr req);
190 void finishedRequest(const RepoRequestPtr& req);
192 HTTPDirectory* getOrCreateDirectory(const std::string& path);
193 bool deleteDirectory(const std::string& path);
195 typedef std::vector<HTTPDirectory*> DirectoryVector;
196 DirectoryVector directories;
210 ChildInfo(Type ty, const char* nameData, const char* hashData) :
213 hash(hashData ? hashData : ""),
218 ChildInfo(const ChildInfo& other) :
222 sizeInBytes(other.sizeInBytes)
225 void setSize(const char* sizeData)
227 sizeInBytes = ::strtol(sizeData, NULL, 10);
230 bool operator<(const ChildInfo& other) const
232 return name < other.name;
236 std::string name, hash;
240 typedef std::vector<ChildInfo> ChildInfoList;
241 ChildInfoList children;
244 HTTPDirectory(HTTPRepoPrivate* repo, const std::string& path) :
250 SGPath p(absolutePath());
253 // already exists on disk
254 parseDirIndex(children);
255 std::sort(children.begin(), children.end());
256 } catch (sg_exception& ) {
257 // parsing cache failed
263 HTTPRepoPrivate* repository() const
268 std::string url() const
270 if (_relativePath.str().empty()) {
271 return _repository->baseUrl;
274 return _repository->baseUrl + "/" + _relativePath.str();
277 void dirIndexUpdated(const std::string& hash)
279 SGPath fpath(_relativePath);
280 fpath.append(".dirindex");
281 _repository->updatedFileContents(fpath, hash);
284 parseDirIndex(children);
285 std::sort(children.begin(), children.end());
288 void failedToUpdate(AbstractRepository::ResultCode status)
290 if (_relativePath.isNull()) {
292 _repository->failedToGetRootIndex(status);
294 _repository->failedToUpdateChild(_relativePath, status);
298 void updateChildrenBasedOnHash()
300 //SG_LOG(SG_TERRASYNC, SG_DEBUG, "updated children for:" << relativePath());
302 string_list indexNames = indexChildren(),
303 toBeUpdated, orphans;
304 simgear::Dir d(absolutePath());
305 PathList fsChildren = d.children(0);
306 PathList::const_iterator it = fsChildren.begin();
308 for (; it != fsChildren.end(); ++it) {
309 ChildInfo info(it->isDir() ? ChildInfo::DirectoryType : ChildInfo::FileType,
310 it->file().c_str(), NULL);
311 std::string hash = hashForChild(info);
313 ChildInfoList::iterator c = findIndexChild(it->file());
314 if (c == children.end()) {
315 orphans.push_back(it->file());
316 } else if (c->hash != hash) {
317 // file exists, but hash mismatch, schedule update
319 //SG_LOG(SG_TERRASYNC, SG_INFO, "file exists but hash is wrong for:" << c->name);
320 //SG_LOG(SG_TERRASYNC, SG_INFO, "on disk:" << hash << " vs in info:" << c->hash);
323 toBeUpdated.push_back(c->name);
325 // file exists and hash is valid. If it's a directory,
326 // perform a recursive check.
327 if (c->type == ChildInfo::DirectoryType) {
328 SGPath p(relativePath());
330 HTTPDirectory* childDir = _repository->getOrCreateDirectory(p.str());
331 childDir->updateChildrenBasedOnHash();
335 // remove existing file system children from the index list,
336 // so we can detect new children
337 string_list::iterator it = std::find(indexNames.begin(), indexNames.end(), c->name);
338 if (it != indexNames.end()) {
339 indexNames.erase(it);
341 } // of real children iteration
343 // all remaining names in indexChilden are new children
344 toBeUpdated.insert(toBeUpdated.end(), indexNames.begin(), indexNames.end());
346 removeOrphans(orphans);
347 scheduleUpdates(toBeUpdated);
350 void removeOrphans(const string_list& orphans)
352 string_list::const_iterator it;
353 for (it = orphans.begin(); it != orphans.end(); ++it) {
358 string_list indexChildren() const
361 r.reserve(children.size());
362 ChildInfoList::const_iterator it;
363 for (it=children.begin(); it != children.end(); ++it) {
364 r.push_back(it->name);
369 void scheduleUpdates(const string_list& names)
371 string_list::const_iterator it;
372 for (it = names.begin(); it != names.end(); ++it) {
373 ChildInfoList::iterator cit = findIndexChild(*it);
374 if (cit == children.end()) {
375 SG_LOG(SG_TERRASYNC, SG_WARN, "scheduleUpdate, unknown child:" << *it);
379 if (cit->type == ChildInfo::FileType) {
380 _repository->updateFile(this, *it, cit->sizeInBytes);
382 SGPath p(relativePath());
384 HTTPDirectory* childDir = _repository->getOrCreateDirectory(p.str());
385 _repository->updateDir(childDir, cit->hash, cit->sizeInBytes);
390 SGPath absolutePath() const
392 SGPath r(_repository->basePath);
393 r.append(_relativePath.str());
397 SGPath relativePath() const
399 return _relativePath;
402 void didUpdateFile(const std::string& file, const std::string& hash, size_t sz)
404 // check hash matches what we expected
405 ChildInfoList::iterator it = findIndexChild(file);
406 if (it == children.end()) {
407 SG_LOG(SG_TERRASYNC, SG_WARN, "updated file but not found in dir:" << _relativePath << " " << file);
409 SGPath fpath(_relativePath);
412 if (it->hash != hash) {
413 _repository->failedToUpdateChild(_relativePath, AbstractRepository::REPO_ERROR_CHECKSUM);
415 _repository->updatedFileContents(fpath, hash);
416 _repository->totalDownloaded += sz;
417 //SG_LOG(SG_TERRASYNC, SG_INFO, "did update:" << fpath);
419 } // of found in child list
422 void didFailToUpdateFile(const std::string& file,
423 AbstractRepository::ResultCode status)
425 SGPath fpath(_relativePath);
427 _repository->failedToUpdateChild(fpath, status);
433 ChildWithName(const std::string& n) : name(n) {}
436 bool operator()(const ChildInfo& info) const
437 { return info.name == name; }
440 ChildInfoList::iterator findIndexChild(const std::string& name)
442 return std::find_if(children.begin(), children.end(), ChildWithName(name));
445 bool parseDirIndex(ChildInfoList& children)
447 SGPath p(absolutePath());
448 p.append(".dirindex");
453 std::ifstream indexStream( p.c_str(), std::ios::in );
455 if ( !indexStream.is_open() ) {
456 throw sg_io_exception("cannot open dirIndex file", p);
459 char lineBuffer[512];
462 while (!indexStream.eof() ) {
463 indexStream.getline(lineBuffer, 512);
465 char* typeData = ::strtok_r(lineBuffer, ":", &lastToken);
467 continue; // skip blank line
472 throw sg_io_exception("Malformed dir index file", p);
475 if (!strcmp(typeData, "version")) {
477 } else if (!strcmp(typeData, "path")) {
481 char* nameData = ::strtok_r(NULL, ":", &lastToken);
482 char* hashData = ::strtok_r(NULL, ":", &lastToken);
483 char* sizeData = ::strtok_r(NULL, ":", &lastToken);
485 if (typeData[0] == 'f') {
486 children.push_back(ChildInfo(ChildInfo::FileType, nameData, hashData));
487 } else if (typeData[0] == 'd') {
488 children.push_back(ChildInfo(ChildInfo::DirectoryType, nameData, hashData));
490 throw sg_io_exception("Malformed line code in dir index file", p);
494 children.back().setSize(sizeData);
501 void removeChild(const std::string& name)
503 SGPath p(absolutePath());
507 SGPath fpath(_relativePath);
511 ok = _repository->deleteDirectory(fpath.str());
513 // remove the hash cache entry
514 _repository->updatedFileContents(fpath, std::string());
519 SG_LOG(SG_TERRASYNC, SG_WARN, "removal failed for:" << p);
520 throw sg_io_exception("Failed to remove existing file/dir:", p);
524 std::string hashForChild(const ChildInfo& child) const
526 SGPath p(absolutePath());
527 p.append(child.name);
528 if (child.type == ChildInfo::DirectoryType) {
529 p.append(".dirindex");
531 return _repository->hashForPath(p);
534 HTTPRepoPrivate* _repository;
535 SGPath _relativePath; // in URL and file-system space
540 HTTPRepository::HTTPRepository(const SGPath& base, HTTP::Client *cl) :
541 _d(new HTTPRepoPrivate(this))
545 _d->rootDir = new HTTPDirectory(_d.get(), "");
546 _d->parseHashCache();
549 HTTPRepository::~HTTPRepository()
553 void HTTPRepository::setBaseUrl(const std::string &url)
558 std::string HTTPRepository::baseUrl() const
563 HTTP::Client* HTTPRepository::http() const
568 SGPath HTTPRepository::fsBase() const
573 void HTTPRepository::update()
575 if (_d->isUpdating) {
579 _d->status = REPO_NO_ERROR;
580 _d->isUpdating = true;
581 _d->failures.clear();
582 _d->updateDir(_d->rootDir, std::string(), 0);
585 bool HTTPRepository::isDoingSync() const
587 if (_d->status != REPO_NO_ERROR) {
591 return _d->isUpdating;
594 size_t HTTPRepository::bytesToDownload() const
598 HTTPRepoPrivate::RequestVector::const_iterator r;
599 for (r = _d->queuedRequests.begin(); r != _d->queuedRequests.end(); ++r) {
600 result += (*r)->contentSize();
603 for (r = _d->activeRequests.begin(); r != _d->activeRequests.end(); ++r) {
604 result += (*r)->contentSize() - (*r)->responseBytesReceived();
610 size_t HTTPRepository::bytesDownloaded() const
612 size_t result = _d->totalDownloaded;
614 HTTPRepoPrivate::RequestVector::const_iterator r;
615 for (r = _d->activeRequests.begin(); r != _d->activeRequests.end(); ++r) {
616 result += (*r)->responseBytesReceived();
622 AbstractRepository::ResultCode
623 HTTPRepository::failure() const
625 if ((_d->status == REPO_NO_ERROR) && !_d->failures.empty()) {
626 return REPO_PARTIAL_UPDATE;
632 void HTTPRepoGetRequest::cancel()
634 _directory->repository()->http->cancelRequest(this, "Reposiotry cancelled");
638 class FileGetRequest : public HTTPRepoGetRequest
641 FileGetRequest(HTTPDirectory* d, const std::string& file) :
642 HTTPRepoGetRequest(d, makeUrl(d, file)),
645 pathInRepo = _directory->absolutePath();
646 pathInRepo.append(fileName);
647 //SG_LOG(SG_TERRASYNC, SG_INFO, "will GET file " << url());
651 virtual void gotBodyData(const char* s, int n)
654 file.reset(new SGFile(pathInRepo.str()));
655 if (!file->open(SG_IO_OUT)) {
656 SG_LOG(SG_TERRASYNC, SG_WARN, "unable to create file " << pathInRepo);
657 _directory->repository()->http->cancelRequest(this, "Unable to create output file");
660 sha1_init(&hashContext);
663 sha1_write(&hashContext, s, n);
667 virtual void onDone()
670 if (responseCode() == 200) {
671 std::string hash = strutils::encodeHex(sha1_result(&hashContext), HASH_LENGTH);
672 _directory->didUpdateFile(fileName, hash, contentSize());
673 //SG_LOG(SG_TERRASYNC, SG_INFO, "got file " << fileName << " in " << _directory->absolutePath());
674 } else if (responseCode() == 404) {
675 _directory->didFailToUpdateFile(fileName, AbstractRepository::REPO_ERROR_FILE_NOT_FOUND);
677 _directory->didFailToUpdateFile(fileName, AbstractRepository::REPO_ERROR_HTTP);
680 _directory->repository()->finishedRequest(this);
683 virtual void onFail()
686 if (pathInRepo.exists()) {
691 _directory->didFailToUpdateFile(fileName, AbstractRepository::REPO_ERROR_SOCKET);
692 _directory->repository()->finishedRequest(this);
696 static std::string makeUrl(HTTPDirectory* d, const std::string& file)
698 return d->url() + "/" + file;
701 std::string fileName; // if empty, we're getting the directory itself
703 simgear::sha1nfo hashContext;
704 std::auto_ptr<SGFile> file;
707 class DirGetRequest : public HTTPRepoGetRequest
710 DirGetRequest(HTTPDirectory* d, const std::string& targetHash) :
711 HTTPRepoGetRequest(d, makeUrl(d)),
713 _targetHash(targetHash)
715 sha1_init(&hashContext);
716 //SG_LOG(SG_TERRASYNC, SG_INFO, "will GET dir " << url());
724 bool isRootDir() const
730 virtual void gotBodyData(const char* s, int n)
732 body += std::string(s, n);
733 sha1_write(&hashContext, s, n);
736 virtual void onDone()
738 if (responseCode() == 200) {
739 std::string hash = strutils::encodeHex(sha1_result(&hashContext), HASH_LENGTH);
740 if (!_targetHash.empty() && (hash != _targetHash)) {
741 _directory->failedToUpdate(AbstractRepository::REPO_ERROR_CHECKSUM);
742 _directory->repository()->finishedRequest(this);
746 std::string curHash = _directory->repository()->hashForPath(path());
747 if (hash != curHash) {
748 simgear::Dir d(_directory->absolutePath());
750 if (!d.create(0700)) {
751 throw sg_io_exception("Unable to create directory", d.path());
755 // dir index data has changed, so write to disk and update
756 // the hash accordingly
757 std::ofstream of(pathInRepo().c_str(), std::ios::trunc | std::ios::out);
759 throw sg_io_exception("Failed to open directory index file for writing", pathInRepo().c_str());
762 of.write(body.data(), body.size());
764 _directory->dirIndexUpdated(hash);
766 //SG_LOG(SG_TERRASYNC, SG_INFO, "updated dir index " << _directory->absolutePath());
769 _directory->repository()->totalDownloaded += contentSize();
772 // either way we've confirmed the index is valid so update
776 _directory->updateChildrenBasedOnHash();
777 SG_LOG(SG_TERRASYNC, SG_INFO, "after update of:" << _directory->absolutePath() << " child update took:" << st.elapsedMSec());
778 } catch (sg_exception& ) {
779 _directory->failedToUpdate(AbstractRepository::REPO_ERROR_IO);
781 } else if (responseCode() == 404) {
782 _directory->failedToUpdate(AbstractRepository::REPO_ERROR_FILE_NOT_FOUND);
784 _directory->failedToUpdate(AbstractRepository::REPO_ERROR_HTTP);
787 _directory->repository()->finishedRequest(this);
790 virtual void onFail()
793 _directory->failedToUpdate(AbstractRepository::REPO_ERROR_SOCKET);
794 _directory->repository()->finishedRequest(this);
798 static std::string makeUrl(HTTPDirectory* d)
800 return d->url() + "/.dirindex";
803 SGPath pathInRepo() const
805 SGPath p(_directory->absolutePath());
806 p.append(".dirindex");
810 simgear::sha1nfo hashContext;
812 bool _isRootDir; ///< is this the repository root?
813 std::string _targetHash;
816 HTTPRepoPrivate::~HTTPRepoPrivate()
818 DirectoryVector::iterator it;
819 for (it=directories.begin(); it != directories.end(); ++it) {
823 RequestVector::iterator r;
824 for (r=activeRequests.begin(); r != activeRequests.end(); ++r) {
829 HTTP::Request_ptr HTTPRepoPrivate::updateFile(HTTPDirectory* dir, const std::string& name, size_t sz)
831 RepoRequestPtr r(new FileGetRequest(dir, name));
832 r->setContentSize(sz);
837 HTTP::Request_ptr HTTPRepoPrivate::updateDir(HTTPDirectory* dir, const std::string& hash, size_t sz)
839 RepoRequestPtr r(new DirGetRequest(dir, hash));
840 r->setContentSize(sz);
846 class HashEntryWithPath
849 HashEntryWithPath(const std::string& p) : path(p) {}
850 bool operator()(const HTTPRepoPrivate::HashCacheEntry& entry) const
851 { return entry.filePath == path; }
856 std::string HTTPRepoPrivate::hashForPath(const SGPath& p)
858 HashCache::iterator it = std::find_if(hashes.begin(), hashes.end(), HashEntryWithPath(p.str()));
859 if (it != hashes.end()) {
860 // ensure data on disk hasn't changed.
861 // we could also use the file type here if we were paranoid
862 if ((p.sizeInBytes() == it->lengthBytes) && (p.modTime() == it->modTime)) {
866 // entry in the cache, but it's stale so remove and fall through
870 std::string hash = computeHashForPath(p);
871 updatedFileContents(p, hash);
875 std::string HTTPRepoPrivate::computeHashForPath(const SGPath& p)
878 return std::string();
881 char* buf = static_cast<char*>(malloc(1024 * 1024));
884 if (!f.open(SG_IO_IN)) {
885 throw sg_io_exception("Couldn't open file for compute hash", p);
887 while ((readLen = f.read(buf, 1024 * 1024)) > 0) {
888 sha1_write(&info, buf, readLen);
893 std::string hashBytes((char*) sha1_result(&info), HASH_LENGTH);
894 return strutils::encodeHex(hashBytes);
897 void HTTPRepoPrivate::updatedFileContents(const SGPath& p, const std::string& newHash)
899 // remove the existing entry
900 HashCache::iterator it = std::find_if(hashes.begin(), hashes.end(), HashEntryWithPath(p.str()));
901 if (it != hashes.end()) {
903 hashCacheDirty = true;
906 if (newHash.empty()) {
907 return; // we're done
910 // use a cloned SGPath and reset its caching to force one stat() call
912 p2.set_cached(false);
915 HashCacheEntry entry;
916 entry.filePath = p.str();
917 entry.hashHex = newHash;
918 entry.modTime = p2.modTime();
919 entry.lengthBytes = p2.sizeInBytes();
920 hashes.push_back(entry);
922 hashCacheDirty = true;
925 void HTTPRepoPrivate::writeHashCache()
927 if (!hashCacheDirty) {
931 SGPath cachePath = basePath;
932 cachePath.append(".hashes");
934 std::ofstream stream(cachePath.c_str(),std::ios::out | std::ios::trunc);
935 HashCache::const_iterator it;
936 for (it = hashes.begin(); it != hashes.end(); ++it) {
937 stream << it->filePath << ":" << it->modTime << ":"
938 << it->lengthBytes << ":" << it->hashHex << "\n";
941 hashCacheDirty = false;
944 void HTTPRepoPrivate::parseHashCache()
947 SGPath cachePath = basePath;
948 cachePath.append(".hashes");
949 if (!cachePath.exists()) {
953 std::ifstream stream(cachePath.c_str(), std::ios::in);
957 while (!stream.eof()) {
958 stream.getline(buf, 2048);
960 char* nameData = ::strtok_r(buf, ":", &lastToken);
961 char* timeData = ::strtok_r(NULL, ":", &lastToken);
962 char* sizeData = ::strtok_r(NULL, ":", &lastToken);
963 char* hashData = ::strtok_r(NULL, ":", &lastToken);
964 if (!nameData || !timeData || !sizeData || !hashData) {
968 HashCacheEntry entry;
969 entry.filePath = nameData;
970 entry.hashHex = hashData;
971 entry.modTime = strtol(timeData, NULL, 10);
972 entry.lengthBytes = strtol(sizeData, NULL, 10);
973 hashes.push_back(entry);
977 class DirectoryWithPath
980 DirectoryWithPath(const std::string& p) : path(p) {}
981 bool operator()(const HTTPDirectory* entry) const
982 { return entry->relativePath().str() == path; }
987 HTTPDirectory* HTTPRepoPrivate::getOrCreateDirectory(const std::string& path)
989 DirectoryWithPath p(path);
990 DirectoryVector::iterator it = std::find_if(directories.begin(), directories.end(), p);
991 if (it != directories.end()) {
995 HTTPDirectory* d = new HTTPDirectory(this, path);
996 directories.push_back(d);
1000 bool HTTPRepoPrivate::deleteDirectory(const std::string& path)
1002 DirectoryWithPath p(path);
1003 DirectoryVector::iterator it = std::find_if(directories.begin(), directories.end(), p);
1004 if (it != directories.end()) {
1005 HTTPDirectory* d = *it;
1006 directories.erase(it);
1007 Dir dir(d->absolutePath());
1008 bool result = dir.remove(true);
1011 // update the hash cache too
1012 updatedFileContents(path, std::string());
1020 void HTTPRepoPrivate::makeRequest(RepoRequestPtr req)
1022 if (activeRequests.size() > 4) {
1023 queuedRequests.push_back(req);
1025 activeRequests.push_back(req);
1026 http->makeRequest(req);
1030 void HTTPRepoPrivate::finishedRequest(const RepoRequestPtr& req)
1032 RequestVector::iterator it = std::find(activeRequests.begin(), activeRequests.end(), req);
1033 if (it == activeRequests.end()) {
1034 throw sg_exception("lost request somehow", req->url());
1036 activeRequests.erase(it);
1038 if (!queuedRequests.empty()) {
1039 RepoRequestPtr rr = queuedRequests.front();
1040 queuedRequests.erase(queuedRequests.begin());
1041 activeRequests.push_back(rr);
1042 http->makeRequest(rr);
1047 if (activeRequests.empty() && queuedRequests.empty()) {
1052 void HTTPRepoPrivate::failedToGetRootIndex(AbstractRepository::ResultCode st)
1054 SG_LOG(SG_TERRASYNC, SG_WARN, "Failed to get root of repo:" << baseUrl);
1058 void HTTPRepoPrivate::failedToUpdateChild(const SGPath& relativePath,
1059 AbstractRepository::ResultCode fileStatus)
1062 f.path = relativePath;
1063 f.error = fileStatus;
1064 failures.push_back(f);
1066 SG_LOG(SG_TERRASYNC, SG_WARN, "failed to update entry:" << relativePath << " code:" << fileStatus);
1071 } // of namespace simgear