Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QHttpNetworkConnectionPrivate Class Reference

#include <qhttpnetworkconnection_p.h>

+ Inheritance diagram for QHttpNetworkConnectionPrivate:
+ Collaboration diagram for QHttpNetworkConnectionPrivate:

Classes

struct  ParseRedirectResult
 

Public Types

enum  ConnectionState { RunningState = 0 , PausedState = 1 }
 
enum  NetworkLayerPreferenceState {
  Unknown , HostLookupPending , IPv4 , IPv6 ,
  IPv4or6
}
 
enum  { ChunkSize = 4096 }
 
- Public Types inherited from QObjectPrivate
typedef void(*) StaticMetaCallFunction(QObject *, QMetaObject::Call, int, void **)
 
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>
 

Public Member Functions

 QHttpNetworkConnectionPrivate (quint16 connectionCount, const QString &hostName, quint16 port, bool encrypt, bool isLocalSocket, QHttpNetworkConnection::ConnectionType type)
 
 ~QHttpNetworkConnectionPrivate ()
 
void init ()
 
void pauseConnection ()
 
void resumeConnection ()
 
int indexOf (QIODevice *socket) const
 
QHttpNetworkReplyqueueRequest (const QHttpNetworkRequest &request)
 
void requeueRequest (const HttpMessagePair &pair)
 
void fillHttp2Queue ()
 
bool dequeueRequest (QIODevice *socket)
 
void prepareRequest (HttpMessagePair &request)
 
void updateChannel (int i, const HttpMessagePair &messagePair)
 
QHttpNetworkRequest predictNextRequest () const
 
QHttpNetworkReplypredictNextRequestsReply () const
 
void fillPipeline (QIODevice *socket)
 
bool fillPipeline (QList< HttpMessagePair > &queue, QHttpNetworkConnectionChannel &channel)
 
void readMoreLater (QHttpNetworkReply *reply)
 
void copyCredentials (int fromChannel, QAuthenticator *auth, bool isProxy)
 
void startHostInfoLookup ()
 
void startNetworkLayerStateLookup ()
 
void networkLayerDetected (QAbstractSocket::NetworkLayerProtocol protocol)
 
void _q_startNextRequest ()
 
void _q_hostLookupFinished (const QHostInfo &info)
 
void _q_connectDelayedChannel ()
 
void createAuthorization (QIODevice *socket, QHttpNetworkRequest &request)
 
QString errorDetail (QNetworkReply::NetworkError errorCode, QIODevice *socket, const QString &extraDetail=QString())
 
void removeReply (QHttpNetworkReply *reply)
 
bool shouldEmitChannelError (QIODevice *socket)
 
qint64 uncompressedBytesAvailable (const QHttpNetworkReply &reply) const
 
qint64 uncompressedBytesAvailableNextBlock (const QHttpNetworkReply &reply) const
 
void emitReplyError (QIODevice *socket, QHttpNetworkReply *reply, QNetworkReply::NetworkError errorCode)
 
bool handleAuthenticateChallenge (QIODevice *socket, QHttpNetworkReply *reply, bool isProxy, bool &resend)
 
QUrl parseRedirectResponse (QIODevice *socket, QHttpNetworkReply *reply)
 
void emitProxyAuthenticationRequired (const QHttpNetworkConnectionChannel *chan, const QNetworkProxy &proxy, QAuthenticator *auth)
 
- Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void checkForIncompatibleLibraryVersion (int version) const
 
void setParent_helper (QObject *)
 
void moveToThread_helper ()
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
 
QObjectList receiverList (const char *signal) const
 
void ensureConnectionData ()
 
void addConnection (int signal, Connection *c)
 
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
 
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
 
bool maybeSignalConnected (uint signalIndex) const
 
bool isDeclarativeSignalConnected (uint signalIdx) const
 
void connectNotify (const QMetaMethod &signal)
 
void disconnectNotify (const QMetaMethod &signal)
 
void reinitBindingStorageAfterThreadMove ()
 
virtual std::string flagsForDumping () const
 
virtual void writeToDebugStream (QDebug &) const
 
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
 
- Public Member Functions inherited from QObjectData
 QObjectData ()=default
 
virtual ~QObjectData ()=0
 
