Qt 4.8
Public Slots | Public Functions | Protected Slots | Protected Functions | Protected Variables | Properties | Friends | List of all members
QNetworkAccessBackend Class Referenceabstract

#include <qnetworkaccessbackend_p.h>

Inheritance diagram for QNetworkAccessBackend:
QObject QNetworkAccessCacheBackend QNetworkAccessFileBackend QNetworkAccessFtpBackend QNetworkAccessHttpBackend

Public Slots

void writeDownstreamData (QIODevice *data)
 
- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 

Public Functions

QVariant attribute (QNetworkRequest::Attribute code) const
 
virtual bool canResume () const
 
virtual void closeDownstreamChannel ()=0
 
virtual void copyFinished (QIODevice *)
 
virtual void downstreamReadyWrite ()
 
virtual void emitReadBufferFreed (qint64 size)
 
virtual QNetworkCacheMetaData fetchCacheMetaData (const QNetworkCacheMetaData &metaData) const
 
virtual void fetchSslConfiguration (QSslConfiguration &configuration) const
 
bool hasRawHeader (const QByteArray &headerName) const
 
QVariant header (QNetworkRequest::KnownHeaders header) const
 
virtual void ignoreSslErrors ()
 
virtual void ignoreSslErrors (const QList< QSslError > &errors)
 
bool isCachingEnabled () const
 
bool isSynchronous ()
 
virtual bool needsResetableUploadData ()
 
QAbstractNetworkCachenetworkCache () const
 
virtual void open ()=0
 
QNetworkAccessManager::Operation operation () const
 
virtual bool processRequestSynchronously ()
 
QList< QNetworkProxyproxyList () const
 
 QNetworkAccessBackend ()
 
QByteArray rawHeader (const QByteArray &headerName) const
 
QList< QByteArrayrawHeaderList () const
 
QNetworkRequest request () const
 
void setAttribute (QNetworkRequest::Attribute code, const QVariant &value)
 
void setCachingEnabled (bool enable)
 
virtual void setDownstreamLimited (bool b)
 
void setHeader (QNetworkRequest::KnownHeaders header, const QVariant &value)
 
void setRawHeader (const QByteArray &headerName, const QByteArray &value)
 
virtual void setReadBufferSize (qint64 size)
 
virtual void setResumeOffset (quint64 offset)
 
virtual void setSslConfiguration (const QSslConfiguration &configuration)
 
void setSynchronous (bool sync)
 
void setUrl (const QUrl &url)
 
virtual bool start ()
 Starts the backend. More...
 
QUrl url () const
 
virtual ~QNetworkAccessBackend ()
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Protected Slots

void authenticationRequired (QAuthenticator *auth)
 
void emitReplyUploadProgress (qint64 bytesSent, qint64 bytesTotal)
 
void error (QNetworkReply::NetworkError code, const QString &errorString)
 
void finished ()
 
void metaDataChanged ()
 
void proxyAuthenticationRequired (const QNetworkProxy &proxy, QAuthenticator *auth)
 
void redirectionRequested (const QUrl &destination)
 
void sslErrors (const QList< QSslError > &errors)
 

Protected Functions

QNonContiguousByteDevicecreateUploadByteDevice ()
 
char * getDownloadBuffer (qint64)
 
qint64 nextDownstreamBlockSize () const
 
void writeDownstreamData (QByteDataBuffer &list)
 
void writeDownstreamDataDownloadBuffer (qint64, qint64)
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 

Protected Variables

QNetworkAccessManagerPrivatemanager
 
QNetworkReplyImplPrivatereply
 
QSharedPointer< QNonContiguousByteDeviceuploadByteDevice
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 

Properties

bool synchronous
 

Friends

class QNetworkAccessManager
 
class QNetworkAccessManagerPrivate
 
class QNetworkReplyImplPrivate
 

Additional Inherited Members

- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 79 of file qnetworkaccessbackend_p.h.

Constructors and Destructors

◆ QNetworkAccessBackend()

QNetworkAccessBackend::QNetworkAccessBackend ( )

Definition at line 145 of file qnetworkaccessbackend.cpp.

