Skip to content

Commit

Permalink
[qtbase] Improved online state handling. Contributes to JB#34613
Browse files Browse the repository at this point in the history
Particularly, it handles the following scenario:

1. Session state changes from Connected to Connecting
   (that could be another bug but why not?)
2. _q_networkSessionStateChanged switches online to false
3. Session state changes to Disconnected, online is already false
4. online state stays false even though another configuration
   gets connected.

With this change, when one session becomes Disconnected, a new
session is created and online state becomes true as it should.
  • Loading branch information
monich authored and denexter committed Jun 5, 2018
1 parent 7d0ff0e commit 8969865
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/network/access/qnetworkaccessmanager.cpp
Expand Up @@ -1845,8 +1845,7 @@ void QNetworkAccessManagerPrivate::_q_networkSessionStateChanged(QNetworkSession
emit q->networkSessionConnected();
lastSessionState = state;

if (online && (state == QNetworkSession::Disconnected
|| state == QNetworkSession::NotAvailable)) {
if (state == QNetworkSession::Disconnected || state == QNetworkSession::NotAvailable) {
const auto cfgs = networkConfigurationManager.allConfigurations();
for (const QNetworkConfiguration &cfg : cfgs) {
if (cfg.state().testFlag(QNetworkConfiguration::Active)) {
Expand Down

0 comments on commit 8969865

Please sign in to comment.