qhttpnetworkconnection.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/access/qhttpnetworkconnection.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14const int QHttpNetworkConnectionPrivate::defaultHttpChannelCount = 6;-
15-
16-
17const int QHttpNetworkConnectionPrivate::defaultPipelineLength = 3;-
18-
19-
20const int QHttpNetworkConnectionPrivate::defaultRePipelineLength = 2;-
21-
22-
23QHttpNetworkConnectionPrivate::QHttpNetworkConnectionPrivate(const QString &hostName,-
24 quint16 port, bool encrypt,-
25 QHttpNetworkConnection::ConnectionType type)-
26: state(RunningState),-
27 networkLayerState(Unknown),-
28 hostName(hostName), port(port), encrypt(encrypt), delayIpv4(true)-
29-
30, channelCount((type == QHttpNetworkConnection::ConnectionTypeSPDY) ? 1 : defaultHttpChannelCount)-
31-
32-
33-
34-
35 , networkProxy(QNetworkProxy::NoProxy)-
36-
37 , preConnectRequests(0)-
38 , connectionType(type)-
39{-
40 channels = new QHttpNetworkConnectionChannel[channelCount];-
41}
executed 575 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
575
42-
43QHttpNetworkConnectionPrivate::QHttpNetworkConnectionPrivate(quint16 channelCount, const QString &hostName,-
44 quint16 port, bool encrypt,-
45 QHttpNetworkConnection::ConnectionType type)-
46: state(RunningState), networkLayerState(Unknown),-
47 hostName(hostName), port(port), encrypt(encrypt), delayIpv4(true),-
48 channelCount(channelCount)-
49-
50 , networkProxy(QNetworkProxy::NoProxy)-
51-
52 , preConnectRequests(0)-
53 , connectionType(type)-
54{-
55 channels = new QHttpNetworkConnectionChannel[channelCount];-
56}
executed 8 times by 1 test: end of block
Executed by:
  • tst_QHttpNetworkConnection
