summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkaccessbackend_p.h
diff options
context:
space:
mode:
authorPeter Hartmann <peter.hartmann@nokia.com>2010-11-17 18:33:22 +0100
committerPeter Hartmann <peter.hartmann@nokia.com>2010-11-23 15:54:33 +0100
commitad1e82323225e996720136e8b2d669166b8d8441 (patch)
tree754b92c1de65167a78cbe3dc183e009812f8af9f /src/network/access/qnetworkaccessbackend_p.h
parentb1c412cefa51f0eea79dbf279f2a23414ccecc3d (diff)
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/qnetworkaccessbackend_p.h')
-rw-r--r--src/network/access/qnetworkaccessbackend_p.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/network/access/qnetworkaccessbackend_p.h b/src/network/access/qnetworkaccessbackend_p.h
index 7faa5cb68f..c9ec37e0bf 100644
--- a/src/network/access/qnetworkaccessbackend_p.h
+++ b/src/network/access/qnetworkaccessbackend_p.h
@@ -157,6 +157,9 @@ public:
QVariant attribute(QNetworkRequest::Attribute code) const;
void setAttribute(QNetworkRequest::Attribute code, const QVariant &value);
+ bool isSynchronous() { return synchronous; }
+ void setSynchronous(bool sync) { synchronous = sync; }
+
// return true if the QNonContiguousByteDevice of the upload
// data needs to support reset(). Currently needed for HTTP.
// This will possibly enable buffering of the upload data.
@@ -166,6 +169,8 @@ public:
virtual bool canResume() const { return false; }
virtual void setResumeOffset(quint64 offset) { Q_UNUSED(offset); }
+ virtual bool processRequestSynchronously() { return false; }
+
protected:
// Create the device used for reading the upload data
QNonContiguousByteDevice* createUploadByteDevice();
@@ -200,6 +205,7 @@ private:
friend class QNetworkReplyImplPrivate;
QNetworkAccessManagerPrivate *manager;
QNetworkReplyImplPrivate *reply;
+ bool synchronous;
};
class QNetworkAccessBackendFactory