| |   |
| 880 | 880 | return new QDisabledNetworkReply(this, req, op); |
| 881 | 881 | } |
| 882 | 882 | |
| #ifdef QT_QNAM_DEFAULT_NETWORK_SESSION |
| 883 | 884 | if (!d->networkSession && (d->initializeSession || !d->networkConfiguration.isEmpty())) { |
| 884 | 885 | QNetworkConfigurationManager manager; |
| 885 | 886 | if (d->networkConfiguration.isEmpty()) |
| 886 | 887 | d->createSession(manager.defaultConfiguration()); |
| 887 | 888 | else |
| 888 | 889 | d->createSession(manager.configurationFromIdentifier(d->networkConfiguration)); |
| } else if (d->networkSession) { |
| d->networkSession->setSessionProperty(QLatin1String("AutoCloseSessionTimeout"), -1); |
| 891 | 890 | } |
| #endif |
| 892 | 892 | |
| if (d->networkSession) |
| d->networkSession->setSessionProperty(QLatin1String("AutoCloseSessionTimeout"), -1); |
|
| 893 | 896 | QNetworkRequest request = req; |
| 894 | 897 | if (!request.header(QNetworkRequest::ContentLengthHeader).isValid() && |
| 895 | 898 | outgoingData && !outgoingData->isSequential()) { |
| … | … | |
| 1208 | 1208 | { |
| 1209 | 1209 | Q_Q(QNetworkAccessManager); |
| 1210 | 1210 | |
| #ifdef QT_QNAM_DEFAULT_NETWORK_SESSION |
| 1211 | 1212 | initializeSession = false; |
| #endif |
| 1212 | 1214 | |
| 1213 | 1215 | if (networkSession) |
| 1214 | 1216 | delete networkSession; |
| … | … | |
| 1234 | 1234 | |
| 1235 | 1235 | void QNetworkAccessManagerPrivate::_q_networkSessionClosed() |
| 1236 | 1236 | { |
| networkConfiguration = networkSession->configuration().identifier(); |
| if (networkSession) { |
| networkConfiguration = networkSession->configuration().identifier(); |
| 1238 | 1239 | |
| delete networkSession; |
| networkSession = 0; |
| networkSession->deleteLater(); |
| networkSession = 0; |
| } |
| 1241 | 1243 | } |
| 1242 | 1244 | |
| 1243 | 1245 | void QNetworkAccessManagerPrivate::_q_networkSessionNewConfigurationActivated() |
| 1244 | 1246 | { |
| 1245 | 1247 | Q_Q(QNetworkAccessManager); |
| 1246 | 1248 | |
| networkSession->accept(); |
| if (networkSession) { |
| networkSession->accept(); |
| 1248 | 1251 | |
| emit q->networkSessionOnline(); |
| emit q->networkSessionOnline(); |
| } |
| 1250 | 1254 | } |
| 1251 | 1255 | |
| 1252 | 1256 | void QNetworkAccessManagerPrivate::_q_networkSessionPreferredConfigurationChanged(const QNetworkConfiguration &, bool) |
| 1253 | 1257 | { |
| networkSession->migrate(); |
| if (networkSession) |
| networkSession->migrate(); |
| 1255 | 1260 | } |
| 1256 | 1261 | |
| 1257 | 1262 | QT_END_NAMESPACE |