8
57-
58-
59-
60QHttpNetworkConnectionPrivate::~QHttpNetworkConnectionPrivate()-
61{-
62 for (int i = 0; i < channelCount
i < channelCountDescription
TRUEevaluated 3410 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_spdy - unknown status
FALSEevaluated 582 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_spdy - unknown status
; ++i) {
582-3410
63 if (channels[i].socket
channels[i].socketDescription
TRUEevaluated 752 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_spdy - unknown status
FALSEevaluated 2658 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
752-2658
64 QObject::disconnect(channels[i].socket, nullptr, &channels[i], nullptr);-
65 channels[i].socket->close();-
66 delete channels[i].socket;-
67 }
executed 752 times by 9 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_spdy - unknown status
752
68 }
executed 3410 times by 9 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_spdy - unknown status
3410
69 delete []channels;-
70}
executed 582 times by 9 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_spdy - unknown status
582
71-
72void QHttpNetworkConnectionPrivate::init()-
73{-
74 QHttpNetworkConnection * const q = q_func();-
75 for (int i = 0; i < channelCount
i < channelCountDescription
TRUEevaluated 3416 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 583 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
; i++) {
583-3416
76 channels[i].setConnection(this->q_func());-
77 channels[i].ssl = encrypt;-
78-
79-
80 channels[i].networkSession = networkSession;-
81-
82 }
executed 3416 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
3416
83-
84 delayedConnectionTimer.setSingleShot(true);-
85 QObject::connect(&delayedConnectionTimer, qFlagLocation("2""timeout()" "\0" __FILE__ ":" "140"), q, qFlagLocation("1""_q_connectDelayedChannel()" "\0" __FILE__ ":" "140"));-
86}
executed 583 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
583
87-
88void QHttpNetworkConnectionPrivate::pauseConnection()-
89{-
90 state = PausedState;-
91-
92-
93 for (int i = 0; i < channelCount
i < channelCountDescription
TRUEevaluated 1600 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 275 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
; i++) {
275-1600
94 if (channels[i].socket
channels[i].socketDescription
TRUEevaluated 325 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 1275 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
) {
325-1275
95-
96 if (encrypt
encryptDescription
TRUEevaluated 128 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 197 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
128-197
97 QSslSocketPrivate::pauseSocketNotifiers(static_cast<QSslSocket*>(channels[i].socket));
executed 128 times by 3 tests: QSslSocketPrivate::pauseSocketNotifiers(static_cast<QSslSocket*>(channels[i].socket));
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
128
98 else-
99-
100 QAbstractSocketPrivate::pauseSocketNotifiers(channels[i].socket);
executed 197 times by 2 tests: QAbstractSocketPrivate::pauseSocketNotifiers(channels[i].socket);
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
197
101 }-
102 }
executed 1600 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
1600
103}
executed 275 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
275
104-
105void QHttpNetworkConnectionPrivate::resumeConnection()-
106{-
107 state = RunningState;-
108-
109 for (int i = 0; i < channelCount
i < channelCountDescription
TRUEevaluated 1600 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 275 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
; i++) {
275-1600
110 if (channels[i].socket
channels[i].socketDescription
TRUEevaluated 325 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 1275 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
) {
325-1275
111-
112 if (encrypt
encryptDescription
TRUEevaluated 128 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 197 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
128-197
113 QSslSocketPrivate::resumeSocketNotifiers(static_cast<QSslSocket*>(channels[i].socket));
executed 128 times by 3 tests: QSslSocketPrivate::resumeSocketNotifiers(static_cast<QSslSocket*>(channels[i].socket));
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
128
114 else-
115-
116 QAbstractSocketPrivate::resumeSocketNotifiers(channels[i].socket);
executed 197 times by 2 tests: QAbstractSocketPrivate::resumeSocketNotifiers(channels[i].socket);
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
197
117-
118-
119 if (channels[i].state == QHttpNetworkConnectionChannel::WritingState
channels[i].st...::WritingStateDescription
TRUEnever evaluated
FALSEevaluated 325 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
)
0-325
120 QMetaObject::invokeMethod(&channels[i], "_q_uploadDataReadyRead", Qt::QueuedConnection);
never executed: QMetaObject::invokeMethod(&channels[i], "_q_uploadDataReadyRead", Qt::QueuedConnection);
0
121 }
executed 325 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
325
122 }
executed 1600 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
1600
123-
124-
125 QMetaObject::invokeMethod(this->q_func(), "_q_startNextRequest", Qt::QueuedConnection);-
126}
executed 275 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
275
127-
128int QHttpNetworkConnectionPrivate::indexOf(QAbstractSocket *socket) const-
129{-
130 for (int i = 0; i < channelCount
i < channelCountDescription
TRUEevaluated 16109 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
; ++i)
0-16109
131 if (channels[i].socket == socket
channels[i].socket == socketDescription
TRUEevaluated 7294 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 8815 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
)
7294-8815
132 return
executed 7294 times by 8 tests: return i;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
i;
executed 7294 times by 8 tests: return i;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
7294
133-
134 QMessageLogger(__FILE__, 189, __PRETTY_FUNCTION__).fatal("Called with unknown socket object.");-
135 return
never executed: return 0;
0;
never executed: return 0;
0
136}-
137-
138-
139-
140-
141-
142bool QHttpNetworkConnectionPrivate::shouldEmitChannelError(QAbstractSocket *socket)-
143{-
144 QHttpNetworkConnection * const q = q_func();-
145-
146 bool emitError = true;-
147 int i = indexOf(socket);-
148 int otherSocket = (i == 0
i == 0Description
TRUEevaluated 27 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 125 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
? 1 : 0);
27-125
149-
150-
151 if (delayedConnectionTimer.isActive()
delayedConnect...mer.isActive()Description
TRUEevaluated 122 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 30 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
) {
30-122
152 delayedConnectionTimer.stop();-
153 channels[otherSocket].ensureConnection();-
154 }
executed 122 times by 2 tests: end of block
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
122
155-
156 if (channelCount == 1
channelCount == 1Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_Spdy
FALSEevaluated 149 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
) {
3-149
157 if (networkLayerState == HostLookupPending
networkLayerSt...tLookupPendingDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_Spdy
|| networkLayerState == IPv4or6
networkLayerState == IPv4or6Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_Spdy
)
0-3
158 networkLayerState = QHttpNetworkConnectionPrivate::Unknown;
never executed: networkLayerState = QHttpNetworkConnectionPrivate::Unknown;
0
159 channels[0].close();-
160 emitError = true;-
161 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_Spdy
else {
3
162 if (networkLayerState == HostLookupPending
networkLayerSt...tLookupPendingDescription
TRUEnever evaluated
FALSEevaluated 149 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
|| networkLayerState == IPv4or6
networkLayerState == IPv4or6Description
TRUEevaluated 124 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 25 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
0-149
163 if (channels[otherSocket].isSocketBusy()
channels[other...isSocketBusy()Description
TRUEevaluated 122 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
&& (
(channels[othe...:ClosingState)Description
TRUEevaluated 122 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEnever evaluated
channels[otherSocket].state != QHttpNetworkConnectionChannel::ClosingState)
(channels[othe...:ClosingState)Description
TRUEevaluated 122 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-122
164-
165 channels[i].close();-
166 emitError = false;-
167 }
executed 122 times by 2 tests: end of block
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
122
168 else {-
169-
170 networkLayerState = QHttpNetworkConnectionPrivate::Unknown;-
171 channels[i].close();-
172 emitError = true;-
173 }
executed 2 times by 2 tests: end of block
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
2
174 } else {-
175 if (((
(networkLayerS...Private::IPv4)Description
TRUEevaluated 25 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
networkLayerState == QHttpNetworkConnectionPrivate::IPv4)
(networkLayerS...Private::IPv4)Description
TRUEevaluated 25 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
&& (
(channels[i].n...:IPv4Protocol)Description
TRUEnever evaluated
FALSEevaluated 25 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
channels[i].networkLayerPreference != QAbstractSocket::IPv4Protocol)
(channels[i].n...:IPv4Protocol)Description
TRUEnever evaluated
FALSEevaluated 25 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
0-25
176 || ((
(networkLayerS...Private::IPv6)Description
TRUEnever evaluated
FALSEevaluated 25 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
networkLayerState == QHttpNetworkConnectionPrivate::IPv6)
(networkLayerS...Private::IPv6)Description
TRUEnever evaluated
FALSEevaluated 25 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
&& (
(channels[i].n...:IPv6Protocol)Description
TRUEnever evaluated
FALSEnever evaluated
channels[i].networkLayerPreference != QAbstractSocket::IPv6Protocol)
(channels[i].n...:IPv6Protocol)Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0-25
177-
178 channels[i].close();-
179 QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);-
180 emitError = false;-
181 }
never executed: end of block
0
182 if (networkLayerState == QHttpNetworkConnectionPrivate::Unknown
networkLayerSt...ivate::UnknownDescription
TRUEnever evaluated
FALSEevaluated 25 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
0-25
183 QMessageLogger(__FILE__, 238, __PRETTY_FUNCTION__).warning("We got a connection error when networkLayerState is Unknown");
never executed: QMessageLogger(__FILE__, 238, __PRETTY_FUNCTION__).warning("We got a connection error when networkLayerState is Unknown");
0
184 }
executed 25 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
25
185 }-
186 return
executed 152 times by 4 tests: return emitError;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
emitError;
executed 152 times by 4 tests: return emitError;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
152
187}-
188-
189-
190qint64 QHttpNetworkConnectionPrivate::uncompressedBytesAvailable(const QHttpNetworkReply &reply) const-
191{-
192 return
executed 12636 times by 1 test: return reply.d_func()->responseData.byteAmount();
Executed by:
  • tst_QHttpNetworkConnection
reply.d_func()->responseData.byteAmount();
executed 12636 times by 1 test: return reply.d_func()->responseData.byteAmount();
Executed by:
  • tst_QHttpNetworkConnection
12636
193}-
194-
195qint64 QHttpNetworkConnectionPrivate::uncompressedBytesAvailableNextBlock(const QHttpNetworkReply &reply) const-
196{-
197 return
never executed: return reply.d_func()->responseData.sizeNextBlock();
reply.d_func()->responseData.sizeNextBlock();
never executed: return reply.d_func()->responseData.sizeNextBlock();
0
198}-
199-
200void QHttpNetworkConnectionPrivate::prepareRequest(HttpMessagePair &messagePair)-
201{-
202 QHttpNetworkRequest &request = messagePair.first;-
203 QHttpNetworkReply *reply = messagePair.second;-
204-
205-
206 QByteArray value;-
207-
208 QNonContiguousByteDevice* uploadByteDevice = request.uploadByteDevice();-
209 if (uploadByteDevice
uploadByteDeviceDescription
TRUEevaluated 201 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 1436 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
201-1436
210 const qint64 contentLength = request.contentLength();-
211 const qint64 uploadDeviceSize = uploadByteDevice->size();-
212 if (contentLength != -1
contentLength != -1Description
TRUEevaluated 131 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 70 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
&& uploadDeviceSize != -1
uploadDeviceSize != -1Description
TRUEevaluated 130 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
1-131
213-
214 request.setContentLength(qMin(uploadDeviceSize, contentLength));-
215 }
executed 130 times by 3 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
else if (contentLength == -1
contentLength == -1Description
TRUEevaluated 70 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
&& uploadDeviceSize != -1
uploadDeviceSize != -1Description
TRUEevaluated 70 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-130
216-
217 request.setContentLength(uploadDeviceSize);-
218 }
executed 70 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
else if (contentLength != -1
contentLength != -1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
&& uploadDeviceSize == -1
uploadDeviceSize == -1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-70
219-
220 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else if (__builtin_expect(!!(contentLength == -1 && uploadDeviceSize == -1), false)
__builtin_expe...== -1), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-1
221 QMessageLogger(__FILE__, 276, __PRETTY_FUNCTION__).fatal("QHttpNetworkConnectionPrivate: Neither content-length nor upload device size were given");-
222 }
never executed: end of block
0
223 }
executed 201 times by 4 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
201
224-
225-
226 if (networkProxy.type() == QNetworkProxy::HttpCachingProxy
networkProxy.t...tpCachingProxyDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1629 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
8-1629
227 value = request.headerField("proxy-connection");-
228 if (value.isEmpty()
value.isEmpty()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
)
0-8
229 request.setHeaderField("Proxy-Connection", "Keep-Alive");
executed 8 times by 1 test: request.setHeaderField("Proxy-Connection", "Keep-Alive");
Executed by:
  • tst_QNetworkReply
8
230 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else {
8
231-
232 value = request.headerField("connection");-
233 if (value.isEmpty()
value.isEmpty()Description
TRUEevaluated 1629 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
)
0-1629
234 request.setHeaderField("Connection", "Keep-Alive");
executed 1629 times by 8 tests: request.setHeaderField("Connection", "Keep-Alive");
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1629
235-
236 }
executed 1629 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1629
237-
238-
239-
240-
241-
242-
243-
244 value = request.headerField("accept-encoding");-
245 if (value.isEmpty()
value.isEmpty()Description
TRUEevaluated 1635 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
) {
2-1635
246-
247 request.setHeaderField("Accept-Encoding", "gzip, deflate");-
248 request.d->autoDecompress = true;-
249-
250-
251-
252-
253 }
executed 1635 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1635
254-
255-
256-
257-
258-
259 value = request.headerField("accept-language");-
260 if (value.isEmpty()
value.isEmpty()Description
TRUEevaluated 1637 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
) {
0-1637
261 QString systemLocale = QLocale::system().name().replace(QChar::fromLatin1('_'),QChar::fromLatin1('-'));-
262 QString acceptLanguage;-
263 if (systemLocale == QLatin1String("C")
systemLocale =...in1String("C")Description
TRUEnever evaluated
FALSEevaluated 1637 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
)
0-1637
264 acceptLanguage = QString::fromLatin1("en,*");
never executed: acceptLanguage = QString::fromLatin1("en,*");
0
265 else if (systemLocale.startsWith(QLatin1String("en-"))
systemLocale.s...String("en-"))Description
TRUEevaluated 1637 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
)
0-1637
266 acceptLanguage = QString::fromLatin1("%1,*").arg(systemLocale);
executed 1637 times by 8 tests: acceptLanguage = QString::fromLatin1("%1,*").arg(systemLocale);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1637
267 else-
268 acceptLanguage = QString::fromLatin1("%1,en,*").arg(systemLocale);
never executed: acceptLanguage = QString::fromLatin1("%1,en,*").arg(systemLocale);
0
269 request.setHeaderField("Accept-Language", acceptLanguage.toLatin1());-
270 }
executed 1637 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1637
271-
272-
273 value = request.headerField("user-agent");-
274 if (value.isEmpty()
value.isEmpty()Description
TRUEevaluated 1633 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
)
4-1633
275 request.setHeaderField("User-Agent", "Mozilla/5.0");
executed 1633 times by 7 tests: request.setHeaderField("User-Agent", "Mozilla/5.0");
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
1633
276-
277 value = request.headerField("host");-
278 if (value.isEmpty()
value.isEmpty()Description
TRUEevaluated 1636 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlInputSource
) {
1-1636
279 QHostAddress add;-
280 QByteArray host;-
281 if (add.setAddress(hostName)
add.setAddress(hostName)Description
TRUEevaluated 43 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 1593 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
43-1593
282 if (add.protocol() == QAbstractSocket::IPv6Protocol
add.protocol()...::IPv6ProtocolDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 42 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
)
1-42
283 host = '[' + hostName.toLatin1() + ']';
executed 1 time by 1 test: host = '[' + hostName.toLatin1() + ']';
Executed by:
  • tst_QNetworkReply
1
284 else-
285 host = hostName.toLatin1();
executed 42 times by 3 tests: host = hostName.toLatin1();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
42
286-
287 } else {-
288 host = QUrl::toAce(hostName);-
289 }
executed 1593 times by 7 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
1593
290-
291 int port = request.url().port();-
292 if (port != -1
port != -1Description
TRUEevaluated 173 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 1463 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
173-1463
293 host += ':';-
294 host += QByteArray::number(port);-
295 }
executed 173 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
173
296-
297 request.setHeaderField("Host", host);-
298 }
executed 1636 times by 7 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
1636
299-
300 reply->d_func()->requestIsPrepared = true;-
301}
executed 1637 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1637
302-
303-
304-
305-
306void QHttpNetworkConnectionPrivate::emitReplyError(QAbstractSocket *socket,-
307 QHttpNetworkReply *reply,-
308 QNetworkReply::NetworkError errorCode)-
309{-
310 QHttpNetworkConnection * const q = q_func();-
311-
312 int i = 0;-
313 if (socket
socketDescription
TRUEevaluated 5 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
)
4-5
314 i = indexOf(socket);
executed 5 times by 2 tests: i = indexOf(socket);
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
5
315-
316 if (reply
replyDescription
TRUEevaluated 9 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
) {
0-9
317-
318 reply->d_func()->errorString = errorDetail(errorCode, socket);-
319 reply->finishedWithError(errorCode, reply->d_func()->errorString);-
320-
321 reply->d_func()->eraseData();-
322-
323-
324 channels[i].close();-
325 channels[i].reply = 0;-
326 if (channels[i].protocolHandler
channels[i].protocolHandlerDescription
TRUEevaluated 5 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
)
4-5
327 channels[i].protocolHandler->setReply(0);
executed 5 times by 2 tests: channels[i].protocolHandler->setReply(0);
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
5
328 channels[i].request = QHttpNetworkRequest();-
329 if (socket
socketDescription
TRUEevaluated 5 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
)
4-5
330 channels[i].requeueCurrentlyPipelinedRequests();
executed 5 times by 2 tests: channels[i].requeueCurrentlyPipelinedRequests();
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
5
331-
332-
333 QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);-
334 }
executed 9 times by 4 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
9
335}
executed 9 times by 4 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
9
336-
337void QHttpNetworkConnectionPrivate::copyCredentials(int fromChannel, QAuthenticator *auth, bool isProxy)-
338{-
339 ((!(auth)) ? qt_assert("auth",__FILE__,394) : qt_noop());-
340-
341-
342 if (fromChannel >= 0
fromChannel >= 0Description
TRUEevaluated 201 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
) {
0-201
343 if (!isProxy
!isProxyDescription
TRUEevaluated 135 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 66 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
&& channels[fromChannel].authMethod == QAuthenticatorPrivate::Ntlm
channels[fromC...rPrivate::NtlmDescription
TRUEnever evaluated
FALSEevaluated 135 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
0-135
344 return;
never executed: return;
0
345 if (isProxy
isProxyDescription
TRUEevaluated 66 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 135 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
&& channels[fromChannel].proxyAuthMethod == QAuthenticatorPrivate::Ntlm
channels[fromC...rPrivate::NtlmDescription
TRUEnever evaluated
FALSEevaluated 66 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
0-135
346 return;
never executed: return;
0
347 }
executed 201 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
201
348-
349-
350 QAuthenticator* otherAuth = 0;-
351 for (int i = 0; i < channelCount
i < channelCountDescription
TRUEevaluated 1191 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 201 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
; ++i) {
201-1191
352 if (i == fromChannel
i == fromChannelDescription
TRUEevaluated 201 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 990 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
201-990
353 continue;
executed 201 times by 3 tests: continue;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
201
354 if (isProxy
isProxyDescription
TRUEevaluated 315 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 675 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
315-675
355 otherAuth = &channels[i].proxyAuthenticator;
executed 315 times by 1 test: otherAuth = &channels[i].proxyAuthenticator;
Executed by:
  • tst_QNetworkReply
315
356 else-
357 otherAuth = &channels[i].authenticator;
executed 675 times by 2 tests: otherAuth = &channels[i].authenticator;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
675
358-
359 if (otherAuth->user().compare(auth->user())
otherAuth->use...(auth->user())Description
TRUEevaluated 735 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 255 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
255-735
360 otherAuth->setUser(auth->user());
executed 735 times by 2 tests: otherAuth->setUser(auth->user());
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
735
361 if (otherAuth->password().compare(auth->password())
otherAuth->pas...h->password())Description
TRUEevaluated 745 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 245 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
245-745
362 otherAuth->setPassword(auth->password());
executed 745 times by 2 tests: otherAuth->setPassword(auth->password());
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
745
363 }
executed 990 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
990
364}
executed 201 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
201
365-
366-
367-
368bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket *socket, QHttpNetworkReply *reply,-
369 bool isProxy, bool &resend)-
370{-
371 ((!(socket)) ? qt_assert("socket",__FILE__,426) : qt_noop());-
372 ((!(reply)) ? qt_assert("reply",__FILE__,427) : qt_noop());-
373-
374 resend = false;-
375-
376 QList<QPair<QByteArray, QByteArray> > fields = reply->header();-
377-
378-
379 QAuthenticatorPrivate::Method authMethod = reply->d_func()->authenticationMethod(isProxy);-
380 if (authMethod != QAuthenticatorPrivate::None
authMethod != ...rPrivate::NoneDescription
TRUEevaluated 353 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
3-353
381 int i = indexOf(socket);-
382-
383 QAuthenticator* auth = 0;-
384 if (isProxy
isProxyDescription
TRUEevaluated 53 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 300 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
53-300
385 auth = &channels[i].proxyAuthenticator;-
386 channels[i].proxyAuthMethod = authMethod;-
387 }
executed 53 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else {
53
388 auth = &channels[i].authenticator;-
389 channels[i].authMethod = authMethod;-
390 }
executed 300 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
300
391-
392 if (auth->isNull()
auth->isNull()Description
TRUEnever evaluated
FALSEevaluated 353 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
0-353
393 auth->detach();
never executed: auth->detach();
0
394 QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(*auth);-
395 priv->parseHttpResponse(fields, isProxy);-
396-
397 if (priv->phase == QAuthenticatorPrivate::Done
priv->phase ==...rPrivate::DoneDescription
TRUEevaluated 179 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 174 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
174-179
398 pauseConnection();-
399 if (!isProxy
!isProxyDescription
TRUEevaluated 152 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 27 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
27-152
400 if (channels[i].authenticationCredentialsSent
channels[i].au...redentialsSentDescription
TRUEevaluated 52 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 100 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
52-100
401 auth->detach();-
402 priv = QAuthenticatorPrivate::getPrivate(*auth);-
403 priv->hasFailed = true;-
404 priv->phase = QAuthenticatorPrivate::Done;-
405 channels[i].authenticationCredentialsSent = false;-
406 }
executed 52 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
52
407 reply->authenticationRequired(reply->request(), auth);-
408-
409 }
executed 152 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
else {
152
410 if (channels[i].proxyCredentialsSent
channels[i].pr...redentialsSentDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 25 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
2-25
411 auth->detach();-
412 priv = QAuthenticatorPrivate::getPrivate(*auth);-
413 priv->hasFailed = true;-
414 priv->phase = QAuthenticatorPrivate::Done;-
415 channels[i].proxyCredentialsSent = false;-
416 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
2
417 reply->proxyAuthenticationRequired(networkProxy, auth);-
418-
419 }
executed 27 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
27
420 resumeConnection();-
421-
422 if (priv->phase != QAuthenticatorPrivate::Done
priv->phase !=...rPrivate::DoneDescription
TRUEevaluated 141 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 38 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
38-141
423-
424 copyCredentials(i, auth, isProxy);-
425 }
executed 141 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
141
426 }
executed 179 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
else if (priv->phase == QAuthenticatorPrivate::Start
priv->phase ==...Private::StartDescription
TRUEevaluated 174 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-179
427-
428-
429-
430 reply->cacheCredentials(reply->request(), auth);-
431 }
executed 174 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
174
432-
433-
434-
435-
436 if (priv->phase == QAuthenticatorPrivate::Done
priv->phase ==...rPrivate::DoneDescription
TRUEevaluated 38 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 315 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
|| !reply->request().withCredentials()
!reply->reques...hCredentials()Description
TRUEnever evaluated
FALSEevaluated 315 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
0-315
437-
438 auth = 0;-
439 if (isProxy
isProxyDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 35 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
3-35
440 channels[i].proxyAuthenticator = QAuthenticator();
executed 3 times by 1 test: channels[i].proxyAuthenticator = QAuthenticator();
Executed by:
  • tst_QNetworkReply
3
441 else-
442 channels[i].authenticator = QAuthenticator();
executed 35 times by 2 tests: channels[i].authenticator = QAuthenticator();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
35
443-
444-
445 channels[i].reply->headerChanged();-
446 channels[i].reply->readyRead();-
447 QNetworkReply::NetworkError errorCode =-
448 isProxy
isProxyDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 35 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
3-35
449 ? QNetworkReply::ProxyAuthenticationRequiredError-
450 : QNetworkReply::AuthenticationRequiredError;-
451 reply->d_func()->errorString = errorDetail(errorCode, socket);-
452 reply->finishedWithError(errorCode, reply->d_func()->errorString);-
453-
454 return
executed 38 times by 2 tests: return true;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
true;
executed 38 times by 2 tests: return true;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
38
455 }-
456-
457 resend = true;-
458 return
executed 315 times by 2 tests: return true;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
true;
executed 315 times by 2 tests: return true;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
315
459 }-
460 return
executed 3 times by 1 test: return false;
Executed by:
  • tst_QNetworkReply
false;
executed 3 times by 1 test: return false;
Executed by:
  • tst_QNetworkReply
3
461}-
462-
463QUrl QHttpNetworkConnectionPrivate::parseRedirectResponse(QAbstractSocket *socket, QHttpNetworkReply *reply)-
464{-
465 if (!reply->request().isFollowRedirects()
!reply->reques...lowRedirects()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QNetworkProxyFactory
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
3-6
466 return
executed 3 times by 1 test: return QUrl();
Executed by:
  • tst_QNetworkProxyFactory
QUrl();
executed 3 times by 1 test: return QUrl();
Executed by:
  • tst_QNetworkProxyFactory
3
467-
468 QUrl rUrl;-
469 const QList<QPair<QByteArray, QByteArray> > fields = reply->header();-
470 for (const QNetworkReply::RawHeaderPair &header : fields) {-
471 if (header.first.toLower() == "location"
header.first.t... == "location"Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
6
472 rUrl = QUrl::fromEncoded(header.second);-
473 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_QNetworkReply
6
474 }-
475 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
6
476-
477-
478 if (!rUrl.isValid()
!rUrl.isValid()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
0-6
479 emitReplyError(socket, reply, QNetworkReply::ProtocolUnknownError);-
480 return
never executed: return QUrl();
QUrl();
never executed: return QUrl();
0
481 }-
482-
483-
484 if (reply->request().redirectCount() <= 0
reply->request...ctCount() <= 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
1-5
485 emitReplyError(socket, reply, QNetworkReply::TooManyRedirectsError);-
486 return
executed 1 time by 1 test: return QUrl();
Executed by:
  • tst_QNetworkReply
QUrl();
executed 1 time by 1 test: return QUrl();
Executed by:
  • tst_QNetworkReply
1
487 }-
488-
489-
490 if (rUrl.isRelative()
rUrl.isRelative()Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
0-5
491 rUrl = reply->request().url().resolved(rUrl);
never executed: rUrl = reply->request().url().resolved(rUrl);
0
492-
493-
494 QString scheme = rUrl.scheme();-
495 if (scheme == QLatin1String("http")
scheme == QLat...String("http")Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
|| scheme == QLatin1String("https")
scheme == QLat...tring("https")Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-5
496 QString previousUrlScheme = reply->request().url().scheme();-
497-
498 if (previousUrlScheme == QLatin1String("https")
previousUrlSch...tring("https")Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QNetworkReply
0-5
499 && scheme == QLatin1String("http")
scheme == QLat...String("http")Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
500 emitReplyError(socket, reply, QNetworkReply::InsecureRedirectError);-
501 return
never executed: return QUrl();
QUrl();
never executed: return QUrl();
0
502 }-
503 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else {
5
504 emitReplyError(socket, reply, QNetworkReply::ProtocolUnknownError);-
505 return
never executed: return QUrl();
QUrl();
never executed: return QUrl();
0
506 }-
507 return
executed 5 times by 1 test: return rUrl;
Executed by:
  • tst_QNetworkReply
rUrl;
executed 5 times by 1 test: return rUrl;
Executed by:
  • tst_QNetworkReply
5
508}-
509-
510void QHttpNetworkConnectionPrivate::createAuthorization(QAbstractSocket *socket, QHttpNetworkRequest &request)-
511{-
512 ((!(socket)) ? qt_assert("socket",__FILE__,567) : qt_noop());-
513-
514 int i = indexOf(socket);-
515-
516-
517 if (channels[i].authMethod != QAuthenticatorPrivate::None
channels[i].au...rPrivate::NoneDescription
TRUEevaluated 172 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 1149 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
172-1149
518 if ((channels[i].authMethod != QAuthenticatorPrivate::Ntlm
channels[i].au...rPrivate::NtlmDescription
TRUEevaluated 172 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
&& request.headerField("Authorization").isEmpty()
request.header...on").isEmpty()Description
TRUEevaluated 137 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 35 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) || channels[i].lastStatus == 401
channels[i].lastStatus == 401Description
TRUEevaluated 35 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-172
519 QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(channels[i].authenticator);-
520 if (priv
privDescription
TRUEevaluated 172 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
&& priv->method != QAuthenticatorPrivate::None
priv->method !...rPrivate::NoneDescription
TRUEevaluated 152 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
0-172
521 QByteArray response = priv->calculateResponse(request.methodName(), request.uri(false));-
522 request.setHeaderField("Authorization", response);-
523 channels[i].authenticationCredentialsSent = true;-
524 }
executed 152 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
152
525 }
executed 172 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
172
526 }
executed 172 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
172
527-
528-
529 if (channels[i].proxyAuthMethod != QAuthenticatorPrivate::None
channels[i].pr...rPrivate::NoneDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1281 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
40-1281
530 if (!(channels[i].proxyAuthMethod == QAuthenticatorPrivate::Ntlm
channels[i].pr...rPrivate::NtlmDescription
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_QNetworkReply
&& channels[i].lastStatus != 407
channels[i].lastStatus != 407Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0-40
531 QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(channels[i].proxyAuthenticator);-
532 if (priv
privDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
&& priv->method != QAuthenticatorPrivate::None
priv->method !...rPrivate::NoneDescription
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
0-40
533 QByteArray response = priv->calculateResponse(request.methodName(), request.uri(false));-
534 request.setHeaderField("Proxy-Authorization", response);-
535 channels[i].proxyCredentialsSent = true;-
536 }
executed 38 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
38
537 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
40
538 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
40
539}
executed 1321 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1321
540-
541QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetworkRequest &request)-
542{-
543 QHttpNetworkConnection * const q = q_func();-
544-
545-
546 QHttpNetworkReply *reply = new QHttpNetworkReply(request.url());-
547 reply->setRequest(request);-
548 reply->d_func()->connection = q;-
549 reply->d_func()->connectionChannel = &channels[0];-
550 HttpMessagePair pair = qMakePair(request, reply);-
551-
552 if (request.isPreConnect()
request.isPreConnect()Description
TRUEnever evaluated
FALSEevaluated 1646 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
)
0-1646
553 preConnectRequests++;
never executed: preConnectRequests++;
0
554-
555 if (connectionType == QHttpNetworkConnection::ConnectionTypeHTTP
connectionType...ectionTypeHTTPDescription
TRUEevaluated 1534 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 112 times by 1 test
Evaluated by:
  • tst_Spdy
) {
112-1534
556 switch (request.priority()) {-
557 case
executed 116 times by 1 test: case QHttpNetworkRequest::HighPriority:
Executed by:
  • tst_QHttpNetworkConnection
QHttpNetworkRequest::HighPriority:
executed 116 times by 1 test: case QHttpNetworkRequest::HighPriority:
Executed by:
  • tst_QHttpNetworkConnection
116
558 highPriorityQueue.prepend(pair);-
559 break;
executed 116 times by 1 test: break;
Executed by:
  • tst_QHttpNetworkConnection
116
560 case
executed 1362 times by 8 tests: case QHttpNetworkRequest::NormalPriority:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
QHttpNetworkRequest::NormalPriority:
executed 1362 times by 8 tests: case QHttpNetworkRequest::NormalPriority:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1362
561 case
executed 56 times by 1 test: case QHttpNetworkRequest::LowPriority:
Executed by:
  • tst_QHttpNetworkConnection
QHttpNetworkRequest::LowPriority:
executed 56 times by 1 test: case QHttpNetworkRequest::LowPriority:
Executed by:
  • tst_QHttpNetworkConnection
56
562 lowPriorityQueue.prepend(pair);-
563 break;
executed 1418 times by 8 tests: break;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1418
564 }-
565 }
executed 1534 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1534
566-
567 else {-
568 if (!pair.second->d_func()->requestIsPrepared
!pair.second->...uestIsPreparedDescription
TRUEevaluated 112 times by 1 test
Evaluated by:
  • tst_Spdy
FALSEnever evaluated
)
0-112
569 prepareRequest(pair);
executed 112 times by 1 test: prepareRequest(pair);
Executed by:
  • tst_Spdy
112
570 channels[0].spdyRequestsToSend.insertMulti(request.priority(), pair);-
571 }
executed 112 times by 1 test: end of block
Executed by:
  • tst_Spdy
112
572-
573-
574-
575-
576-
577-
578 if (networkLayerState == Unknown
networkLayerState == UnknownDescription
TRUEevaluated 583 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 1063 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
|| networkLayerState == HostLookupPending
networkLayerSt...tLookupPendingDescription
TRUEnever evaluated
FALSEevaluated 1063 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
) {
0-1063
579 startHostInfoLookup();-
580 }
executed 583 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
else if ( networkLayerState == IPv4
networkLayerState == IPv4Description
TRUEevaluated 1061 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
|| networkLayerState == IPv6
networkLayerState == IPv6Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
0-1061
581 _q_startNextRequest();-
582 }
executed 1061 times by 4 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
1061
583 return
executed 1646 times by 8 tests: return reply;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
reply;
executed 1646 times by 8 tests: return reply;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1646
584}-
585-
586void QHttpNetworkConnectionPrivate::requeueRequest(const HttpMessagePair &pair)-
587{-
588 QHttpNetworkConnection * const q = q_func();-
589-
590 QHttpNetworkRequest request = pair.first;-
591 switch (request.priority()) {-
592 case
never executed: case QHttpNetworkRequest::HighPriority:
QHttpNetworkRequest::HighPriority:
never executed: case QHttpNetworkRequest::HighPriority:
0
593 highPriorityQueue.prepend(pair);-
594 break;
never executed: break;
0
595 case
never executed: case QHttpNetworkRequest::NormalPriority:
QHttpNetworkRequest::NormalPriority:
never executed: case QHttpNetworkRequest::NormalPriority:
0
596 case
never executed: case QHttpNetworkRequest::LowPriority:
QHttpNetworkRequest::LowPriority:
never executed: case QHttpNetworkRequest::LowPriority:
0
597 lowPriorityQueue.prepend(pair);-
598 break;
never executed: break;
0
599 }-
600-
601 QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);-
602}
never executed: end of block
0
603-
604bool QHttpNetworkConnectionPrivate::dequeueRequest(QAbstractSocket *socket)-
605{-
606 int i = 0;-
607 if (socket
socketDescription
TRUEevaluated 1151 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
)
4-1151
608 i = indexOf(socket);
executed 1151 times by 8 tests: i = indexOf(socket);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1151
609-
610 if (!highPriorityQueue.isEmpty()
!highPriorityQueue.isEmpty()Description
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
FALSEevaluated 1101 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
54-1101
611-
612 HttpMessagePair messagePair = highPriorityQueue.takeLast();-
613 if (!messagePair.second->d_func()->requestIsPrepared
!messagePair.s...uestIsPreparedDescription
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
FALSEnever evaluated
)
0-54
614 prepareRequest(messagePair);
executed 54 times by 1 test: prepareRequest(messagePair);
Executed by:
  • tst_QHttpNetworkConnection
54
615 updateChannel(i, messagePair);-
616 return
executed 54 times by 1 test: return true;
Executed by:
  • tst_QHttpNetworkConnection
true;
executed 54 times by 1 test: return true;
Executed by:
  • tst_QHttpNetworkConnection
54
617 }-
618-
619 if (!lowPriorityQueue.isEmpty()
!lowPriorityQueue.isEmpty()Description
TRUEevaluated 1069 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 32 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
) {
32-1069
620-
621 HttpMessagePair messagePair = lowPriorityQueue.takeLast();-
622 if (!messagePair.second->d_func()->requestIsPrepared
!messagePair.s...uestIsPreparedDescription
TRUEevaluated 1069 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
)
0-1069
623 prepareRequest(messagePair);
executed 1069 times by 8 tests: prepareRequest(messagePair);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1069
624 updateChannel(i, messagePair);-
625 return
executed 1069 times by 8 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
true;
executed 1069 times by 8 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1069
626 }-
627 return
executed 32 times by 3 tests: return false;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
false;
executed 32 times by 3 tests: return false;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
32
628}-
629-
630void QHttpNetworkConnectionPrivate::updateChannel(int i, const HttpMessagePair &messagePair)-
631{-
632 channels[i].request = messagePair.first;-
633 channels[i].reply = messagePair.second;-
634-
635-
636 channels[i].reply->d_func()->connectionChannel = &channels[i];-
637}
executed 1123 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1123
638-
639QHttpNetworkRequest QHttpNetworkConnectionPrivate::predictNextRequest() const-
640{-
641 if (!highPriorityQueue.isEmpty()
!highPriorityQueue.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 21 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
0-21
642 return
never executed: return highPriorityQueue.last().first;
highPriorityQueue.last().first;
never executed: return highPriorityQueue.last().first;
0
643 if (!lowPriorityQueue.isEmpty()
!lowPriorityQueue.isEmpty()Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_Spdy
)
4-17
644 return
executed 17 times by 1 test: return lowPriorityQueue.last().first;
Executed by:
  • tst_QNetworkReply
lowPriorityQueue.last().first;
executed 17 times by 1 test: return lowPriorityQueue.last().first;
Executed by:
  • tst_QNetworkReply
17
645 return
executed 4 times by 1 test: return QHttpNetworkRequest();
Executed by:
  • tst_Spdy
QHttpNetworkRequest();
executed 4 times by 1 test: return QHttpNetworkRequest();
Executed by:
  • tst_Spdy
4
646}-
647-
648-
649void QHttpNetworkConnectionPrivate::fillPipeline(QAbstractSocket *socket)-
650{-
651-
652 if (highPriorityQueue.isEmpty()
highPriorityQueue.isEmpty()Description
TRUEevaluated 3929 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 358 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
&& lowPriorityQueue.isEmpty()
lowPriorityQueue.isEmpty()Description
TRUEevaluated 35 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 3894 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
35-3929
653 return;
executed 35 times by 2 tests: return;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
35
654-
655 int i = indexOf(socket);-
656-
657-
658 if (channels[i].reply == 0
channels[i].reply == 0Description
TRUEevaluated 33 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 4219 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
33-4219
659 return;
executed 33 times by 1 test: return;
Executed by:
  • tst_QNetworkReply
33
660-
661 if (! (defaultPipelineLength - channels[i].alreadyPipelinedRequests.length() >= defaultRePipelineLength)
! (defaultPipe...ipelineLength)Description
TRUEevaluated 1034 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 3185 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
1034-3185
662 return;
executed 1034 times by 2 tests: return;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
1034
663 }-
664-
665 if (channels[i].pipeliningSupported != QHttpNetworkConnectionChannel::PipeliningProbablySupported
channels[i].pi...bablySupportedDescription
TRUEevaluated 316 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 2869 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
316-2869
666 return;
executed 316 times by 2 tests: return;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
316
667-
668-
669 if (!channels[i].request.isPipeliningAllowed()
!channels[i].r...iningAllowed()Description
TRUEevaluated 2599 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 270 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
270-2599
670 return;
executed 2599 times by 2 tests: return;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
2599
671-
672-
673 if (channels[i].request.operation() != QHttpNetworkRequest::Get
channels[i].re...rkRequest::GetDescription
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
FALSEevaluated 206 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
64-206
674 return;
executed 64 times by 1 test: return;
Executed by:
  • tst_QHttpNetworkConnection
64
675-
676-
677 if (socket->state() != QAbstractSocket::ConnectedState
socket->state(...ConnectedStateDescription
TRUEnever evaluated
FALSEevaluated 206 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
0-206
678 return;
never executed: return;
0
679-
680-
681 if (channels[i].resendCurrent
channels[i].resendCurrentDescription
TRUEnever evaluated
FALSEevaluated 206 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
0-206
682 return;
never executed: return;
0
683-
684-
685-
686 if (!channels[i].authenticator.isNull()
!channels[i].a...cator.isNull()Description
TRUEevaluated 206 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
0-206
687 && (!channels[i].authenticator.user().isEmpty()
!channels[i].a...er().isEmpty()Description
TRUEnever evaluated
FALSEevaluated 206 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
0-206
688 || !channels[i].authenticator.password().isEmpty()
!channels[i].a...rd().isEmpty()Description
TRUEnever evaluated
FALSEevaluated 206 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
))
0-206
689 return;
never executed: return;
0
690 if (!channels[i].proxyAuthenticator.isNull()
!channels[i].p...cator.isNull()Description
TRUEevaluated 206 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
0-206
691 && (!channels[i].proxyAuthenticator.user().isEmpty()
!channels[i].p...er().isEmpty()Description
TRUEnever evaluated
FALSEevaluated 206 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
0-206
692 || !channels[i].proxyAuthenticator.password().isEmpty()
!channels[i].p...rd().isEmpty()Description
TRUEnever evaluated
FALSEevaluated 206 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
))
0-206
693 return;
never executed: return;
0
694-
695-
696 if (! (channels[i].state == QHttpNetworkConnectionChannel::WaitingState
channels[i].st...::WaitingStateDescription
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 190 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
16-190
697 || channels[i].state == QHttpNetworkConnectionChannel::ReadingState
channels[i].st...::ReadingStateDescription
TRUEevaluated 190 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
FALSEnever evaluated
))
0-190
698 return;
never executed: return;
0
699-
700 int lengthBefore;-
701 while (!highPriorityQueue.isEmpty()
!highPriorityQueue.isEmpty()Description
TRUEevaluated 62 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
FALSEevaluated 176 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
62-176
702 lengthBefore = channels[i].alreadyPipelinedRequests.length();-
703 fillPipeline(highPriorityQueue, channels[i]);-
704-
705 if (channels[i].alreadyPipelinedRequests.length() >= defaultPipelineLength
channels[i].al...PipelineLengthDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
) {
30-32
706 channels[i].pipelineFlush();-
707 return;
executed 30 times by 1 test: return;
Executed by:
  • tst_QHttpNetworkConnection
30
708 }-
709-
710 if (lengthBefore == channels[i].alreadyPipelinedRequests.length()
lengthBefore =...uests.length()Description
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
)
0-32
711 break;
never executed: break;
0
712 }
executed 32 times by 1 test: end of block
Executed by:
  • tst_QHttpNetworkConnection
32
713-
714 while (!lowPriorityQueue.isEmpty()
!lowPriorityQueue.isEmpty()Description
TRUEevaluated 351 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
3-351
715 lengthBefore = channels[i].alreadyPipelinedRequests.length();-
716 fillPipeline(lowPriorityQueue, channels[i]);-
717-
718 if (channels[i].alreadyPipelinedRequests.length() >= defaultPipelineLength
channels[i].al...PipelineLengthDescription
TRUEevaluated 162 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 189 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
162-189
719 channels[i].pipelineFlush();-
720 return;
executed 162 times by 2 tests: return;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
162
721 }-
722-
723 if (lengthBefore == channels[i].alreadyPipelinedRequests.length()
lengthBefore =...uests.length()Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
FALSEevaluated 178 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
11-178
724 break;
executed 11 times by 1 test: break;
Executed by:
  • tst_QHttpNetworkConnection
11
725 }
executed 178 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
178
726-
727-
728 channels[i].pipelineFlush();-
729}
executed 14 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
14
730-
731-
732bool QHttpNetworkConnectionPrivate::fillPipeline(QList<HttpMessagePair> &queue, QHttpNetworkConnectionChannel &channel)-
733{-
734 if (queue.isEmpty()
queue.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 413 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
0-413
735 return
never executed: return true;
true;
never executed: return true;
0
736-
737 for (int i = queue.count() - 1; i >= 0
i >= 0Description
TRUEevaluated 772 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
; --i) {
11-772
738 HttpMessagePair messagePair = queue.at(i);-
739 const QHttpNetworkRequest &request = messagePair.first;-
740-
741-
742 if (!request.url().userInfo().isEmpty()
!request.url()...fo().isEmpty()Description
TRUEnever evaluated
FALSEevaluated 772 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
0-772
743 continue;
never executed: continue;
0
744-
745-
746 if (request.operation() != QHttpNetworkRequest::Get
request.operat...rkRequest::GetDescription
TRUEevaluated 370 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
FALSEevaluated 402 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
370-402
747 continue;
executed 370 times by 1 test: continue;
Executed by:
  • tst_QHttpNetworkConnection
370
748-
749 if (!request.isPipeliningAllowed()
!request.isPipeliningAllowed()Description
TRUEnever evaluated
FALSEevaluated 402 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
0-402
750 continue;
never executed: continue;
0
751-
752-
753 queue.takeAt(i);-
754-
755-
756-
757-
758 if (!messagePair.second->d_func()->requestIsPrepared
!messagePair.s...uestIsPreparedDescription
TRUEevaluated 402 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
)
0-402
759 prepareRequest(messagePair);
executed 402 times by 2 tests: prepareRequest(messagePair);
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
402
760 channel.pipelineInto(messagePair);-
761-
762-
763 return
executed 402 times by 2 tests: return false;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
false;
executed 402 times by 2 tests: return false;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
402
764 }-
765-
766-
767 return
executed 11 times by 1 test: return true;
Executed by:
  • tst_QHttpNetworkConnection
true;
executed 11 times by 1 test: return true;
Executed by:
  • tst_QHttpNetworkConnection
11
768}-
769-
770-
771QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket *socket, const QString &extraDetail)-
772{-
773 QString errorString;-
774 switch (errorCode) {-
775 case
executed 6 times by 3 tests: case QNetworkReply::HostNotFoundError:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
QNetworkReply::HostNotFoundError:
executed 6 times by 3 tests: case QNetworkReply::HostNotFoundError:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
6
776 if (socket
socketDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
)
2-4
777 errorString = QCoreApplication::translate("QHttp", "Host %1 not found").arg(socket->peerName());
executed 2 times by 1 test: errorString = QCoreApplication::translate("QHttp", "Host %1 not found").arg(socket->peerName());
Executed by:
  • tst_QNetworkReply
2
778 else-
779 errorString = QCoreApplication::translate("QHttp", "Host %1 not found").arg(hostName);
executed 4 times by 3 tests: errorString = QCoreApplication::translate("QHttp", "Host %1 not found").arg(hostName);
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
4
780 break;
executed 6 times by 3 tests: break;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
6
781 case
executed 124 times by 2 tests: case QNetworkReply::ConnectionRefusedError:
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
QNetworkReply::ConnectionRefusedError:
executed 124 times by 2 tests: case QNetworkReply::ConnectionRefusedError:
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
124
782 errorString = QCoreApplication::translate("QHttp", "Connection refused");-
783 break;
executed 124 times by 2 tests: break;
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
124
784 case
executed 35 times by 3 tests: case QNetworkReply::RemoteHostClosedError:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
QNetworkReply::RemoteHostClosedError:
executed 35 times by 3 tests: case QNetworkReply::RemoteHostClosedError:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
35
785 errorString = QCoreApplication::translate("QHttp", "Connection closed");-
786 break;
executed 35 times by 3 tests: break;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
35
787 case
never executed: case QNetworkReply::TimeoutError:
QNetworkReply::TimeoutError:
never executed: case QNetworkReply::TimeoutError:
0
788 errorString = QCoreApplication::translate("QAbstractSocket", "Socket operation timed out");-
789 break;
never executed: break;
0
790 case
executed 9 times by 2 tests: case QNetworkReply::ProxyAuthenticationRequiredError:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
QNetworkReply::ProxyAuthenticationRequiredError:
executed 9 times by 2 tests: case QNetworkReply::ProxyAuthenticationRequiredError:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
9
791 errorString = QCoreApplication::translate("QHttp", "Proxy requires authentication");-
792 break;
executed 9 times by 2 tests: break;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
9
793 case
executed 37 times by 2 tests: case QNetworkReply::AuthenticationRequiredError:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
QNetworkReply::AuthenticationRequiredError:
executed 37 times by 2 tests: case QNetworkReply::AuthenticationRequiredError:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
37
794 errorString = QCoreApplication::translate("QHttp", "Host requires authentication");-
795 break;
executed 37 times by 2 tests: break;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
37
796 case
executed 1 time by 1 test: case QNetworkReply::ProtocolFailure:
Executed by:
  • tst_QNetworkReply
QNetworkReply::ProtocolFailure:
executed 1 time by 1 test: case QNetworkReply::ProtocolFailure:
Executed by:
  • tst_QNetworkReply
1
797 errorString = QCoreApplication::translate("QHttp", "Data corrupted");-
798 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QNetworkReply
1
799 case
never executed: case QNetworkReply::ProtocolUnknownError:
QNetworkReply::ProtocolUnknownError:
never executed: case QNetworkReply::ProtocolUnknownError:
0
800 errorString = QCoreApplication::translate("QHttp", "Unknown protocol specified");-
801 break;
never executed: break;
0
802 case
executed 12 times by 3 tests: case QNetworkReply::SslHandshakeFailedError:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
QNetworkReply::SslHandshakeFailedError:
executed 12 times by 3 tests: case QNetworkReply::SslHandshakeFailedError:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
12
803 errorString = QCoreApplication::translate("QHttp", "SSL handshake failed");-
804 break;
executed 12 times by 3 tests: break;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
12
805 case
executed 1 time by 1 test: case QNetworkReply::TooManyRedirectsError:
Executed by:
  • tst_QNetworkReply
QNetworkReply::TooManyRedirectsError:
executed 1 time by 1 test: case QNetworkReply::TooManyRedirectsError:
Executed by:
  • tst_QNetworkReply
1
806 errorString = QCoreApplication::translate("QHttp", "Too many redirects");-
807 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QNetworkReply
1
808 case
never executed: case QNetworkReply::InsecureRedirectError:
QNetworkReply::InsecureRedirectError:
never executed: case QNetworkReply::InsecureRedirectError:
0
809 errorString = QCoreApplication::translate("QHttp", "Insecure redirect");-
810 break;
never executed: break;
0
811 default
executed 4 times by 2 tests: default:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
:
executed 4 times by 2 tests: default:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
4
812-
813 errorString = extraDetail;-
814 break;
executed 4 times by 2 tests: break;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
4
815 }-
816 return
executed 229 times by 4 tests: return errorString;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
errorString;
executed 229 times by 4 tests: return errorString;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
229
817}-
818-
819-
820-
821void QHttpNetworkConnectionPrivate::removeReply(QHttpNetworkReply *reply)-
822{-
823 QHttpNetworkConnection * const q = q_func();-
824-
825-
826 for (int i = 0; i < channelCount
i < channelCountDescription
TRUEevaluated 6232 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 1537 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
; ++i) {
1537-6232
827-
828 if (channels[i].reply == reply
channels[i].reply == replyDescription
TRUEevaluated 25 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
FALSEevaluated 6207 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
25-6207
829 channels[i].reply = 0;-
830 if (channels[i].protocolHandler
channels[i].protocolHandlerDescription
TRUEevaluated 25 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
FALSEnever evaluated
)
0-25
831 channels[i].protocolHandler->setReply(0);
executed 25 times by 3 tests: channels[i].protocolHandler->setReply(0);
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
25
832 channels[i].request = QHttpNetworkRequest();-
833 channels[i].resendCurrent = false;-
834-
835 if (!reply->isFinished()
!reply->isFinished()Description
TRUEevaluated 19 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNetworkReply
&& !channels[i].alreadyPipelinedRequests.isEmpty()
!channels[i].a...ests.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 19 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
) {
0-19
836-
837-
838 channels[i].requeueCurrentlyPipelinedRequests();-
839 }
never executed: end of block
0
840-
841-
842-
843-
844 if (reply->d_func()->isConnectionCloseEnabled()
reply->d_func(...CloseEnabled()Description
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
FALSEevaluated 5 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
|| !reply->isFinished()
!reply->isFinished()Description
TRUEevaluated 5 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-20
845 if (reply->isAborted()
reply->isAborted()Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 12 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
) {
12-13
846 channels[i].abort();-
847 }
executed 13 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else {
13
848 channels[i].close();-
849 }
executed 11 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
11
850 }-
851-
852 QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);-
853 return;
executed 24 times by 3 tests: return;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
24
854 }-
855-
856-
857 for (int j = 0; j < channels[i].alreadyPipelinedRequests.length()
j < channels[i...uests.length()Description
TRUEevaluated 105 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 6207 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
; j++) {
105-6207
858 if (channels[i].alreadyPipelinedRequests.at(j).second == reply
channels[i].al...econd == replyDescription
TRUEnever evaluated
FALSEevaluated 105 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
0-105
859-
860 channels[i].alreadyPipelinedRequests.removeAt(j);-
861-
862 channels[i].requeueCurrentlyPipelinedRequests();-
863-
864-
865-
866-
867-
868 if (channels[i].reply
channels[i].replyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
869 channels[i].reply->d_func()->forceConnectionCloseEnabled = true;
never executed: channels[i].reply->d_func()->forceConnectionCloseEnabled = true;
0
870-
871 QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);-
872 return;
never executed: return;
0
873 }-
874 }
executed 105 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
105
875-
876-
877 QMultiMap<int, HttpMessagePair>::iterator it = channels[i].spdyRequestsToSend.begin();-
878 QMultiMap<int, HttpMessagePair>::iterator end = channels[i].spdyRequestsToSend.end();-
879 for (; it != end
it != endDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_Spdy
FALSEevaluated 6202 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
; ++it) {
5-6202
880 if (it.value().second == reply
it.value().second == replyDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_Spdy
FALSEnever evaluated
) {
0-5
881 channels[i].spdyRequestsToSend.remove(it.key());-
882-
883 QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);-
884 return;
executed 5 times by 1 test: return;
Executed by:
  • tst_Spdy
5
885 }-
886 }
never executed: end of block
0
887-
888 }
executed 6202 times by 7 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
6202
889-
890 if (!highPriorityQueue.isEmpty()
!highPriorityQueue.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 1537 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
0-1537
891 for (int j = highPriorityQueue.count() - 1; j >= 0
j >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --j) {
0
892 HttpMessagePair messagePair = highPriorityQueue.at(j);-
893 if (messagePair.second == reply
messagePair.second == replyDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
894 highPriorityQueue.removeAt(j);-
895 QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);-
896 return;
never executed: return;
0
897 }-
898 }
never executed: end of block
0
899 }
never executed: end of block
0
900-
901 if (!lowPriorityQueue.isEmpty()
!lowPriorityQueue.isEmpty()Description
TRUEevaluated 90 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 1447 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
90-1447
902 for (int j = lowPriorityQueue.count() - 1; j >= 0
j >= 0Description
TRUEevaluated 437 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 83 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
; --j) {
83-437
903 HttpMessagePair messagePair = lowPriorityQueue.at(j);-
904 if (messagePair.second == reply
messagePair.second == replyDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 430 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
7-430
905 lowPriorityQueue.removeAt(j);-
906 QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);-
907 return;
executed 7 times by 1 test: return;
Executed by:
  • tst_QNetworkReply
7
908 }-
909 }
executed 430 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
430
910 }
executed 83 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
83
911}
executed 1530 times by 7 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
1530
912-
913-
914-
915-
916-
917-
918void QHttpNetworkConnectionPrivate::_q_startNextRequest()-
919{-
920-
921 if (networkLayerState == Unknown
networkLayerState == UnknownDescription
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 5341 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
|| networkLayerState == HostLookupPending
networkLayerSt...tLookupPendingDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_Spdy
FALSEevaluated 5339 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
|| networkLayerState == IPv4or6
networkLayerState == IPv4or6Description
TRUEnever evaluated
FALSEevaluated 5339 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
)
0-5341
922 return;
executed 5 times by 3 tests: return;
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
5
923-
924-
925 if (state == PausedState
state == PausedStateDescription
TRUEnever evaluated
FALSEevaluated 5339 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
)
0-5339
926 return;
never executed: return;
0
927-
928-
929 for (int i = 0; i < channelCount
i < channelCountDescription
TRUEevaluated 25349 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 5339 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
; ++i) {
5339-25349
930 if (channels[i].resendCurrent
channels[i].resendCurrentDescription
TRUEevaluated 241 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 25108 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
&& (
(channels[i].s...:ClosingState)Description
TRUEevaluated 241 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
channels[i].state != QHttpNetworkConnectionChannel::ClosingState)
(channels[i].s...:ClosingState)Description
TRUEevaluated 241 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-25108
931 channels[i].resendCurrent = false;-
932-
933-
934 if (!channels[i].resetUploadData()
!channels[i].resetUploadData()Description
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 232 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
9-232
935 continue;
executed 9 times by 2 tests: continue;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
9
936 channels[i].sendRequest();-
937 }
executed 232 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
232
938 }
executed 25340 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
25340
939-
940-
941-
942 switch (connectionType) {-
943 case
executed 5214 times by 8 tests: case QHttpNetworkConnection::ConnectionTypeHTTP:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
QHttpNetworkConnection::ConnectionTypeHTTP:
executed 5214 times by 8 tests: case QHttpNetworkConnection::ConnectionTypeHTTP:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
{
5214
944-
945 if (highPriorityQueue.isEmpty()
highPriorityQueue.isEmpty()Description
TRUEevaluated 4862 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 352 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
&& lowPriorityQueue.isEmpty()
lowPriorityQueue.isEmpty()Description
TRUEevaluated 2551 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 2311 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
)
352-4862
946 return;
executed 2551 times by 7 tests: return;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
2551
947-
948-
949 for (int i = 0; i < channelCount
i < channelCountDescription
TRUEevaluated 10056 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 2663 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
; ++i) {
2663-10056
950 if (channels[i].socket
channels[i].socketDescription
TRUEevaluated 6421 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 3635 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
3635-6421
951 if (!channels[i].reply
!channels[i].replyDescription
TRUEevaluated 2834 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 3587 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
&& !channels[i].isSocketBusy()
!channels[i].isSocketBusy()Description
TRUEevaluated 530 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 2304 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
&& channels[i].socket->state() == QAbstractSocket::ConnectedState
channels[i].so...ConnectedStateDescription
TRUEevaluated 474 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 56 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
56-3587
952 if (dequeueRequest(channels[i].socket)
dequeueRequest...els[i].socket)Description
TRUEevaluated 461 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
13-461
953 channels[i].sendRequest();
executed 461 times by 4 tests: channels[i].sendRequest();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
461
954 }
executed 474 times by 4 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
474
955 }
executed 6421 times by 4 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
6421
956 }
executed 10056 times by 7 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
10056
957 break;
executed 2663 times by 7 tests: break;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
2663
958 }-
959 case
executed 125 times by 1 test: case QHttpNetworkConnection::ConnectionTypeSPDY:
Executed by:
  • tst_Spdy
QHttpNetworkConnection::ConnectionTypeSPDY:
executed 125 times by 1 test: case QHttpNetworkConnection::ConnectionTypeSPDY:
Executed by:
  • tst_Spdy
{
125
960-
961 if (channels[0].spdyRequestsToSend.isEmpty()
channels[0].sp...Send.isEmpty()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_Spdy
FALSEevaluated 119 times by 1 test
Evaluated by:
  • tst_Spdy
)
6-119
962 return;
executed 6 times by 1 test: return;
Executed by:
  • tst_Spdy
6
963-
964 if (networkLayerState == IPv4
networkLayerState == IPv4Description
TRUEevaluated 119 times by 1 test
Evaluated by:
  • tst_Spdy
FALSEnever evaluated
)
0-119
965 channels[0].networkLayerPreference = QAbstractSocket::IPv4Protocol;
executed 119 times by 1 test: channels[0].networkLayerPreference = QAbstractSocket::IPv4Protocol;
Executed by:
  • tst_Spdy
119
966 else if (networkLayerState == IPv6
networkLayerState == IPv6Description
TRUEnever evaluated
FALSEnever evaluated
)
0
967 channels[0].networkLayerPreference = QAbstractSocket::IPv6Protocol;
never executed: channels[0].networkLayerPreference = QAbstractSocket::IPv6Protocol;
0
968 channels[0].ensureConnection();-
969 if (channels[0].socket
channels[0].socketDescription
TRUEevaluated 119 times by 1 test
Evaluated by:
  • tst_Spdy
FALSEnever evaluated
&& channels[0].socket->state() == QAbstractSocket::ConnectedState
channels[0].so...ConnectedStateDescription
TRUEevaluated 107 times by 1 test
Evaluated by:
  • tst_Spdy
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_Spdy
0-119
970 && !channels[0].pendingEncrypt
!channels[0].pendingEncryptDescription
TRUEevaluated 107 times by 1 test
Evaluated by:
  • tst_Spdy
FALSEnever evaluated
)
0-107
971 channels[0].sendRequest();
executed 107 times by 1 test: channels[0].sendRequest();
Executed by:
  • tst_Spdy
107
972-
973 break;
executed 119 times by 1 test: break;
Executed by:
  • tst_Spdy
119
974 }-
975 }-
976 if (highPriorityQueue.isEmpty()
highPriorityQueue.isEmpty()Description
TRUEevaluated 2431 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 351 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
&& lowPriorityQueue.isEmpty()
lowPriorityQueue.isEmpty()Description
TRUEevaluated 192 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 2239 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
)
192-2431
977 return;
executed 192 times by 4 tests: return;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
192
978 for (int i = 0; i < channelCount
i < channelCountDescription
TRUEevaluated 9631 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 2590 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
; i++)
2590-9631
979 if (channels[i].socket
channels[i].socketDescription
TRUEevaluated 6303 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 3328 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
&& channels[i].socket->state() == QAbstractSocket::ConnectedState
channels[i].so...ConnectedStateDescription
TRUEevaluated 3885 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 2418 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
2418-6303
980 fillPipeline(channels[i].socket);
executed 3885 times by 2 tests: fillPipeline(channels[i].socket);
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
3885
981-
982-
983-
984-
985 int queuedRequests = highPriorityQueue.count() + lowPriorityQueue.count();-
986-
987-
988-
989 int neededOpenChannels = queuedRequests;-
990 if (preConnectRequests > 0
preConnectRequests > 0Description
TRUEnever evaluated
FALSEevaluated 2590 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
0-2590
991 int normalRequests = queuedRequests - preConnectRequests;-
992 neededOpenChannels = qMax(normalRequests, preConnectRequests);-
993 }
never executed: end of block
0
994 for (int i = 0; i < channelCount
i < channelCountDescription
TRUEevaluated 7244 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 1959 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
&& neededOpenChannels > 0
neededOpenChannels > 0Description
TRUEevaluated 6735 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 509 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
; ++i) {
509-7244
995 bool connectChannel = false;-
996 if (channels[i].socket
channels[i].socketDescription
TRUEevaluated 6238 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 497 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
497-6238
997 if ((
(channels[i].s...nnectingState)Description
TRUEevaluated 2332 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 3906 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
channels[i].socket->state() == QAbstractSocket::ConnectingState)
(channels[i].s...nnectingState)Description
TRUEevaluated 2332 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 3906 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
2332-3906
998 || (
(channels[i].s...stLookupState)Description
TRUEnever evaluated
FALSEevaluated 3906 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
channels[i].socket->state() == QAbstractSocket::HostLookupState)
(channels[i].s...stLookupState)Description
TRUEnever evaluated
FALSEevaluated 3906 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
0-3906
999 || channels[i].pendingEncrypt
channels[i].pendingEncryptDescription
TRUEevaluated 23 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 3883 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
23-3883
1000 neededOpenChannels--;
executed 2355 times by 2 tests: neededOpenChannels--;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
2355
1001-
1002 if (neededOpenChannels <= 0
neededOpenChannels <= 0Description
TRUEevaluated 122 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 6116 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
122-6116
1003 break;
executed 122 times by 2 tests: break;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
122
1004 if (!channels[i].reply
!channels[i].replyDescription
TRUEevaluated 2207 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 3909 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
&& !channels[i].isSocketBusy()
!channels[i].isSocketBusy()Description
TRUEevaluated 47 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 2160 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
&& (
(channels[i].s...onnectedState)Description
TRUEevaluated 47 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
channels[i].socket->state() == QAbstractSocket::UnconnectedState)
(channels[i].s...onnectedState)Description
TRUEevaluated 47 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
)
0-3909
1005 connectChannel = true;
executed 47 times by 2 tests: connectChannel = true;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
47
1006 }
executed 6116 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
else {
6116
1007 connectChannel = true;-
1008 }
executed 497 times by 7 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
497
1009-
1010 if (connectChannel
connectChannelDescription
TRUEevaluated 544 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 6069 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
544-6069
1011 if (networkLayerState == IPv4
networkLayerState == IPv4Description
TRUEevaluated 543 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
)
1-543
1012 channels[i].networkLayerPreference = QAbstractSocket::IPv4Protocol;
executed 543 times by 7 tests: channels[i].networkLayerPreference = QAbstractSocket::IPv4Protocol;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
543
1013 else if (networkLayerState == IPv6
networkLayerState == IPv6Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
)
0-1
1014 channels[i].networkLayerPreference = QAbstractSocket::IPv6Protocol;
executed 1 time by 1 test: channels[i].networkLayerPreference = QAbstractSocket::IPv6Protocol;
Executed by:
  • tst_QNetworkReply
1
1015 channels[i].ensureConnection();-
1016 neededOpenChannels--;-
1017 }
executed 544 times by 7 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
544
1018 }
executed 6613 times by 7 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
6613
1019}
executed 2590 times by 7 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
2590
1020-
1021-
1022void QHttpNetworkConnectionPrivate::readMoreLater(QHttpNetworkReply *reply)-
1023{-
1024 for (int i = 0 ; i < channelCount
i < channelCountDescription
TRUEevaluated 289 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
; ++i) {
16-289
1025 if (channels[i].reply == reply
channels[i].reply == replyDescription
TRUEevaluated 193 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 96 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
96-193
1026-
1027 QMetaObject::invokeMethod(&channels[i], "_q_readyRead", Qt::QueuedConnection);-
1028 return;
executed 193 times by 1 test: return;
Executed by:
  • tst_QNetworkReply
193
1029 }-
1030 }
executed 96 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
96
1031}
executed 16 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
16
1032-
1033-
1034-
1035-
1036-
1037-
1038-
1039void QHttpNetworkConnectionPrivate::startHostInfoLookup()-
1040{-
1041 networkLayerState = HostLookupPending;-
1042-
1043-
1044 QString lookupHost = hostName;-
1045-
1046 if (networkProxy.capabilities() & QNetworkProxy::HostNameLookupCapability
networkProxy.c...okupCapabilityDescription
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 539 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
44-539
1047 lookupHost = networkProxy.hostName();-
1048 }
executed 44 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else if (channels[0].proxy.capabilities() & QNetworkProxy::HostNameLookupCapability
channels[0].pr...okupCapabilityDescription
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 481 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
44-481
1049 lookupHost = channels[0].proxy.hostName();-
1050 }
executed 58 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
58
1051-
1052 QHostAddress temp;-
1053 if (temp.setAddress(lookupHost)
temp.setAddress(lookupHost)Description
TRUEevaluated 108 times by 5 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 475 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
108-475
1054 const QAbstractSocket::NetworkLayerProtocol protocol = temp.protocol();-
1055 if (protocol == QAbstractSocket::IPv4Protocol
protocol == QA...::IPv4ProtocolDescription
TRUEevaluated 107 times by 5 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
1-107
1056 networkLayerState = QHttpNetworkConnectionPrivate::IPv4;-
1057 QMetaObject::invokeMethod(this->q_func(), "_q_startNextRequest", Qt::QueuedConnection);-
1058 return;
executed 107 times by 5 tests: return;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
107
1059 } else if (protocol == QAbstractSocket::IPv6Protocol
protocol == QA...::IPv6ProtocolDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-1
1060 networkLayerState = QHttpNetworkConnectionPrivate::IPv6;-
1061 QMetaObject::invokeMethod(this->q_func(), "_q_startNextRequest", Qt::QueuedConnection);-
1062 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_QNetworkReply
1
1063 }-
1064 }
never executed: end of block
else {
0
1065 int hostLookupId;-
1066 bool immediateResultValid = false;-
1067 QHostInfo hostInfo = qt_qhostinfo_lookup(lookupHost,-
1068 this->q_func(),-
1069 qFlagLocation("1""_q_hostLookupFinished(QHostInfo)" "\0" __FILE__ ":" "1141"),-
1070 &immediateResultValid,-
1071 &hostLookupId);-
1072 if (immediateResultValid
immediateResultValidDescription
TRUEevaluated 460 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 15 times by 5 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
15-460
1073 _q_hostLookupFinished(hostInfo);-
1074 }
executed 460 times by 6 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
460
1075 }
executed 475 times by 7 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
475
1076}-
1077-
1078-
1079void QHttpNetworkConnectionPrivate::_q_hostLookupFinished(const QHostInfo &info)-
1080{-
1081 bool bIpv4 = false;-
1082 bool bIpv6 = false;-
1083 bool foundAddress = false;-
1084 if (networkLayerState == IPv4
networkLayerState == IPv4Description
TRUEnever evaluated
FALSEevaluated 475 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
|| networkLayerState == IPv6
networkLayerState == IPv6Description
TRUEnever evaluated
FALSEevaluated 475 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
|| networkLayerState == IPv4or6
networkLayerState == IPv4or6Description
TRUEnever evaluated
FALSEevaluated 475 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
)
0-475
1085 return;
never executed: return;
0
1086-
1087 const auto addresses = info.addresses();-
1088 for (const QHostAddress &address : addresses) {-
1089 const QAbstractSocket::NetworkLayerProtocol protocol = address.protocol();-
1090 if (protocol == QAbstractSocket::IPv4Protocol
protocol == QA...::IPv4ProtocolDescription
TRUEevaluated 475 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 130 times by 3 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
) {
130-475
1091 if (!foundAddress
!foundAddressDescription
TRUEevaluated 349 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 126 times by 3 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
) {
126-349
1092 foundAddress = true;-
1093 delayIpv4 = false;-
1094 }
executed 349 times by 6 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
349
1095 bIpv4 = true;-
1096 }
executed 475 times by 7 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
else if (protocol == QAbstractSocket::IPv6Protocol
protocol == QA...::IPv6ProtocolDescription
TRUEevaluated 130 times by 3 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-475
1097 if (!foundAddress
!foundAddressDescription
TRUEevaluated 122 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
) {
8-122
1098 foundAddress = true;-
1099 delayIpv4 = true;-
1100 }
executed 122 times by 2 tests: end of block
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
122
1101 bIpv6 = true;-
1102 }
executed 130 times by 3 tests: end of block
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
130
1103 }
executed 605 times by 7 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
605
1104-
1105 if (bIpv4
bIpv4Description
TRUEevaluated 471 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
&& bIpv6
bIpv6Description
TRUEevaluated 126 times by 3 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
FALSEevaluated 345 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
)
4-471
1106 startNetworkLayerStateLookup();
executed 126 times by 3 tests: startNetworkLayerStateLookup();
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
126
1107 else if (bIpv4
bIpv4Description
TRUEevaluated 345 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
) {
4-345
1108 networkLayerState = QHttpNetworkConnectionPrivate::IPv4;-
1109 QMetaObject::invokeMethod(this->q_func(), "_q_startNextRequest", Qt::QueuedConnection);-
1110 }
executed 345 times by 5 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
else if (bIpv6
bIpv6Description
TRUEnever evaluated
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
) {
0-345
1111 networkLayerState = QHttpNetworkConnectionPrivate::IPv6;-
1112 QMetaObject::invokeMethod(this->q_func(), "_q_startNextRequest", Qt::QueuedConnection);-
1113 }
never executed: end of block
else {
0
1114 if (dequeueRequest(channels[0].socket)
dequeueRequest...els[0].socket)Description
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_Spdy
) {
2
1115 emitReplyError(channels[0].socket, channels[0].reply, QNetworkReply::HostNotFoundError);-
1116 networkLayerState = QHttpNetworkConnectionPrivate::Unknown;-
1117 }
executed 2 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
2
1118-
1119 else if (connectionType == QHttpNetworkConnection::ConnectionTypeSPDY
connectionType...ectionTypeSPDYDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_Spdy
FALSEnever evaluated
) {
0-2
1120 for (const HttpMessagePair &spdyPair : qAsConst(channels[0].spdyRequestsToSend)) {-
1121-
1122 QHttpNetworkReply *currentReply = spdyPair.second;-
1123 ((!(currentReply)) ? qt_assert("currentReply",__FILE__,1195) : qt_noop());-
1124 emitReplyError(channels[0].socket, currentReply, QNetworkReply::HostNotFoundError);-
1125 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_Spdy
2
1126 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_Spdy
2
1127-
1128 else {-
1129-
1130 QMessageLogger(__FILE__, 1202, __PRETTY_FUNCTION__).warning("QHttpNetworkConnectionPrivate::_q_hostLookupFinished could not de-queue request");-
1131 networkLayerState = QHttpNetworkConnectionPrivate::Unknown;-
1132 }
never executed: end of block
0
1133 }-
1134}-
1135-
1136-
1137-
1138-
1139-
1140-
1141void QHttpNetworkConnectionPrivate::startNetworkLayerStateLookup()-
1142{-
1143 if (channelCount > 1
channelCount > 1Description
TRUEevaluated 126 times by 3 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-126
1144-
1145 ((!(!channels[0].isSocketBusy())) ? qt_assert("!channels[0].isSocketBusy()",__FILE__,1217) : qt_noop());-
1146 ((!(!channels[1].isSocketBusy())) ? qt_assert("!channels[1].isSocketBusy()",__FILE__,1218) : qt_noop());-
1147-
1148 networkLayerState = IPv4or6;-
1149-
1150 channels[0].networkLayerPreference = QAbstractSocket::IPv4Protocol;-
1151 channels[1].networkLayerPreference = QAbstractSocket::IPv6Protocol;-
1152-
1153 int timeout = 300;-
1154-
1155 if (networkSession
networkSessionDescription
TRUEevaluated 126 times by 3 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-126
1156 const QNetworkConfiguration::BearerType bearerType = networkSession->configuration().bearerType();-
1157 if (bearerType == QNetworkConfiguration::Bearer2G
bearerType == ...tion::Bearer2GDescription
TRUEnever evaluated
FALSEevaluated 126 times by 3 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
)
0-126
1158 timeout = 800;
never executed: timeout = 800;
0
1159 else if (bearerType == QNetworkConfiguration::BearerCDMA2000
bearerType == ...BearerCDMA2000Description
TRUEnever evaluated
FALSEevaluated 126 times by 3 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
)
0-126
1160 timeout = 500;
never executed: timeout = 500;
0
1161 else if (bearerType == QNetworkConfiguration::BearerWCDMA
bearerType == ...n::BearerWCDMADescription
TRUEnever evaluated
FALSEevaluated 126 times by 3 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
)
0-126
1162 timeout = 500;
never executed: timeout = 500;
0
1163 else if (bearerType == QNetworkConfiguration::BearerHSPA
bearerType == ...on::BearerHSPADescription
TRUEnever evaluated
FALSEevaluated 126 times by 3 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
)
0-126
1164 timeout = 400;
never executed: timeout = 400;
0
1165 }
executed 126 times by 3 tests: end of block
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
126
1166-
1167 delayedConnectionTimer.start(timeout);-
1168 if (delayIpv4
delayIpv4Description
TRUEevaluated 122 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
)
4-122
1169 channels[1].ensureConnection();
executed 122 times by 2 tests: channels[1].ensureConnection();
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
122
1170 else-
1171 channels[0].ensureConnection();
executed 4 times by 2 tests: channels[0].ensureConnection();
Executed by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
4
1172 } else {-
1173 networkLayerState = IPv4or6;-
1174 channels[0].networkLayerPreference = QAbstractSocket::AnyIPProtocol;-
1175 channels[0].ensureConnection();-
1176 }
never executed: end of block
0
1177}-
1178-
1179void QHttpNetworkConnectionPrivate::networkLayerDetected(QAbstractSocket::NetworkLayerProtocol protocol)-
1180{-
1181 for (int i = 0 ; i < channelCount
i < channelCountDescription
TRUEevaluated 744 times by 2 tests
Evaluated by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
FALSEevaluated 124 times by 2 tests
Evaluated by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
; ++i) {
124-744
1182 if ((
(channels[i].n...e != protocol)Description
TRUEevaluated 620 times by 2 tests
Evaluated by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
FALSEevaluated 124 times by 2 tests
Evaluated by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
channels[i].networkLayerPreference != protocol)
(channels[i].n...e != protocol)Description
TRUEevaluated 620 times by 2 tests
Evaluated by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
FALSEevaluated 124 times by 2 tests
Evaluated by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
&& (
(channels[i].s...nnectingState)Description
TRUEnever evaluated
FALSEevaluated 620 times by 2 tests
Evaluated by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
channels[i].state == QHttpNetworkConnectionChannel::ConnectingState)
(channels[i].s...nnectingState)Description
TRUEnever evaluated
FALSEevaluated 620 times by 2 tests
Evaluated by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
) {
0-620
1183 channels[i].close();-
1184 }
never executed: end of block
0
1185 }
executed 744 times by 2 tests: end of block
Executed by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
744
1186}
executed 124 times by 2 tests: end of block
Executed by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
124
1187-
1188void QHttpNetworkConnectionPrivate::_q_connectDelayedChannel()-
1189{-
1190 if (delayIpv4
delayIpv4Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1191 channels[0].ensureConnection();
never executed: channels[0].ensureConnection();
0
1192 else-
1193 channels[1].ensureConnection();
never executed: channels[1].ensureConnection();
0
1194}-
1195-
1196-
1197QHttpNetworkConnection::QHttpNetworkConnection(const QString &hostName, quint16 port, bool encrypt,-
1198 QHttpNetworkConnection::ConnectionType connectionType,-
1199 QObject *parent, QSharedPointer<QNetworkSession> networkSession)-
1200 : QObject(*(new QHttpNetworkConnectionPrivate(hostName, port, encrypt, connectionType)), parent)-
1201{-
1202 QHttpNetworkConnectionPrivate * const d = d_func();-
1203 d->networkSession = std::move(networkSession);-
1204 d->init();-
1205}
executed 575 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
575
1206-
1207QHttpNetworkConnection::QHttpNetworkConnection(quint16 connectionCount, const QString &hostName,-
1208 quint16 port, bool encrypt, QObject *parent,-
1209 QSharedPointer<QNetworkSession> networkSession,-
1210 QHttpNetworkConnection::ConnectionType connectionType)-
1211 : QObject(*(new QHttpNetworkConnectionPrivate(connectionCount, hostName, port, encrypt,-
1212 connectionType)), parent)-
1213{-
1214 QHttpNetworkConnectionPrivate * const d = d_func();-
1215 d->networkSession = std::move(networkSession);-
1216 d->init();-
1217}
executed 8 times by 1 test: end of block
Executed by:
  • tst_QHttpNetworkConnection
8
1218QHttpNetworkConnection::~QHttpNetworkConnection()-
1219{-
1220}-
1221-
1222QString QHttpNetworkConnection::hostName() const-
1223{-
1224 const QHttpNetworkConnectionPrivate * const d = d_func();-
1225 return
executed 22 times by 1 test: return d->hostName;
Executed by:
  • tst_QHttpNetworkConnection
d->hostName;
executed 22 times by 1 test: return d->hostName;
Executed by:
  • tst_QHttpNetworkConnection
22
1226}-
1227-
1228quint16 QHttpNetworkConnection::port() const-
1229{-
1230 const QHttpNetworkConnectionPrivate * const d = d_func();-
1231 return
executed 22 times by 1 test: return d->port;
Executed by:
  • tst_QHttpNetworkConnection
d->port;
executed 22 times by 1 test: return d->port;
Executed by:
  • tst_QHttpNetworkConnection
22
1232}-
1233-
1234QHttpNetworkReply* QHttpNetworkConnection::sendRequest(const QHttpNetworkRequest &request)-
1235{-
1236 QHttpNetworkConnectionPrivate * const d = d_func();-
1237 return
executed 1646 times by 8 tests: return d->queueRequest(request);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
d->queueRequest(request);
executed 1646 times by 8 tests: return d->queueRequest(request);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1646
1238}-
1239-
1240bool QHttpNetworkConnection::isSsl() const-
1241{-
1242 const QHttpNetworkConnectionPrivate * const d = d_func();-
1243 return
executed 22 times by 1 test: return d->encrypt;
Executed by:
  • tst_QHttpNetworkConnection
d->encrypt;
executed 22 times by 1 test: return d->encrypt;
Executed by:
  • tst_QHttpNetworkConnection
22
1244}-
1245-
1246QHttpNetworkConnectionChannel *QHttpNetworkConnection::channels() const-
1247{-
1248 return
never executed: return d_func()->channels;
d_func()->channels;
never executed: return d_func()->channels;
0
1249}-
1250-
1251-
1252void QHttpNetworkConnection::setCacheProxy(const QNetworkProxy &networkProxy)-
1253{-
1254 QHttpNetworkConnectionPrivate * const d = d_func();-
1255 d->networkProxy = networkProxy;-
1256-
1257 if (!d->networkProxy.user().isEmpty()
!d->networkPro...er().isEmpty()Description
TRUEnever evaluated
FALSEevaluated 551 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
0-551
1258 for (int i = 0; i < d->channelCount
i < d->channelCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1259 d->channels[i].proxyAuthenticator.setUser(d->networkProxy.user());-
1260 d->channels[i].proxyAuthenticator.setPassword(d->networkProxy.password());-
1261 }
never executed: end of block
0
1262 }
never executed: end of block
0
1263}
executed 551 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
551
1264-
1265QNetworkProxy QHttpNetworkConnection::cacheProxy() const-
1266{-
1267 const QHttpNetworkConnectionPrivate * const d = d_func();-
1268 return
executed 700 times by 8 tests: return d->networkProxy;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
d->networkProxy;
executed 700 times by 8 tests: return d->networkProxy;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
700
1269}-
1270-
1271void QHttpNetworkConnection::setTransparentProxy(const QNetworkProxy &networkProxy)-
1272{-
1273 QHttpNetworkConnectionPrivate * const d = d_func();-
1274 for (int i = 0; i < d->channelCount
i < d->channelCountDescription
TRUEevaluated 3251 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 551 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
; ++i)
551-3251
1275 d->channels[i].setProxy(networkProxy);
executed 3251 times by 8 tests: d->channels[i].setProxy(networkProxy);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
3251
1276}
executed 551 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
551
1277-
1278QNetworkProxy QHttpNetworkConnection::transparentProxy() const-
1279{-
1280 const QHttpNetworkConnectionPrivate * const d = d_func();-
1281 return
executed 700 times by 8 tests: return d->channels[0].proxy;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
d->channels[0].proxy;
executed 700 times by 8 tests: return d->channels[0].proxy;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
700
1282}-
1283-
1284-
1285QHttpNetworkConnection::ConnectionType QHttpNetworkConnection::connectionType()-
1286{-
1287 QHttpNetworkConnectionPrivate * const d = d_func();-
1288 return
executed 227 times by 4 tests: return d->connectionType;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
d->connectionType;
executed 227 times by 4 tests: return d->connectionType;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
227
1289}-
1290-
1291void QHttpNetworkConnection::setConnectionType(ConnectionType type)-
1292{-
1293 QHttpNetworkConnectionPrivate * const d = d_func();-
1294 d->connectionType = type;-
1295}
executed 91 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
91
1296-
1297-
1298-
1299void QHttpNetworkConnection::setSslConfiguration(const QSslConfiguration &config)-
1300{-
1301 QHttpNetworkConnectionPrivate * const d = d_func();-
1302 if (!d->encrypt
!d->encryptDescription
TRUEnever evaluated
FALSEevaluated 57 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
0-57
1303 return;
never executed: return;
0
1304-
1305-
1306 for (int i = 0; i < d->channelCount
i < d->channelCountDescription
TRUEevaluated 287 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 57 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
; ++i)
57-287
1307 d->channels[i].setSslConfiguration(config);
executed 287 times by 2 tests: d->channels[i].setSslConfiguration(config);
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
287
1308}
executed 57 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
57
1309-
1310QSharedPointer<QSslContext> QHttpNetworkConnection::sslContext()-
1311{-
1312 QHttpNetworkConnectionPrivate * const d = d_func();-
1313 return
executed 274 times by 3 tests: return d->sslContext;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
d->sslContext;
executed 274 times by 3 tests: return d->sslContext;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
274
1314}-
1315-
1316void QHttpNetworkConnection::setSslContext(QSharedPointer<QSslContext> context)-
1317{-
1318 QHttpNetworkConnectionPrivate * const d = d_func();-
1319 d->sslContext = std::move(context);-
1320}
executed 95 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
95
1321-
1322void QHttpNetworkConnection::ignoreSslErrors(int channel)-
1323{-
1324 QHttpNetworkConnectionPrivate * const d = d_func();-
1325 if (!d->encrypt
!d->encryptDescription
TRUEnever evaluated
FALSEevaluated 34 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
)
0-34
1326 return;
never executed: return;
0
1327-
1328 if (channel == -1
channel == -1Description
TRUEevaluated 34 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
) {
0-34
1329 for (int i = 0; i < d->channelCount
i < d->channelCountDescription
TRUEevaluated 174 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 34 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
; ++i) {
34-174
1330 d->channels[i].ignoreSslErrors();-
1331 }
executed 174 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
174
1332-
1333 }
executed 34 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
else {
34
1334 d->channels[channel].ignoreSslErrors();-
1335 }
never executed: end of block
0
1336}-
1337-
1338void QHttpNetworkConnection::ignoreSslErrors(const QList<QSslError> &errors, int channel)-
1339{-
1340 QHttpNetworkConnectionPrivate * const d = d_func();-
1341 if (!d->encrypt
!d->encryptDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
0-6
1342 return;
never executed: return;
0
1343-
1344 if (channel == -1
channel == -1Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-6
1345 for (int i = 0; i < d->channelCount
i < d->channelCountDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNetworkReply
; ++i) {
6-36
1346 d->channels[i].ignoreSslErrors(errors);-
1347 }
executed 36 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
36
1348-
1349 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else {
6
1350 d->channels[channel].ignoreSslErrors(errors);-
1351 }
never executed: end of block
0
1352}-
1353-
1354-
1355-
1356void QHttpNetworkConnection::preConnectFinished()-
1357{-
1358 d_func()->preConnectRequests--;-
1359}
never executed: end of block
0
1360-
1361-
1362-
1363-
1364-
1365void QHttpNetworkConnectionPrivate::emitProxyAuthenticationRequired(const QHttpNetworkConnectionChannel *chan, const QNetworkProxy &proxy, QAuthenticator* auth)-
1366{-
1367-
1368-
1369 pauseConnection();-
1370 QHttpNetworkReply *reply;-
1371-
1372 if (connectionType == QHttpNetworkConnection::ConnectionTypeSPDY
connectionType...ectionTypeSPDYDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_Spdy
FALSEevaluated 39 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
3-39
1373-
1374-
1375-
1376 ((!(chan->spdyRequestsToSend.count() > 0)) ? qt_assert("chan->spdyRequestsToSend.count() > 0",__FILE__,1468) : qt_noop());-
1377 reply = chan->spdyRequestsToSend.cbegin().value().second;-
1378 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_Spdy
else {
3
1379-
1380 reply = chan->reply;-
1381-
1382 }
executed 39 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
39
1383-
1384-
1385 ((!(reply)) ? qt_assert("reply",__FILE__,1477) : qt_noop());-
1386 reply->proxyAuthenticationRequired(proxy, auth);-
1387 resumeConnection();-
1388 int i = indexOf(chan->socket);-
1389 copyCredentials(i, auth, true);-
1390}
executed 42 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
42
1391-
1392-
1393-
1394-
1395-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9