Skip to content

Commit

Permalink
QHttpNetworkConnectionPrivate: NSDMI
Browse files Browse the repository at this point in the history
Initialize the hardcoded things inside the class.

Task-number: QTBUG-102855
Change-Id: I06da0a615ec066e63d9cd0359313e8e8f588718e
Reviewed-by: Edward Welbourne <[email protected]>
  • Loading branch information
Morten242 committed Apr 17, 2024
1 parent 28bff27 commit c9e6cdc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/network/access/qhttpnetworkconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/network/access/qhttpnetworkconnection_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ class QHttpNetworkConnectionPrivate : public QObjectPrivate

void pauseConnection();
void resumeConnection();
ConnectionState state;
NetworkLayerPreferenceState networkLayerState;
ConnectionState state = RunningState;
NetworkLayerPreferenceState networkLayerState = Unknown;

enum { ChunkSize = 4096 };

Expand Down Expand Up @@ -204,7 +204,7 @@ class QHttpNetworkConnectionPrivate : public QObjectPrivate
QString hostName;
quint16 port;
bool encrypt;
bool delayIpv4;
bool delayIpv4 = true;

// Number of channels we are trying to use at the moment:
int activeChannelCount;
Expand Down Expand Up @@ -237,7 +237,7 @@ class QHttpNetworkConnectionPrivate : public QObjectPrivate
QList<HttpMessagePair> highPriorityQueue;
QList<HttpMessagePair> lowPriorityQueue;

int preConnectRequests;
int preConnectRequests = 0;

QHttpNetworkConnection::ConnectionType connectionType;

Expand Down

0 comments on commit c9e6cdc

Please sign in to comment.