Skip to content

Commit 2f7d4a7

Browse files
rouaultjef-n
authored andcommittedMar 24, 2016
Use consistant default value of 60000ms for /qgis/networkAndProxy/networkTimeout
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. (cherry picked from commit f387291) (testqgswcspublicservers.cpp update added)
1 parent 363050d commit 2f7d4a7

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11068,7 +11068,7 @@ void QgisApp::namSslErrors( QNetworkReply *reply, const QList<QSslError> &errors
1106811068
{
1106911069
QgsDebugMsg( "Restarting network reply timeout" );
1107011070
timer->setSingleShot( true );
11071-
timer->start( s.value( "/qgis/networkAndProxy/networkTimeout", "20000" ).toInt() );
11071+
timer->start( s.value( "/qgis/networkAndProxy/networkTimeout", "60000" ).toInt() );
1107211072
}
1107311073
}
1107411074
}

‎src/core/qgshttptransaction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ QgsHttpTransaction::QgsHttpTransaction( const QString& uri,
5858
Q_UNUSED( userName );
5959
Q_UNUSED( password );
6060
QSettings s;
61-
mNetworkTimeoutMsec = s.value( "/qgis/networkAndProxy/networkTimeout", "20000" ).toInt();
61+
mNetworkTimeoutMsec = s.value( "/qgis/networkAndProxy/networkTimeout", "60000" ).toInt();
6262
}
6363

6464
QgsHttpTransaction::QgsHttpTransaction()
@@ -69,7 +69,7 @@ QgsHttpTransaction::QgsHttpTransaction()
6969
, mWatchdogTimer( nullptr )
7070
{
7171
QSettings s;
72-
mNetworkTimeoutMsec = s.value( "/qgis/networkAndProxy/networkTimeout", "20000" ).toInt();
72+
mNetworkTimeoutMsec = s.value( "/qgis/networkAndProxy/networkTimeout", "60000" ).toInt();
7373
}
7474

7575
QgsHttpTransaction::~QgsHttpTransaction()

‎src/core/qgsnetworkaccessmanager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ QNetworkReply *QgsNetworkAccessManager::createRequest( QNetworkAccessManager::Op
217217
timer->setObjectName( "timeoutTimer" );
218218
connect( timer, SIGNAL( timeout() ), this, SLOT( abortRequest() ) );
219219
timer->setSingleShot( true );
220-
timer->start( s.value( "/qgis/networkAndProxy/networkTimeout", "20000" ).toInt() );
220+
timer->start( s.value( "/qgis/networkAndProxy/networkTimeout", "60000" ).toInt() );
221221

222222
connect( reply, SIGNAL( downloadProgress( qint64, qint64 ) ), timer, SLOT( start() ) );
223223
connect( reply, SIGNAL( uploadProgress( qint64, qint64 ) ), timer, SLOT( start() ) );

‎tests/src/providers/testqgswcspublicservers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void TestQgsWcsPublicServers::init()
7878
// Unfortunately this seems to be the only way to set timeout, we try to reset it
7979
// at the end but it can be canceled before ...
8080
QSettings settings;
81-
mOrigTimeout = settings.value( "/qgis/networkAndProxy/networkTimeout", "20000" ).toInt();
81+
mOrigTimeout = settings.value( "/qgis/networkAndProxy/networkTimeout", "60000" ).toInt();
8282
settings.setValue( "/qgis/networkAndProxy/networkTimeout", mTimeout );
8383

8484
//mCacheDir = QDir( "./wcstestcache" );

0 commit comments

Comments
 (0)
Failed to load comments.