146  : manager(0)
147  , reply(0)
148  , synchronous(false)
149 {
150 }
QNetworkAccessManagerPrivate * manager
QNetworkReplyImplPrivate * reply

◆ ~QNetworkAccessBackend()

QNetworkAccessBackend::~QNetworkAccessBackend ( )
virtual

Definition at line 152 of file qnetworkaccessbackend.cpp.

153 {
154 }

Functions

◆ attribute()

QVariant QNetworkAccessBackend::attribute ( QNetworkRequest::Attribute  code) const

Definition at line 300 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkAccessHttpBackend::postRequest().

301 {
302  return reply->q_func()->attribute(code);
303 }
QNetworkReplyImplPrivate * reply

◆ authenticationRequired

void QNetworkAccessBackend::authenticationRequired ( QAuthenticator auth)
protectedslot

Definition at line 340 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkAccessFtpBackend::ftpDone(), QNetworkAccessHttpBackend::httpAuthenticationRequired(), and QNetworkAccessHttpBackend::postRequest().

341 {
342  manager->authenticationRequired(this, authenticator);
343 }
QNetworkAccessManagerPrivate * manager
void authenticationRequired(QNetworkAccessBackend *backend, QAuthenticator *authenticator)

◆ canResume()

virtual bool QNetworkAccessBackend::canResume ( ) const
inlinevirtual

Reimplemented in QNetworkAccessHttpBackend.

Definition at line 168 of file qnetworkaccessbackend_p.h.

168 { return false; }

◆ closeDownstreamChannel()

virtual void QNetworkAccessBackend::closeDownstreamChannel ( )
pure virtual

◆ copyFinished()

void QNetworkAccessBackend::copyFinished ( QIODevice )
virtual

Reimplemented in QNetworkAccessHttpBackend.

Definition at line 179 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkReplyImplPrivate::handleNotifications().

180 {
181  // do nothing
182 }

◆ createUploadByteDevice()

QNonContiguousByteDevice * QNetworkAccessBackend::createUploadByteDevice ( )
protected

Definition at line 113 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkAccessFileBackend::open(), QNetworkAccessFtpBackend::open(), QNetworkAccessHttpBackend::postRequest(), and processRequestSynchronously().

114 {
117  else if (reply->outgoingData) {
119  } else {
120  return 0;
121  }
122 
123  bool bufferDisallowed =
125  QVariant(false)) == QVariant(true);
126  if (bufferDisallowed)
128 
129  // We want signal emissions only for normal asynchronous uploads
130  if (!isSynchronous())
132 
133  return uploadByteDevice.data();
134 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
QVariant attribute(Attribute code, const QVariant &defaultValue=QVariant()) const
Returns the attribute associated with the code code.
#define SLOT(a)
Definition: qobjectdefs.h:226
#define SIGNAL(a)
Definition: qobjectdefs.h:227
void disableReset()
Disable the reset() call, e.
QNetworkReplyImplPrivate * reply
void emitReplyUploadProgress(qint64 bytesSent, qint64 bytesTotal)
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
__int64 qint64
Definition: qglobal.h:942
QNetworkRequest request
T * data() const
Returns the value of the pointer referenced by this object.
QSharedPointer< QNonContiguousByteDevice > uploadByteDevice
QSharedPointer< QRingBuffer > outgoingDataBuffer
static QNonContiguousByteDevice * create(QIODevice *device)
Create a QNonContiguousByteDevice out of a QIODevice.

◆ downstreamReadyWrite()

void QNetworkAccessBackend::downstreamReadyWrite ( )
virtual

◆ emitReadBufferFreed()

void QNetworkAccessBackend::emitReadBufferFreed ( qint64  size)
virtual

Reimplemented in QNetworkAccessHttpBackend.

Definition at line 173 of file qnetworkaccessbackend.cpp.

174 {
175  Q_UNUSED(size);
176  // do nothing
177 }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ emitReplyUploadProgress

void QNetworkAccessBackend::emitReplyUploadProgress ( qint64  bytesSent,
qint64  bytesTotal 
)
protectedslot

Definition at line 138 of file qnetworkaccessbackend.cpp.