QMetaObjectdynamicMetaObject () const
 

Static Public Member Functions

static ParseRedirectResult parseRedirectResponse (QHttpNetworkReply *reply)
 
- Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
 
static QObjectPrivateget (QObject *o)
 
static const QObjectPrivateget (const QObject *o)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
 
static QMetaObject::Connection connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static bool disconnect (const QObject *sender, int signal_index, void **slot)
 
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot)
 

Public Attributes

ConnectionState state = RunningState
 
NetworkLayerPreferenceState networkLayerState = Unknown
 
QString hostName
 
quint16 port
 
bool encrypt
 
bool isLocalSocket
 
bool delayIpv4 = true
 
int activeChannelCount
 
const int channelCount
 
QTimer delayedConnectionTimer
 
QHttpNetworkConnectionChannel *const channels
 
QNetworkProxy networkProxy
 
QList< HttpMessagePairhighPriorityQueue
 
QList< HttpMessagePairlowPriorityQueue
 
int preConnectRequests = 0
 
QHttpNetworkConnection::ConnectionType connectionType
 
std::shared_ptr< QSslContextsslContext
 
QHttp2Configuration http2Parameters
 
QString peerVerifyName
 
QNetworkConnectionMonitor connectionMonitor
 
- Public Attributes inherited from QObjectPrivate
ExtraDataextraData
 
QAtomicPointer< QThreadDatathreadData
 
QAtomicPointer< ConnectionDataconnections
 
union { 
 
   QObject *   currentChildBeingDeleted 
 
   QAbstractDeclarativeData *   declarativeData 
 
};  
 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
 
- Public Attributes inherited from QObjectData
QObjectq_ptr
 
QObjectparent
 
QObjectList children
 
uint isWidget: 1
 
uint blockSig: 1
 
uint wasDeleted: 1
 
uint isDeletingChildren: 1
 
uint sendChildEvents: 1
 
uint receiveChildEvents: 1
 
uint isWindow: 1
 
uint deleteLaterCalled: 1
 
uint isQuickItem: 1
 
uint willBeWidget: 1
 
uint wasWidget: 1
 
uint receiveParentEvents: 1
 
uint unused: 20
 
QAtomicInt postedEvents
 
QDynamicMetaObjectDatametaObject
 
QBindingStorage bindingStorage
 

Static Public Attributes

static constexpr int defaultHttpChannelCount = 6
 
static const int defaultPipelineLength = 3
 
static const int defaultRePipelineLength = 2
 

Friends

class QHttpNetworkConnectionChannel
 

Detailed Description

Definition at line 137 of file qhttpnetworkconnection_p.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ChunkSize 

Definition at line 171 of file qhttpnetworkconnection_p.h.

◆ ConnectionState

Enumerator
RunningState 
PausedState 

Definition at line 147 of file qhttpnetworkconnection_p.h.

◆ NetworkLayerPreferenceState

Enumerator
Unknown 
HostLookupPending 
IPv4 
IPv6 
IPv4or6 

Definition at line 152 of file qhttpnetworkconnection_p.h.

Constructor & Destructor Documentation

◆ QHttpNetworkConnectionPrivate()

QHttpNetworkConnectionPrivate::QHttpNetworkConnectionPrivate ( quint16 connectionCount,
const QString & hostName,
quint16 port,
bool encrypt,
bool isLocalSocket,
QHttpNetworkConnection::ConnectionType type )

Definition at line 53 of file qhttpnetworkconnection.cpp.

References QHttpNetworkConnectionPrivate(), activeChannelCount, channelCount, encrypt, IPv4, isLocalSocket, and networkLayerState.

Referenced by QHttpNetworkConnectionPrivate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~QHttpNetworkConnectionPrivate()

QHttpNetworkConnectionPrivate::~QHttpNetworkConnectionPrivate ( )

Definition at line 78 of file qhttpnetworkconnection.cpp.

References channelCount.

Member Function Documentation

◆ _q_connectDelayedChannel()

void QHttpNetworkConnectionPrivate::_q_connectDelayedChannel ( )

Definition at line 1354 of file qhttpnetworkconnection.cpp.

◆ _q_hostLookupFinished()

