From 87590cafb20b96f3825e649a402a8b459d050f26 Mon Sep 17 00:00:00 2001 From: James Turner Date: Fri, 19 Aug 2016 18:13:31 +0100 Subject: [PATCH] Fix terrasync behaviour when net is down. --- simgear/io/HTTPRepository.cxx | 3 +-- simgear/scene/tsync/terrasync.cxx | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/simgear/io/HTTPRepository.cxx b/simgear/io/HTTPRepository.cxx index d36117be..e6bf3be4 100644 --- a/simgear/io/HTTPRepository.cxx +++ b/simgear/io/HTTPRepository.cxx @@ -1239,7 +1239,7 @@ HTTPRepository::failure() const void HTTPRepoPrivate::failedToGetRootIndex(HTTPRepository::ResultCode st) { - SG_LOG(SG_TERRASYNC, SG_WARN, "Failed to get root of repo:" << baseUrl); + SG_LOG(SG_TERRASYNC, SG_WARN, "Failed to get root of repo:" << baseUrl << " " << st); status = st; } @@ -1288,7 +1288,6 @@ HTTPRepository::failure() const // maybe there was nothing to do if (activeRequests.empty()) { - status = HTTPRepository::REPO_NO_ERROR; isUpdating = false; } } diff --git a/simgear/scene/tsync/terrasync.cxx b/simgear/scene/tsync/terrasync.cxx index 521fb5a6..3c6b32c5 100644 --- a/simgear/scene/tsync/terrasync.cxx +++ b/simgear/scene/tsync/terrasync.cxx @@ -496,6 +496,13 @@ void SGTerraSync::WorkerThread::run() } } + if (_httpServer.empty()) { + SG_LOG(SG_TERRASYNC, SG_ALERT, "ERROR: no http-server found, terrasync will be disabled"); + SGGuard g(_stateLock); + _running = false; + return; + } + runInternal(); {