139 {
140  if (reply->isFinished)
141  return;
142  reply->emitUploadProgress(bytesSent, bytesTotal);
143 }
QNetworkReplyImplPrivate * reply
void emitUploadProgress(qint64 bytesSent, qint64 bytesTotal)

◆ error

void QNetworkAccessBackend::error ( QNetworkReply::NetworkError  code,
const QString errorString 
)
protectedslot

◆ fetchCacheMetaData()

QNetworkCacheMetaData QNetworkAccessBackend::fetchCacheMetaData ( const QNetworkCacheMetaData metaData) const
virtual

Reimplemented in QNetworkAccessHttpBackend.

Definition at line 205 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkReplyImplPrivate::initCacheSaveDevice().

206 {
207  return QNetworkCacheMetaData();
208 }
The QNetworkCacheMetaData class provides cache information.

◆ fetchSslConfiguration()

void QNetworkAccessBackend::fetchSslConfiguration ( QSslConfiguration configuration) const
virtual

Reimplemented in QNetworkAccessHttpBackend.

Definition at line 195 of file qnetworkaccessbackend.cpp.

196 {
197  // do nothing
198 }

◆ finished

void QNetworkAccessBackend::finished ( )
protectedslot

◆ getDownloadBuffer()

char * QNetworkAccessBackend::getDownloadBuffer ( qint64  size)
protected

Definition at line 265 of file qnetworkaccessbackend.cpp.

Referenced by processRequestSynchronously().

266 {
267  return reply->getDownloadBuffer(size);
268 }
QNetworkReplyImplPrivate * reply
char * getDownloadBuffer(qint64 size)

◆ hasRawHeader()

bool QNetworkAccessBackend::hasRawHeader ( const QByteArray headerName) const

Definition at line 280 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkAccessHttpBackend::canResume(), and QNetworkAccessHttpBackend::loadFromCacheIfAllowed().

281 {
282  return reply->q_func()->hasRawHeader(headerName);
283 }
QNetworkReplyImplPrivate * reply

◆ header()

QVariant QNetworkAccessBackend::header ( QNetworkRequest::KnownHeaders  header) const

◆ ignoreSslErrors() [1/2]

void QNetworkAccessBackend::ignoreSslErrors ( )
virtual

Reimplemented in QNetworkAccessHttpBackend.

Definition at line 184 of file qnetworkaccessbackend.cpp.

185 {
186  // do nothing
187 }

◆ ignoreSslErrors() [2/2]

void QNetworkAccessBackend::ignoreSslErrors ( const QList< QSslError > &  errors)
virtual

Reimplemented in QNetworkAccessHttpBackend.

Definition at line 189 of file qnetworkaccessbackend.cpp.

190 {
191  Q_UNUSED(errors);
192  // do nothing
193 }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ isCachingEnabled()

bool QNetworkAccessBackend::isCachingEnabled ( ) const

Definition at line 239 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkAccessHttpBackend::replyDownloadMetaData().

240 {
241  return reply->isCachingEnabled();
242 }
QNetworkReplyImplPrivate * reply

◆ isSynchronous()

bool QNetworkAccessBackend::isSynchronous ( )
inline

◆ metaDataChanged

void QNetworkAccessBackend::metaDataChanged ( )
protectedslot

◆ needsResetableUploadData()

virtual bool QNetworkAccessBackend::needsResetableUploadData ( )
inlinevirtual

Reimplemented in QNetworkAccessHttpBackend.

Definition at line 165 of file qnetworkaccessbackend_p.h.

Referenced by QNetworkReplyImplPrivate::setup().

165 { return false; }

◆ networkCache()

QAbstractNetworkCache * QNetworkAccessBackend::networkCache ( ) const

◆ nextDownstreamBlockSize()

qint64 QNetworkAccessBackend::nextDownstreamBlockSize ( ) const
protected

Definition at line 244 of file qnetworkaccessbackend.cpp.

Referenced by processRequestSynchronously(), and QNetworkAccessFileBackend::readMoreFromFile().

245 {
246  return reply->nextDownstreamBlockSize();
247 }
qint64 nextDownstreamBlockSize() const
QNetworkReplyImplPrivate * reply

