From d46446044fd7c5aca86c63cacad2706718d457c5 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 13 Jan 2012 15:20:46 +0200 Subject: symbian - fix lockup when a network session is opened from its error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When QNetworkAccessManager::get is called from the slot connected to QNetworkAccessManager::finished, this is equivalent to calling QNetworkSession::open from the slot connected to QNetworkSession::error. Close handles before emitting the error signal, instead of afterwards. Otherwise the session start would be silently cancelled in the above situation. Task-number: ou1cimx1#960395 Change-Id: I48cb376722e0169721fd33614a0b9280c17bdd62 Reviewed-by: Murray Read Reviewed-by: Pasi Pentikäinen --- src/plugins/bearer/symbian/qnetworksession_impl.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp index 2145145..9f6d08d 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp +++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp @@ -450,8 +450,8 @@ void QNetworkSessionPrivateImpl::open() isOpen = false; isOpening = false; iError = QNetworkSession::UnknownSessionError; - emit QNetworkSessionPrivate::error(iError); closeHandles(); + emit QNetworkSessionPrivate::error(iError); syncStateWithInterface(); } } @@ -723,8 +723,8 @@ void QNetworkSessionPrivateImpl::Error(TInt aError) activeConfig = QNetworkConfiguration(); serviceConfig = QNetworkConfiguration(); iError = QNetworkSession::RoamingError; - emit QNetworkSessionPrivate::error(iError); closeHandles(); + emit QNetworkSessionPrivate::error(iError); QT_TRY { syncStateWithInterface(); // In some cases IAP is still in Connected state when @@ -1076,8 +1076,8 @@ void QNetworkSessionPrivateImpl::ConnectionStartComplete(TInt statusCode) isOpen = false; isOpening = false; iError = QNetworkSession::UnknownSessionError; - QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError)); closeHandles(); + QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError)); if (!newActiveConfig.isValid()) { // No valid configuration, bail out. // Status updates from QNCM won't be received correctly @@ -1125,8 +1125,8 @@ void QNetworkSessionPrivateImpl::ConnectionStartComplete(TInt statusCode) activeConfig = QNetworkConfiguration(); serviceConfig = QNetworkConfiguration(); iError = QNetworkSession::InvalidConfigurationError; - QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError)); closeHandles(); + QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError)); QT_TRYCATCH_LEAVING(syncStateWithInterface()); break; case KErrCancel: // Connection attempt cancelled @@ -1144,8 +1144,8 @@ void QNetworkSessionPrivateImpl::ConnectionStartComplete(TInt statusCode) } else { iError = QNetworkSession::UnknownSessionError; } - QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError)); closeHandles(); + QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError)); QT_TRYCATCH_LEAVING(syncStateWithInterface()); break; } @@ -1226,8 +1226,8 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint activeConfig = QNetworkConfiguration(); serviceConfig = QNetworkConfiguration(); iError = QNetworkSession::SessionAbortedError; - emit QNetworkSessionPrivate::error(iError); closeHandles(); + emit QNetworkSessionPrivate::error(iError); // Start handling IAP state change signals from QNetworkConfigurationManagerPrivate iHandleStateNotificationsFromManager = true; emitSessionClosed = true; // Emit SessionClosed after state change has been reported -- cgit v0.12