summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/bearer/icd/qnetworksession_impl.cpp6
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.cpp47
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.h1
3 files changed, 35 insertions, 19 deletions
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp
index 3170bf6..8013d30 100644
--- a/src/plugins/bearer/icd/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp
@@ -888,12 +888,12 @@ void QNetworkSessionPrivateImpl::close()
state = QNetworkSession::Closing;
emit stateChanged(state);
+ // we fake a disconnection, session error is sent
+ updateState(QNetworkSession::Disconnected);
+
opened = false;
isOpen = false;
- // we fake a disconnection, session error is not sent
- updateState(QNetworkSession::Disconnected);
-
icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT);
startTime = QDateTime();
} else {
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index 1de4c0f..32eb61a 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -102,15 +102,14 @@ QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl()
// Cancel possible RConnection::Start()
Cancel();
iSocketServ.Close();
-
- // Close global 'Open C' RConnection
- // Clears also possible unsetdefaultif() flags.
- setdefaultif(0);
-
+
+ // Restore default interface to system default
+ restoreDefaultIf();
+
iConnectionMonitor.Close();
iOpenCLibrary.Close();
#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
- qDebug() << "QNS this : " << QString::number((uint)this) << " - destroyed (and setdefaultif(0))";
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - destroyed (and restoreDefaultIf())";
#endif
}
@@ -523,16 +522,9 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
Cancel(); // closes iConnection
iSocketServ.Close();
-
- // Close global 'Open C' RConnection. If OpenC supports,
- // close the defaultif for good to avoid difficult timing
- // and bouncing issues of network going immediately back up
- // because of e.g. select() thread etc.
- if (iDynamicUnSetdefaultif) {
- iDynamicUnSetdefaultif();
- } else {
- setdefaultif(0);
- }
+
+ // Restore default interface to system default
+ restoreDefaultIf();
// If UserChoice, go down immediately. If some other configuration,
// go down immediately if there is no reports expected from the platform;
@@ -1457,6 +1449,29 @@ void QNetworkSessionPrivateImpl::handleSymbianConnectionStatusChange(TInt aConne
}
}
+void QNetworkSessionPrivateImpl::restoreDefaultIf()
+{
+ QNetworkConfigurationPrivatePointer config = engine->defaultConfiguration();
+
+ QMutexLocker locker(&config->mutex);
+
+ ifreq ifr;
+ memset(&ifr, 0, sizeof(ifreq));
+
+ switch (config->type) {
+ case QNetworkConfiguration::InternetAccessPoint:
+ strcpy(ifr.ifr_name, config->name.toUtf8().constData());
+ break;
+ case QNetworkConfiguration::ServiceNetwork:
+ ifr.ifr_ifru.snap_id = toSymbianConfig(config)->numericId;
+ break;
+ default:
+ ;
+ };
+
+ setdefaultif(&ifr);
+}
+
ConnectionProgressNotifier::ConnectionProgressNotifier(QNetworkSessionPrivateImpl& owner, RConnection& connection)
: CActive(CActive::EPriorityUserInput), iOwner(owner), iConnection(connection)
{
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h
index aac9321..1b0e968 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.h
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.h
@@ -143,6 +143,7 @@ private:
void handleSymbianConnectionStatusChange(TInt aConnectionStatus, TInt aError, TUint accessPointId = 0);
QNetworkConfiguration bestConfigFromSNAP(const QNetworkConfiguration& snapConfig) const;
QNetworkConfiguration activeConfiguration(TUint32 iapId = 0) const;
+ void restoreDefaultIf();
#ifndef QT_NO_NETWORKINTERFACE
QNetworkInterface interface(TUint iapId) const;
#endif