From 5f99bff82d3413803bcc652999f4f631058179d6 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 2 Sep 2010 05:19:12 +0000 Subject: * Added new networkstatus widget from SuSE * Fixed up the HTTP kioslave git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1170793 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kioslave/http/http.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'kioslave') diff --git a/kioslave/http/http.cc b/kioslave/http/http.cc index e28e482bf..4fa95780f 100644 --- a/kioslave/http/http.cc +++ b/kioslave/http/http.cc @@ -1804,9 +1804,11 @@ bool HTTPProtocol::isOffline(const KURL &url) TQByteArray reply; TQDataStream stream(params, IO_WriteOnly); - stream << url.url(); - if ( dcopClient()->call( "kded", "networkstatus", "status(TQString)", + if ( url.host() == TQString::fromLatin1("localhost") || url.host() == TQString::fromLatin1("127.0.0.1") || url.host() == TQString::fromLatin1("::") ) { + return false; + } + if ( dcopClient()->call( "kded", "networkstatus", "status()", params, replyType, reply ) && (replyType == "int") ) { int result; @@ -2210,6 +2212,11 @@ bool HTTPProtocol::httpOpen() // Conditional cache hit. (Validate) } + if (bCacheOnly && bOffline) + { + error( ERR_OFFLINE_MODE, m_request.url.url() ); + return false; + } if (bCacheOnly) { error( ERR_DOES_NOT_EXIST, m_request.url.url() ); @@ -2217,7 +2224,7 @@ bool HTTPProtocol::httpOpen() } if (bOffline) { - error( ERR_COULD_NOT_CONNECT, m_request.url.url() ); + error( ERR_OFFLINE_MODE, m_request.url.url() ); return false; } } -- cgit v1.2.1