Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use consistant default value of 60000ms for /qgis/networkAndProxy/net…
…workTimeout

Currently there's an inconsistancy between the Options dialog that displays a
default value of 60000ms for network request timeouts, whereas places in the
code use 20000ms. I propose to align on 60000s, since there are occurrences
of network requests, for example big WFS GetFeature requests, that can take
more than 20s to start.

(testqgswcspublicservers.cpp update added)

(cherry picked from commit 2f7d4a7)
  • Loading branch information
rouault authored and jef-n committed Mar 24, 2016
1 parent d364770 commit 9f125eb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/qgshttptransaction.cpp
Expand Up @@ -58,7 +58,7 @@ QgsHttpTransaction::QgsHttpTransaction( QString uri,
Q_UNUSED( userName );
Q_UNUSED( password );
QSettings s;
mNetworkTimeoutMsec = s.value( "/qgis/networkAndProxy/networkTimeout", "20000" ).toInt();
mNetworkTimeoutMsec = s.value( "/qgis/networkAndProxy/networkTimeout", "60000" ).toInt();
}

QgsHttpTransaction::QgsHttpTransaction()
Expand All @@ -69,7 +69,7 @@ QgsHttpTransaction::QgsHttpTransaction()
, mWatchdogTimer( NULL )
{
QSettings s;
mNetworkTimeoutMsec = s.value( "/qgis/networkAndProxy/networkTimeout", "20000" ).toInt();
mNetworkTimeoutMsec = s.value( "/qgis/networkAndProxy/networkTimeout", "60000" ).toInt();
}

QgsHttpTransaction::~QgsHttpTransaction()
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsnetworkaccessmanager.cpp
Expand Up @@ -162,7 +162,7 @@ QNetworkReply *QgsNetworkAccessManager::createRequest( QNetworkAccessManager::Op
QTimer *timer = new QTimer( reply );
connect( timer, SIGNAL( timeout() ), this, SLOT( abortRequest() ) );
timer->setSingleShot( true );
timer->start( s.value( "/qgis/networkAndProxy/networkTimeout", "20000" ).toInt() );
timer->start( s.value( "/qgis/networkAndProxy/networkTimeout", "60000" ).toInt() );

connect( reply, SIGNAL( downloadProgress( qint64, qint64 ) ), timer, SLOT( start() ) );
connect( reply, SIGNAL( uploadProgress( qint64, qint64 ) ), timer, SLOT( start() ) );
Expand Down
2 changes: 1 addition & 1 deletion tests/src/providers/testqgswcspublicservers.cpp
Expand Up @@ -78,7 +78,7 @@ void TestQgsWcsPublicServers::init()
// Unfortunately this seems to be the only way to set timeout, we try to reset it
// at the end but it can be canceled before ...
QSettings settings;
mOrigTimeout = settings.value( "/qgis/networkAndProxy/networkTimeout", "20000" ).toInt();
mOrigTimeout = settings.value( "/qgis/networkAndProxy/networkTimeout", "60000" ).toInt();
settings.setValue( "/qgis/networkAndProxy/networkTimeout", mTimeout );

//mCacheDir = QDir( "./wcstestcache" );
Expand Down

0 comments on commit 9f125eb

Please sign in to comment.