◆ open()

virtual void QNetworkAccessBackend::open ( )
pure virtual

◆ operation()

QNetworkAccessManager::Operation QNetworkAccessBackend::operation ( ) const

◆ processRequestSynchronously()

virtual bool QNetworkAccessBackend::processRequestSynchronously ( )
inlinevirtual

Definition at line 171 of file qnetworkaccessbackend_p.h.

171 { return false; }

◆ proxyAuthenticationRequired

void QNetworkAccessBackend::proxyAuthenticationRequired ( const QNetworkProxy proxy,
QAuthenticator auth 
)
protectedslot

Definition at line 333 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkAccessHttpBackend::postRequest().

335 {
336  manager->proxyAuthenticationRequired(this, proxy, authenticator);
337 }
void proxyAuthenticationRequired(QNetworkAccessBackend *backend, const QNetworkProxy &proxy, QAuthenticator *authenticator)
QNetworkAccessManagerPrivate * manager

◆ proxyList()

QList< QNetworkProxy > QNetworkAccessBackend::proxyList ( ) const

Definition at line 221 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkAccessFtpBackend::open(), and QNetworkAccessHttpBackend::postRequest().

222 {
223  return reply->proxyList;
224 }
QList< QNetworkProxy > proxyList
QNetworkReplyImplPrivate * reply

◆ rawHeader()

QByteArray QNetworkAccessBackend::rawHeader ( const QByteArray headerName) const

◆ rawHeaderList()

QList< QByteArray > QNetworkAccessBackend::rawHeaderList ( ) const

Definition at line 290 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkAccessHttpBackend::fetchCacheMetaData(), and QNetworkAccessHttpBackend::loadFromCacheIfAllowed().

291 {
292  return reply->q_func()->rawHeaderList();
293 }
QNetworkReplyImplPrivate * reply

◆ redirectionRequested

void QNetworkAccessBackend::redirectionRequested ( const QUrl destination)
protectedslot

Definition at line 350 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkAccessHttpBackend::checkForRedirect(), and QNetworkAccessCacheBackend::sendCacheContents().

351 {
352  reply->redirectionRequested(target);
353 }
void redirectionRequested(const QUrl &target)
QNetworkReplyImplPrivate * reply

◆ request()

QNetworkRequest QNetworkAccessBackend::request ( ) const

◆ setAttribute()

void QNetworkAccessBackend::setAttribute ( QNetworkRequest::Attribute  code,
const QVariant value 
)

Definition at line 305 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkAccessCacheBackend::open(), QNetworkAccessHttpBackend::postRequest(), QNetworkAccessHttpBackend::replyDownloadMetaData(), QNetworkAccessCacheBackend::sendCacheContents(), and QNetworkAccessHttpBackend::sendCacheContents().

306 {
307  if (value.isValid())
308  reply->attributes.insert(code, value);
309  else
310  reply->attributes.remove(code);
311 }
int remove(const Key &key)
Removes all the items that have the key from the hash.
Definition: qhash.h:784
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
QNetworkReplyImplPrivate * reply
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
Definition: qvariant.h:485

◆ setCachingEnabled()

void QNetworkAccessBackend::setCachingEnabled ( bool  enable)

◆ setDownstreamLimited()

void QNetworkAccessBackend::setDownstreamLimited ( bool  b)
virtual

Reimplemented in QNetworkAccessHttpBackend.

Definition at line 161 of file qnetworkaccessbackend.cpp.

162 {
163  Q_UNUSED(b);
164  // do nothing
165 }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ setHeader()

void QNetworkAccessBackend::setHeader ( QNetworkRequest::KnownHeaders  header,
const QVariant value 
)

Definition at line 275 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkAccessFtpBackend::ftpRawCommandReply(), and QNetworkAccessFileBackend::loadFileInfo().

276 {
277  reply->setCookedHeader(header, value);
278 }
QVariant header(QNetworkRequest::KnownHeaders header) const
QNetworkReplyImplPrivate * reply
void setCookedHeader(QNetworkRequest::KnownHeaders header, const QVariant &value)

◆ setRawHeader()

