remove random http failure

This commit is contained in:
ZappoMan 2017-04-20 17:31:20 -07:00
parent e89b6c5d2c
commit 7f1a87ac4f

View file

@ -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;