Skip to content

Commit

Permalink
Retry WMS/WMTS/XYZ requests only on timeout (fixes #15854)
Browse files Browse the repository at this point in the history
It does not really make sense to retry if server returns 404 Not Found or similar...
  • Loading branch information
wonder-sk committed Feb 26, 2017
1 parent a18066b commit 171dfe1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -3922,8 +3922,6 @@ void QgsWmsTiledImageDownloadHandler::tileReplyFinished()
{
QgsMessageLog::logMessage( tr( "Returned image is flawed [Content-Type:%1; URL: %2]" )
.arg( contentType, reply->url().toString() ), tr( "WMS" ) );

repeatTileRequest( reply->request() );
}
}
else
Expand All @@ -3948,7 +3946,9 @@ void QgsWmsTiledImageDownloadHandler::tileReplyFinished()
QgsWmsStatistics::Stat& stat = QgsWmsStatistics::statForUri( mProviderUri );
stat.errors++;

repeatTileRequest( reply->request() );
// if we reached timeout, let's try again (e.g. in case of slow connection or slow server)
if ( reply->error() == QNetworkReply::TimeoutError )
repeatTileRequest( reply->request() );
}
}

Expand Down

1 comment on commit 171dfe1

@nirvn
Copy link
Contributor

@nirvn nirvn commented on 171dfe1 Feb 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wonder-sk , good move.

Please sign in to comment.