void QHttpNetworkConnectionPrivate::_q_hostLookupFinished ( const QHostInfo & info)

Definition at line 1251 of file qhttpnetworkconnection.cpp.

References IPv4, IPv4or6, IPv6, networkLayerState, startNetworkLayerStateLookup(), and Unknown.

Referenced by startHostInfoLookup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _q_startNextRequest()

void QHttpNetworkConnectionPrivate::_q_startNextRequest ( )

Definition at line 1036 of file qhttpnetworkconnection.cpp.

References activeChannelCount, HostLookupPending, IPv4or6, networkLayerState, PausedState, preConnectRequests, state, and Unknown.

Referenced by queueRequest().

+ Here is the caller graph for this function:

◆ copyCredentials()

void QHttpNetworkConnectionPrivate::copyCredentials ( int fromChannel,
QAuthenticator * auth,
bool isProxy )

Definition at line 375 of file qhttpnetworkconnection.cpp.

References activeChannelCount.

◆ createAuthorization()

void QHttpNetworkConnectionPrivate::createAuthorization ( QIODevice * socket,
QHttpNetworkRequest & request )

◆ dequeueRequest()

bool QHttpNetworkConnectionPrivate::dequeueRequest ( QIODevice * socket)

Definition at line 713 of file qhttpnetworkconnection.cpp.

References prepareRequest(), and updateChannel().

+ Here is the call graph for this function:

◆ emitProxyAuthenticationRequired()

void QHttpNetworkConnectionPrivate::emitProxyAuthenticationRequired ( const QHttpNetworkConnectionChannel * chan,
const QNetworkProxy & proxy,
QAuthenticator * auth )

Definition at line 1577 of file qhttpnetworkconnection.cpp.

References pauseConnection(), QHttpNetworkConnectionChannel::reply, and resumeConnection().

+ Here is the call graph for this function:

◆ emitReplyError()

void QHttpNetworkConnectionPrivate::emitReplyError ( QIODevice * socket,
QHttpNetworkReply * reply,
QNetworkReply::NetworkError errorCode )

Definition at line 344 of file qhttpnetworkconnection.cpp.

◆ errorDetail()

QString QHttpNetworkConnectionPrivate::errorDetail ( QNetworkReply::NetworkError errorCode,
QIODevice * socket,
const QString & extraDetail = QString() )

Definition at line 889 of file qhttpnetworkconnection.cpp.

◆ fillHttp2Queue()

void QHttpNetworkConnectionPrivate::fillHttp2Queue ( )

Definition at line 676 of file qhttpnetworkconnection.cpp.

◆ fillPipeline() [1/2]

void QHttpNetworkConnectionPrivate::fillPipeline ( QIODevice * socket)

Definition at line 767 of file qhttpnetworkconnection.cpp.

◆ fillPipeline() [2/2]

bool QHttpNetworkConnectionPrivate::fillPipeline ( QList< HttpMessagePair > & queue,
QHttpNetworkConnectionChannel & channel )

Definition at line 850 of file qhttpnetworkconnection.cpp.

References QHttpNetworkConnectionChannel::pipelineInto(), and prepareRequest().

+ Here is the call graph for this function:

◆ handleAuthenticateChallenge()

bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge ( QIODevice * socket,
QHttpNetworkReply * reply,
bool isProxy,
bool & resend )

Definition at line 409 of file qhttpnetworkconnection.cpp.

References pauseConnection(), and resumeConnection().

+ Here is the call graph for this function:

◆ indexOf()

int QHttpNetworkConnectionPrivate::indexOf ( QIODevice * socket) const

Definition at line 155 of file qhttpnetworkconnection.cpp.

References activeChannelCount.

◆ init()

void QHttpNetworkConnectionPrivate::init ( )

Definition at line 90 of file qhttpnetworkconnection.cpp.

References channelCount.

◆ networkLayerDetected()

void QHttpNetworkConnectionPrivate::networkLayerDetected ( QAbstractSocket::NetworkLayerProtocol protocol)

Definition at line 1345 of file qhttpnetworkconnection.cpp.

References activeChannelCount.

◆ parseRedirectResponse() [1/2]

QHttpNetworkConnectionPrivate::ParseRedirectResult QHttpNetworkConnectionPrivate::parseRedirectResponse ( QHttpNetworkReply * reply)
static

