diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/network/access/qnetworkaccessmanager.cpp | 10 | ||||
-rw-r--r-- | src/network/access/qnetworkaccessmanager_p.h | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 69b57e5..ea60f98 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -386,9 +386,6 @@ QNetworkAccessManager::QNetworkAccessManager(QObject *parent) : QObject(*new QNetworkAccessManagerPrivate, parent) { ensureInitialized(); - - QNetworkConfigurationManager manager; - d_func()->createSession(manager.defaultConfiguration()); } /*! @@ -847,6 +844,13 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera return new QDisabledNetworkReply(this, req, op); } + if (d->initializeSession && !d->networkSession) { + QNetworkConfigurationManager manager; + d->createSession(manager.defaultConfiguration()); + + d->initializeSession = false; + } + QNetworkRequest request = req; if (!request.header(QNetworkRequest::ContentLengthHeader).isValid() && outgoingData && !outgoingData->isSequential()) { diff --git a/src/network/access/qnetworkaccessmanager_p.h b/src/network/access/qnetworkaccessmanager_p.h index 8a1f19d..8d772f0 100644 --- a/src/network/access/qnetworkaccessmanager_p.h +++ b/src/network/access/qnetworkaccessmanager_p.h @@ -77,6 +77,7 @@ public: #endif networkSession(0), networkAccessEnabled(true), + initializeSession(true), cookieJarCreated(false) { } ~QNetworkAccessManagerPrivate(); @@ -121,6 +122,7 @@ public: QNetworkSession *networkSession; bool networkAccessEnabled; + bool initializeSession; bool cookieJarCreated; |