mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 04:23:33 +02:00
remove random http failure
This commit is contained in:
parent
e89b6c5d2c
commit
7f1a87ac4f
1 changed files with 5 additions and 14 deletions
|
@ -72,22 +72,13 @@ void HTTPResourceRequest::onRequestFinished() {
|
||||||
Q_ASSERT(_reply);
|
Q_ASSERT(_reply);
|
||||||
|
|
||||||
cleanupTimer();
|
cleanupTimer();
|
||||||
|
|
||||||
switch(_reply->error()) {
|
switch(_reply->error()) {
|
||||||
case QNetworkReply::NoError:
|
case QNetworkReply::NoError:
|
||||||
{
|
_data = _reply->readAll();
|
||||||
// For debugging, have a random chance of treating this like a failure
|
_loadedFromCache = _reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool();
|
||||||
bool randFailure = false; // _url.toString().contains(".fst") ? (rand() % 100) > 10 : false;
|
_result = Success;
|
||||||
|
break;
|
||||||
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 << " ******************************";
|
|
||||||
}
|
|
||||||
|
|
||||||
case QNetworkReply::TimeoutError:
|
case QNetworkReply::TimeoutError:
|
||||||
_result = Timeout;
|
_result = Timeout;
|
||||||
|
|
Loading…
Reference in a new issue