Definition at line 523 of file qhttpnetworkconnection.cpp.

Referenced by parseRedirectResponse().

+ Here is the caller graph for this function:

◆ parseRedirectResponse() [2/2]

QUrl QHttpNetworkConnectionPrivate::parseRedirectResponse ( QIODevice * socket,
QHttpNetworkReply * reply )

Definition at line 511 of file qhttpnetworkconnection.cpp.

References parseRedirectResponse().

+ Here is the call graph for this function:

◆ pauseConnection()

void QHttpNetworkConnectionPrivate::pauseConnection ( )

Definition at line 102 of file qhttpnetworkconnection.cpp.

References activeChannelCount, encrypt, PausedState, and state.

Referenced by emitProxyAuthenticationRequired(), and handleAuthenticateChallenge().

+ Here is the caller graph for this function:

◆ predictNextRequest()

QHttpNetworkRequest QHttpNetworkConnectionPrivate::predictNextRequest ( ) const

Definition at line 748 of file qhttpnetworkconnection.cpp.

◆ predictNextRequestsReply()

QHttpNetworkReply * QHttpNetworkConnectionPrivate::predictNextRequestsReply ( ) const

Definition at line 757 of file qhttpnetworkconnection.cpp.

◆ prepareRequest()

void QHttpNetworkConnectionPrivate::prepareRequest ( HttpMessagePair & request)

Definition at line 238 of file qhttpnetworkconnection.cpp.

References isLocalSocket.

Referenced by dequeueRequest(), fillPipeline(), and queueRequest().

+ Here is the caller graph for this function:

◆ queueRequest()

QHttpNetworkReply * QHttpNetworkConnectionPrivate::queueRequest ( const QHttpNetworkRequest & request)

Definition at line 624 of file qhttpnetworkconnection.cpp.

References _q_startNextRequest(), HostLookupPending, IPv4, IPv6, networkLayerState, preConnectRequests, prepareRequest(), startHostInfoLookup(), and Unknown.

+ Here is the call graph for this function:

◆ readMoreLater()

void QHttpNetworkConnectionPrivate::readMoreLater ( QHttpNetworkReply * reply)

Definition at line 1194 of file qhttpnetworkconnection.cpp.

References activeChannelCount.

◆ removeReply()

void QHttpNetworkConnectionPrivate::removeReply ( QHttpNetworkReply * reply)

Definition at line 940 of file qhttpnetworkconnection.cpp.

References activeChannelCount.

◆ requeueRequest()

void QHttpNetworkConnectionPrivate::requeueRequest ( const HttpMessagePair & pair)

Definition at line 695 of file qhttpnetworkconnection.cpp.

◆ resumeConnection()

void QHttpNetworkConnectionPrivate::resumeConnection ( )

Definition at line 126 of file qhttpnetworkconnection.cpp.

References activeChannelCount, encrypt, RunningState, and state.

Referenced by emitProxyAuthenticationRequired(), and handleAuthenticateChallenge().

+ Here is the caller graph for this function:

◆ shouldEmitChannelError()

bool QHttpNetworkConnectionPrivate::shouldEmitChannelError ( QIODevice * socket)

◆ startHostInfoLookup()

void QHttpNetworkConnectionPrivate::startHostInfoLookup ( )

Definition at line 1211 of file qhttpnetworkconnection.cpp.

References _q_hostLookupFinished(), HostLookupPending, IPv4, IPv6, and networkLayerState.

Referenced by queueRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ startNetworkLayerStateLookup()

void QHttpNetworkConnectionPrivate::startNetworkLayerStateLookup ( )

Definition at line 1320 of file qhttpnetworkconnection.cpp.

References activeChannelCount, IPv4or6, and networkLayerState.

Referenced by _q_hostLookupFinished().

+ Here is the caller graph for this function:

◆ uncompressedBytesAvailable()

qint64 QHttpNetworkConnectionPrivate::uncompressedBytesAvailable ( const QHttpNetworkReply & reply) const

Definition at line 217 of file qhttpnetworkconnection.cpp.

◆ uncompressedBytesAvailableNextBlock()