void QNetworkAccessBackend::setRawHeader ( const QByteArray headerName,
const QByteArray value 
)

Definition at line 295 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkAccessHttpBackend::replyDownloadMetaData(), QNetworkAccessCacheBackend::sendCacheContents(), and QNetworkAccessHttpBackend::sendCacheContents().

296 {
297  reply->setRawHeader(headerName, headerValue);
298 }
void setRawHeader(const QByteArray &key, const QByteArray &value)
QNetworkReplyImplPrivate * reply
static QByteArray headerValue(QNetworkRequest::KnownHeaders header, const QVariant &value)

◆ setReadBufferSize()

void QNetworkAccessBackend::setReadBufferSize ( qint64  size)
virtual

Reimplemented in QNetworkAccessHttpBackend.

Definition at line 167 of file qnetworkaccessbackend.cpp.

168 {
169  Q_UNUSED(size);
170  // do nothing
171 }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ setResumeOffset()

virtual void QNetworkAccessBackend::setResumeOffset ( quint64  offset)
inlinevirtual

Reimplemented in QNetworkAccessHttpBackend.

Definition at line 169 of file qnetworkaccessbackend_p.h.

169 { Q_UNUSED(offset); }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ setSslConfiguration()

void QNetworkAccessBackend::setSslConfiguration ( const QSslConfiguration configuration)
virtual

Reimplemented in QNetworkAccessHttpBackend.

Definition at line 200 of file qnetworkaccessbackend.cpp.

201 {
202  // do nothing
203 }

◆ setSynchronous()

void QNetworkAccessBackend::setSynchronous ( bool  sync)
inline

Definition at line 160 of file qnetworkaccessbackend_p.h.

Referenced by QNetworkReplyImplPrivate::setup().

◆ setUrl()

void QNetworkAccessBackend::setUrl ( const QUrl url)

◆ sslErrors

void QNetworkAccessBackend::sslErrors ( const QList< QSslError > &  errors)
protectedslot

Definition at line 355 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkAccessHttpBackend::postRequest(), and QNetworkAccessHttpBackend::replySslErrors().

356 {
357 #ifndef QT_NO_OPENSSL
358  reply->sslErrors(errors);
359 #else
360  Q_UNUSED(errors);
361 #endif
362 }
QNetworkReplyImplPrivate * reply
void sslErrors(const QList< QSslError > &errors)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ start()

bool QNetworkAccessBackend::start ( )
virtual

Starts the backend.

Returns true if the backend is started. Returns false if the backend could not be started due to an unopened or roaming session. The caller should recall this function once the session has been opened or the roaming process has finished.

Definition at line 369 of file qnetworkaccessbackend.cpp.

Referenced by QNetworkReplyImplPrivate::_q_startOperation().

