From 0f42b7a16b6b09772c365c41f99d0d92b8a8e27d Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Fri, 13 Jun 2014 08:39:07 +1200 Subject: [logging] improve logging/messages where network isn't available. fixes #15290, #15291 --- xbmc/filesystem/DirectoryFactory.cpp | 5 +++-- xbmc/utils/RssReader.cpp | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xbmc/filesystem/DirectoryFactory.cpp b/xbmc/filesystem/DirectoryFactory.cpp index 3f56c7d809..e0761c9e55 100644 --- a/xbmc/filesystem/DirectoryFactory.cpp +++ b/xbmc/filesystem/DirectoryFactory.cpp @@ -186,7 +186,8 @@ IDirectory* CDirectoryFactory::Create(const CURL& url) if (strProtocol == "androidapp") return new CAndroidAppDirectory(); #endif - if( g_application.getNetwork().IsAvailable(true) ) // true to wait for the network (if possible) + bool networkAvailable = g_application.getNetwork().IsAvailable(true); // true to wait for the network (if possible) + if (networkAvailable) { if (strProtocol == "tuxbox") return new CTuxBoxDirectory(); if (strProtocol == "ftp" || strProtocol == "ftps") return new CFTPDirectory(); @@ -244,7 +245,7 @@ IDirectory* CDirectoryFactory::Create(const CURL& url) #endif } - CLog::Log(LOGWARNING, "%s - Unsupported protocol(%s) in %s", __FUNCTION__, strProtocol.c_str(), url.Get().c_str() ); + CLog::Log(LOGWARNING, "%s - %sunsupported protocol(%s) in %s", __FUNCTION__, networkAvailable ? "" : "Network down or ", strProtocol.c_str(), url.GetRedacted().c_str() ); return NULL; } diff --git a/xbmc/utils/RssReader.cpp b/xbmc/utils/RssReader.cpp index 12bbeb5e39..e9a2f6f50e 100644 --- a/xbmc/utils/RssReader.cpp +++ b/xbmc/utils/RssReader.cpp @@ -147,7 +147,10 @@ void CRssReader::Process() // we wait for the network to come up if ((url.GetProtocol() == "http" || url.GetProtocol() == "https") && !g_application.getNetwork().IsAvailable(true)) + { + CLog::Log(LOGWARNING, "RSS: No network connection"); strXML = ""+g_localizeStrings.Get(15301)+""; + } else { XbmcThreads::EndTime timeout(15000); -- cgit v1.2.3