From 7f1a87ac4ff3019fc8cfabe1e0b0ff2f94f96c6b Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Thu, 20 Apr 2017 17:31:20 -0700 Subject: [PATCH] remove random http failure --- .../networking/src/HTTPResourceRequest.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/libraries/networking/src/HTTPResourceRequest.cpp b/libraries/networking/src/HTTPResourceRequest.cpp index e43545f38e..3249f40b0e 100644 --- a/libraries/networking/src/HTTPResourceRequest.cpp +++ b/libraries/networking/src/HTTPResourceRequest.cpp @@ -72,22 +72,13 @@ void HTTPResourceRequest::onRequestFinished() { Q_ASSERT(_reply); cleanupTimer(); - + switch(_reply->error()) { case QNetworkReply::NoError: - { - // For debugging, have a random chance of treating this like a failure - bool randFailure = false; // _url.toString().contains(".fst") ? (rand() % 100) > 10 : false; - - if (!randFailure) { - _data = _reply->readAll(); - _loadedFromCache = _reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(); - _result = Success; - break; - } - // else fall through to timeout - qDebug() << "**** Randomly pretending to timeout instead of successfully download HTTP resource:" << _url << " ******************************"; - } + _data = _reply->readAll(); + _loadedFromCache = _reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(); + _result = Success; + break; case QNetworkReply::TimeoutError: _result = Timeout;