370 {
371 #ifndef QT_NO_BEARERMANAGEMENT
372  // For bearer, check if session start is required
374  if (networkSession) {
375  // session required
376  if (networkSession->isOpen() &&
377  networkSession->state() == QNetworkSession::Connected) {
378  // Session is already open and ready to use.
379  // copy network session down to the backend
380  setProperty("_q_networksession", QVariant::fromValue(networkSession));
381  } else {
382  // Session not ready, but can skip for loopback connections
383 
384  // This is not ideal.
385  const QString host = reply->url.host();
386 
387  if (host == QLatin1String("localhost") ||
390  // Don't need an open session for localhost access.
391  } else {
392  // need to wait for session to be opened
393  return false;
394  }
395  }
396  }
397 #endif
398 
399 #ifndef QT_NO_NETWORKPROXY
400 #ifndef QT_NO_BEARERMANAGEMENT
401  // Get the proxy settings from the network session (in the case of service networks,
402  // the proxy settings change depending which AP was activated)
403  QNetworkSession *session = networkSession.data();
404  QNetworkConfiguration config;
405  if (session) {
406  QNetworkConfigurationManager configManager;
407  // The active configuration tells us what IAP is in use
408  QVariant v = session->sessionProperty(QLatin1String("ActiveConfiguration"));
409  if (v.isValid())
410  config = configManager.configurationFromIdentifier(qvariant_cast<QString>(v));
411  // Fallback to using the configuration if no active configuration
412  if (!config.isValid())
413  config = session->configuration();
414  // or unspecified configuration if that is no good either
415  if (!config.isValid())
416  config = QNetworkConfiguration();
417  }
419 #else // QT_NO_BEARERMANAGEMENT
420  // Without bearer management, the proxy depends only on the url
422 #endif
423 #endif
424 
425  // now start the request
426  open();
427  return true;
428 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
QVariant sessionProperty(const QString &key) const
Returns the value for property key.
bool setProperty(const char *name, const QVariant &value)
Sets the value of the object&#39;s name property to value.
Definition: qobject.cpp:3755
QList< QNetworkProxy > proxyList
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QNetworkConfigurationManager class manages the network configurations provided by the system...
The QString class provides a Unicode character string.
Definition: qstring.h:83
QString host() const
Returns the host of the URL if it is defined; otherwise an empty string is returned.
Definition: qurl.cpp:4837
QSharedPointer< QNetworkSession > getNetworkSession() const
QNetworkAccessManagerPrivate * manager
QNetworkConfiguration configuration() const
Returns the QNetworkConfiguration that this network session object is based on.
bool isValid() const
Returns true if this QNetworkConfiguration object is valid.
The QNetworkConfiguration class provides an abstraction of one or more access point configurations...
QNetworkReplyImplPrivate * reply
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336
The QNetworkProxyQuery class is used to query the proxy settings for a socket.
Definition: qnetworkproxy.h:60
The QNetworkSession class provides control over the system&#39;s access points and enables session manage...
QNetworkConfiguration configurationFromIdentifier(const QString &identifier) const
Returns the QNetworkConfiguration for identifier; otherwise returns an invalid QNetworkConfiguration...
The QHostAddress class provides an IP address.
Definition: qhostaddress.h:70
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
Definition: qvariant.h:485
QList< QNetworkProxy > queryProxy(const QNetworkProxyQuery &query)
virtual void open()=0

◆ url()

QUrl QNetworkAccessBackend::url ( ) const

◆ writeDownstreamData() [1/2]

void QNetworkAccessBackend::writeDownstreamData ( QByteDataBuffer list)
protected

◆ writeDownstreamData [2/2]

void QNetworkAccessBackend::writeDownstreamData ( QIODevice data)
slot

Definition at line 254 of file qnetworkaccessbackend.cpp.

255 {
257 }
void appendDownstreamData(QByteDataBuffer &data)
QNetworkReplyImplPrivate * reply

◆ writeDownstreamDataDownloadBuffer()

void QNetworkAccessBackend::writeDownstreamDataDownloadBuffer ( qint64  bytesReceived,
qint64  bytesTotal 
)
protected

Definition at line 260 of file qnetworkaccessbackend.cpp.

Referenced by processRequestSynchronously(), and QNetworkAccessHttpBackend::replyDownloadProgressSlot().

261 {
262  reply->appendDownstreamDataDownloadBuffer(bytesReceived, bytesTotal);
263 }
void appendDownstreamDataDownloadBuffer(qint64, qint64)
QNetworkReplyImplPrivate * reply

Friends and Related Functions

◆ QNetworkAccessManager

Definition at line 211 of file qnetworkaccessbackend_p.h.

◆ QNetworkAccessManagerPrivate

Definition at line 212 of file qnetworkaccessbackend_p.h.

◆ QNetworkReplyImplPrivate

Definition at line 213 of file qnetworkaccessbackend_p.h.

Properties

◆ manager

QNetworkAccessManagerPrivate* QNetworkAccessBackend::manager
protected

◆ reply

QNetworkReplyImplPrivate* QNetworkAccessBackend::reply
protected

◆ synchronous

bool QNetworkAccessBackend::synchronous
private

Definition at line 215 of file qnetworkaccessbackend_p.h.

Referenced by isSynchronous(), and setSynchronous().

◆ uploadByteDevice

QSharedPointer<QNonContiguousByteDevice> QNetworkAccessBackend::uploadByteDevice
protected

The documentation for this class was generated from the following files: