Skip to content
Permalink
Browse files

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.

(cherry picked from commit f387291)

(testqgswcspublicservers.cpp update added)
  • Loading branch information
rouault authored and jef-n committed Mar 24, 2016
1 parent 363050d commit 2f7d4a788cdf93122ac704fca8333ea3adbd1103
@@ -11068,7 +11068,7 @@ void QgisApp::namSslErrors( QNetworkReply *reply, const QList<QSslError> &errors
{
QgsDebugMsg( "Restarting network reply timeout" );
timer->setSingleShot( true );
timer->start( s.value( "/qgis/networkAndProxy/networkTimeout", "20000" ).toInt() );
timer->start( s.value( "/qgis/networkAndProxy/networkTimeout", "60000" ).toInt() );
}
}
}
@@ -58,7 +58,7 @@ QgsHttpTransaction::QgsHttpTransaction( const 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()
@@ -69,7 +69,7 @@ QgsHttpTransaction::QgsHttpTransaction()
, mWatchdogTimer( nullptr )
{
QSettings s;
mNetworkTimeoutMsec = s.value( "/qgis/networkAndProxy/networkTimeout", "20000" ).toInt();
mNetworkTimeoutMsec = s.value( "/qgis/networkAndProxy/networkTimeout", "60000" ).toInt();
}

QgsHttpTransaction::~QgsHttpTransaction()
@@ -217,7 +217,7 @@ QNetworkReply *QgsNetworkAccessManager::createRequest( QNetworkAccessManager::Op
timer->setObjectName( "timeoutTimer" );
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() ) );
@@ -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" );

1 comment on commit 2f7d4a7

@pka

This comment has been minimized.

Copy link
Member

@pka pka commented on 2f7d4a7 Mar 24, 2016

60s is a big pain if you're working with (sometimes failing) webservices. Default value should be much lower, but there seem to be buggy timeouts at least on startup.

Please sign in to comment.
You can’t perform that action at this time.