Skip to content
Permalink
Browse files

[ogr provider] disable connection timeouts (fixes #19625 et cie)

  • Loading branch information
nirvn committed Aug 15, 2018
1 parent 21f9430 commit dd86dfe6099239f6ececf7c7ffb42dbe46c1052c
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/providers/ogr/qgsogrfeatureiterator.cpp
@@ -45,6 +45,8 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource *source, bool
, mFilterFidsIt( mFilterFids.constBegin() )
, mSharedDS( source->mSharedDS )
{
// Since connection timeout for OGR connections is problematic and can lead to crashes, disable for now.
mRequest.setConnectionTimeout( -1 );
if ( mSharedDS )
{
mOgrLayer = mSharedDS->createSQLResultLayer( mSource->mEncoding, mSource->mLayerName, mSource->mLayerIndex );
@@ -56,7 +58,7 @@ QgsOgrFeatureIterator::QgsOgrFeatureIterator( QgsOgrFeatureSource *source, bool
else
{
//QgsDebugMsg( "Feature iterator of " + mSource->mLayerName + ": acquiring connection");
mConn = QgsOgrConnPool::instance()->acquireConnection( QgsOgrProviderUtils::connectionPoolId( mSource->mDataSource ), request.connectionTimeout(), request.requestMayBeNested() );
mConn = QgsOgrConnPool::instance()->acquireConnection( QgsOgrProviderUtils::connectionPoolId( mSource->mDataSource ), mRequest.connectionTimeout(), mRequest.requestMayBeNested() );
if ( !mConn || !mConn->ds )
{
return;

0 comments on commit dd86dfe

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