qint64 QHttpNetworkConnectionPrivate::uncompressedBytesAvailableNextBlock ( const QHttpNetworkReply & reply) const

Definition at line 222 of file qhttpnetworkconnection.cpp.

◆ updateChannel()

void QHttpNetworkConnectionPrivate::updateChannel ( int i,
const HttpMessagePair & messagePair )

Definition at line 739 of file qhttpnetworkconnection.cpp.

Referenced by dequeueRequest().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QHttpNetworkConnectionChannel

friend class QHttpNetworkConnectionChannel
friend

Definition at line 266 of file qhttpnetworkconnection_p.h.

Member Data Documentation

◆ activeChannelCount

◆ channelCount

const int QHttpNetworkConnectionPrivate::channelCount

◆ channels

QHttpNetworkConnectionChannel* const QHttpNetworkConnectionPrivate::channels

Definition at line 220 of file qhttpnetworkconnection_p.h.

◆ connectionMonitor

QNetworkConnectionMonitor QHttpNetworkConnectionPrivate::connectionMonitor

Definition at line 264 of file qhttpnetworkconnection_p.h.

◆ connectionType

QHttpNetworkConnection::ConnectionType QHttpNetworkConnectionPrivate::connectionType

Definition at line 248 of file qhttpnetworkconnection_p.h.

◆ defaultHttpChannelCount

int QHttpNetworkConnectionPrivate::defaultHttpChannelCount = 6
staticconstexpr

Definition at line 143 of file qhttpnetworkconnection_p.h.

◆ defaultPipelineLength

const int QHttpNetworkConnectionPrivate::defaultPipelineLength = 3
static

Definition at line 144 of file qhttpnetworkconnection_p.h.

◆ defaultRePipelineLength

const int QHttpNetworkConnectionPrivate::defaultRePipelineLength = 2
static

Definition at line 145 of file qhttpnetworkconnection_p.h.

◆ delayedConnectionTimer

QTimer QHttpNetworkConnectionPrivate::delayedConnectionTimer

Definition at line 219 of file qhttpnetworkconnection_p.h.

◆ delayIpv4

bool QHttpNetworkConnectionPrivate::delayIpv4 = true

Definition at line 213 of file qhttpnetworkconnection_p.h.

◆ encrypt

bool QHttpNetworkConnectionPrivate::encrypt

◆ highPriorityQueue

QList<HttpMessagePair> QHttpNetworkConnectionPrivate::highPriorityQueue

Definition at line 243 of file qhttpnetworkconnection_p.h.

◆ hostName

QString QHttpNetworkConnectionPrivate::hostName

Definition at line 209 of file qhttpnetworkconnection_p.h.

◆ http2Parameters

QHttp2Configuration QHttpNetworkConnectionPrivate::http2Parameters

Definition at line 254 of file qhttpnetworkconnection_p.h.

◆ isLocalSocket

bool QHttpNetworkConnectionPrivate::isLocalSocket

Definition at line 212 of file qhttpnetworkconnection_p.h.

Referenced by QHttpNetworkConnectionPrivate(), and prepareRequest().

◆ lowPriorityQueue

QList<HttpMessagePair> QHttpNetworkConnectionPrivate::lowPriorityQueue

Definition at line 244 of file qhttpnetworkconnection_p.h.

◆ networkLayerState

◆ networkProxy

QNetworkProxy QHttpNetworkConnectionPrivate::networkProxy

Definition at line 238 of file qhttpnetworkconnection_p.h.

◆ peerVerifyName

QString QHttpNetworkConnectionPrivate::peerVerifyName

Definition at line 256 of file qhttpnetworkconnection_p.h.

◆ port

quint16 QHttpNetworkConnectionPrivate::port

Definition at line 210 of file qhttpnetworkconnection_p.h.

◆ preConnectRequests

int QHttpNetworkConnectionPrivate::preConnectRequests = 0

Definition at line 246 of file qhttpnetworkconnection_p.h.

Referenced by _q_startNextRequest(), and queueRequest().

◆ sslContext

std::shared_ptr<QSslContext> QHttpNetworkConnectionPrivate::sslContext

Definition at line 251 of file qhttpnetworkconnection_p.h.

◆ state

ConnectionState QHttpNetworkConnectionPrivate::state = RunningState

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