diff options
author | Peter Hartmann <peter.hartmann@nokia.com> | 2010-11-17 17:33:22 (GMT) |
---|---|---|
committer | Peter Hartmann <peter.hartmann@nokia.com> | 2010-11-23 14:54:33 (GMT) |
commit | ad1e82323225e996720136e8b2d669166b8d8441 (patch) | |
tree | 754b92c1de65167a78cbe3dc183e009812f8af9f /src/network/access/qhttpnetworkconnection.cpp | |
parent | b1c412cefa51f0eea79dbf279f2a23414ccecc3d (diff) | |
download | Qt-ad1e82323225e996720136e8b2d669166b8d8441.zip Qt-ad1e82323225e996720136e8b2d669166b8d8441.tar.gz Qt-ad1e82323225e996720136e8b2d669166b8d8441.tar.bz2 |
QNetworkAccessManager: enable synchronous HTTP calls
To enable synchronous calls, an attribute in the QNetworkRequest has
to be set. If set, when QNetworkAccessManager::get() (and post(),
put()) returns, the reply is finished and all data has been read in
case of success.
This feature is semi-public for now (usable, but not documented).
To enable this, an attribute in the QNetworkRequest must be set. If
this attribute is set, we open a new connection to the server with
only one channel and call the channels' sockets' waitFor* methods.
Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network/access/qhttpnetworkconnection.cpp')
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 4d27531..0531595 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -327,8 +327,6 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket Q_ASSERT(socket); Q_ASSERT(reply); - Q_Q(QHttpNetworkConnection); - resend = false; //create the response header to be used with QAuthenticatorPrivate. QList<QPair<QByteArray, QByteArray> > fields = reply->header(); @@ -854,12 +852,17 @@ QHttpNetworkReply* QHttpNetworkConnection::sendRequest(const QHttpNetworkRequest return d->queueRequest(request); } -bool QHttpNetworkConnection::isEncrypted() const +bool QHttpNetworkConnection::isSsl() const { Q_D(const QHttpNetworkConnection); return d->encrypt; } +QHttpNetworkConnectionChannel *QHttpNetworkConnection::channels() const +{ + return d_func()->channels; +} + #ifndef QT_NO_NETWORKPROXY void QHttpNetworkConnection::setCacheProxy(const QNetworkProxy &networkProxy) { |