mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +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);
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue