QHttpNetworkConnectionPrivate: NSDMI

Initialize the hardcoded things inside the class.

Task-number: QTBUG-102855
Change-Id: I06da0a615ec066e63d9cd0359313e8e8f588718e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
bb10
Mårten Nordheim 2024-03-21 16:01:01 +01:00
parent 28bff27b85
commit c9e6cdc19e
2 changed files with 5 additions and 7 deletions

View File

@ -52,14 +52,12 @@ static int getPreferredActiveChannelCount(QHttpNetworkConnection::ConnectionType
QHttpNetworkConnectionPrivate::QHttpNetworkConnectionPrivate(quint16 connectionCount, const QString &hostName,
quint16 port, bool encrypt,
QHttpNetworkConnection::ConnectionType type)
: state(RunningState), networkLayerState(Unknown),
hostName(hostName), port(port), encrypt(encrypt), delayIpv4(true),
: hostName(hostName), port(port), encrypt(encrypt),
activeChannelCount(getPreferredActiveChannelCount(type, connectionCount)),
channelCount(connectionCount), channels(new QHttpNetworkConnectionChannel[channelCount])
#ifndef QT_NO_NETWORKPROXY
, networkProxy(QNetworkProxy::NoProxy)
#endif
, preConnectRequests(0)
, connectionType(type)
{
// We allocate all 6 channels even if it's an HTTP/2-enabled

View File

@ -160,8 +160,8 @@ public:
void pauseConnection();
void resumeConnection();
ConnectionState state;
NetworkLayerPreferenceState networkLayerState;
ConnectionState state = RunningState;
NetworkLayerPreferenceState networkLayerState = Unknown;
enum { ChunkSize = 4096 };
@ -204,7 +204,7 @@ public:
QString hostName;
quint16 port;
bool encrypt;
bool delayIpv4;
bool delayIpv4 = true;
// Number of channels we are trying to use at the moment:
int activeChannelCount;
@ -237,7 +237,7 @@ public:
QList<HttpMessagePair> highPriorityQueue;
QList<HttpMessagePair> lowPriorityQueue;
int preConnectRequests;
int preConnectRequests = 0;
QHttpNetworkConnection::ConnectionType connectionType;