qhttpthreaddelegate.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/access/qhttpthreaddelegate.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8static QNetworkReply::NetworkError statusCodeFromHttp(int httpStatusCode, const QUrl &url)-
9{-
10 QNetworkReply::NetworkError code;-
11-
12 switch (httpStatusCode) {-
13 case
executed 1 time by 1 test: case 400:
Executed by:
  • tst_QNetworkReply
400:
executed 1 time by 1 test: case 400:
Executed by:
  • tst_QNetworkReply
1
14 code = QNetworkReply::ProtocolInvalidOperationError;-
15 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QNetworkReply
1
16-
17 case
never executed: case 401:
401:
never executed: case 401:
0
18 code = QNetworkReply::AuthenticationRequiredError;-
19 break;
never executed: break;
0
20-
21 case
executed 1 time by 1 test: case 403:
Executed by:
  • tst_QNetworkReply
403:
executed 1 time by 1 test: case 403:
Executed by:
  • tst_QNetworkReply
1
22 code = QNetworkReply::ContentOperationNotPermittedError;-
23 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QNetworkReply
1
24-
25 case
executed 5 times by 2 tests: case 404:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
404:
executed 5 times by 2 tests: case 404:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
5
26 code = QNetworkReply::ContentNotFoundError;-
27 break;
executed 5 times by 2 tests: break;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
5
28-
29 case
executed 1 time by 1 test: case 405:
Executed by:
  • tst_QNetworkReply
405:
executed 1 time by 1 test: case 405:
Executed by:
  • tst_QNetworkReply
1
30 code = QNetworkReply::ContentOperationNotPermittedError;-
31 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QNetworkReply
1
32-
33 case
never executed: case 407:
407:
never executed: case 407:
0
34 code = QNetworkReply::ProxyAuthenticationRequiredError;-
35 break;
never executed: break;
0
36-
37 case
never executed: case 409:
409:
never executed: case 409:
0
38 code = QNetworkReply::ContentConflictError;-
39 break;
never executed: break;
0
40-
41 case
never executed: case 410:
410:
never executed: case 410:
0
42 code = QNetworkReply::ContentGoneError;-
43 break;
never executed: break;
0
44-
45 case
never executed: case 418:
418:
never executed: case 418:
0
46 code = QNetworkReply::ProtocolInvalidOperationError;-
47 break;
never executed: break;
0
48-
49 case
never executed: case 500:
500:
never executed: case 500:
0
50 code = QNetworkReply::InternalServerError;-
51 break;
never executed: break;
0
52-
53 case
executed 1 time by 1 test: case 501:
Executed by:
  • tst_QNetworkReply
501:
executed 1 time by 1 test: case 501:
Executed by:
  • tst_QNetworkReply
1
54 code = QNetworkReply::OperationNotImplementedError;-
55 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QNetworkReply
1
56-
57 case
never executed: case 503:
503:
never executed: case 503:
0
58 code = QNetworkReply::ServiceUnavailableError;-
59 break;
never executed: break;
0
60-
61 default
never executed: default:
:
never executed: default:
0
62 if (httpStatusCode > 500
httpStatusCode > 500Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
63-
64 code = QNetworkReply::UnknownServerError;-
65 }
never executed: end of block
else if (httpStatusCode >= 400
httpStatusCode >= 400Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
66-
67 code = QNetworkReply::UnknownContentError;-
68 }
never executed: end of block
else {
0
69 QMessageLogger(__FILE__, 117, __PRETTY_FUNCTION__).warning("QNetworkAccess: got HTTP status code %d which is not expected from url: \"%s\"",-
70 httpStatusCode, QString(url.toString()).toLocal8Bit().constData());-
71 code = QNetworkReply::ProtocolFailure;-
72 }
never executed: end of block
0
73 }-
74-
75 return
executed 9 times by 2 tests: return code;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
code;
executed 9 times by 2 tests: return code;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
9
76}-
77-
78-
79static QByteArray makeCacheKey(QUrl &url, QNetworkProxy *proxy)-
80{-
81 QString result;-
82 QUrl copy = url;-
83 QString scheme = copy.scheme();-
84 bool isEncrypted = scheme == QLatin1String("https");-
85 copy.setPort(copy.port(isEncrypted ? 443 : 80));-
86 if (scheme == QLatin1String("preconnect-http")
scheme == QLat...connect-http")Description
TRUEnever evaluated
FALSEevaluated 872 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-872
87 copy.setScheme(QLatin1String("http"));-
88 }
never executed: end of block
else if (scheme == QLatin1String("preconnect-https")
scheme == QLat...onnect-https")Description
TRUEnever evaluated
FALSEevaluated 872 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-872
89 copy.setScheme(QLatin1String("https"));-
90 }
never executed: end of block
0
91 result = copy.toString(QUrl::RemoveUserInfo | QUrl::RemovePath |-
92 QUrl::RemoveQuery | QUrl::RemoveFragment | QUrl::FullyEncoded);-
93-
94-
95 if (proxy
proxyDescription
TRUEevaluated 139 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 733 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
&& proxy->type() != QNetworkProxy::NoProxy
proxy->type() ...Proxy::NoProxyDescription
TRUEevaluated 139 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
) {
0-733
96 QUrl key;-
97-
98 switch (proxy->type()) {-
99 case
executed 62 times by 2 tests: case QNetworkProxy::Socks5Proxy:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
QNetworkProxy::Socks5Proxy:
executed 62 times by 2 tests: case QNetworkProxy::Socks5Proxy:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
62
100 key.setScheme(QLatin1String("proxy-socks5"));-
101 break;
executed 62 times by 2 tests: break;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
62
102-
103 case
executed 69 times by 2 tests: case QNetworkProxy::HttpProxy:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
QNetworkProxy::HttpProxy:
executed 69 times by 2 tests: case QNetworkProxy::HttpProxy:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
69
104 case
executed 8 times by 1 test: case QNetworkProxy::HttpCachingProxy:
Executed by:
  • tst_QNetworkReply
QNetworkProxy::HttpCachingProxy:
executed 8 times by 1 test: case QNetworkProxy::HttpCachingProxy:
Executed by:
  • tst_QNetworkReply
8
105 key.setScheme(QLatin1String("proxy-http"));-
106 break;
executed 77 times by 2 tests: break;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
77
107-
108 default
never executed: default:
:
never executed: default:
0
109 break;
never executed: break;
0
110 }-
111-
112 if (!key.scheme().isEmpty()
!key.scheme().isEmpty()Description
TRUEevaluated 139 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
) {
0-139
113 key.setUserName(proxy->user());-
114 key.setHost(proxy->hostName());-
115 key.setPort(proxy->port());-
116 key.setQuery(result);-
117 result = key.toString(QUrl::FullyEncoded);-
118 }
executed 139 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
139
119 }
executed 139 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
139
120-
121-
122-
123-
124 return
executed 872 times by 8 tests: return "http-connection:" + result.toLatin1();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
"http-connection:" + result.toLatin1();
executed 872 times by 8 tests: return "http-connection:" + result.toLatin1();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
872
125}-
126-
127class QNetworkAccessCachedHttpConnection: public QHttpNetworkConnection,-
128 public QNetworkAccessCache::CacheableObject-
129{-
130-
131public:-
132-
133-
134-
135-
136-
137 QNetworkAccessCachedHttpConnection(const QString &hostName, quint16 port, bool encrypt,-
138 QHttpNetworkConnection::ConnectionType connectionType,-
139 QSharedPointer<QNetworkSession> networkSession)-
140 : QHttpNetworkConnection(hostName, port, encrypt, connectionType, 0,-
141 std::move(networkSession))-
142-
143 {-
144 setExpires(true);-
145 setShareable(true);-
146 }
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
147-
148 virtual void dispose() override-
149 {-
150-
151-
152-
153 delete this;-
154 }
executed 550 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
550
155};-
156-
157-
158QThreadStorage<QNetworkAccessCache *> QHttpThreadDelegate::connections;-
159-
160-
161QHttpThreadDelegate::~QHttpThreadDelegate()-
162{-
163-
164 if (httpReply
httpReplyDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
FALSEevaluated 859 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
8-859
165 delete httpReply;-
166 }
executed 8 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
8
167-
168-
169-
170 if (connections.hasLocalData()
connections.hasLocalData()Description
TRUEevaluated 791 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 76 times by 1 test
Evaluated by:
  • tst_QNetworkReply
&& !cacheKey.isEmpty()
!cacheKey.isEmpty()Description
TRUEevaluated 791 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-791
171 connections.localData()->releaseEntry(cacheKey);-
172 }
executed 791 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
791
173}
executed 867 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
867
174-
175-
176QHttpThreadDelegate::QHttpThreadDelegate(QObject *parent) :-
177 QObject(parent)-
178 , ssl(false)-
179 , downloadBufferMaximumSize(0)-
180 , readBufferMaxSize(0)-
181 , bytesEmitted(0)-
182 , pendingDownloadData()-
183 , pendingDownloadProgress()-
184 , synchronous(false)-
185 , incomingStatusCode(0)-
186 , isPipeliningUsed(false)-
187 , isSpdyUsed(false)-
188 , incomingContentLength(-1)-
189 , incomingErrorCode(QNetworkReply::NoError)-
190 , downloadBuffer()-
191 , httpConnection(0)-
192 , httpReply(0)-
193 , synchronousRequestLoop(0)-
194{-
195}
executed 869 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
869
196-
197-
198void QHttpThreadDelegate::startRequestSynchronously()-
199{-
200-
201-
202-
203 synchronous = true;-
204-
205 QEventLoop synchronousRequestLoop;-
206 this->synchronousRequestLoop = &synchronousRequestLoop;-
207-
208-
209 QTimer::singleShot(30*1000, this, qFlagLocation("1""abortRequest()" "\0" __FILE__ ":" "257"));-
210-
211 QMetaObject::invokeMethod(this, "startRequest", Qt::QueuedConnection);-
212 synchronousRequestLoop.exec();-
213-
214 connections.localData()->releaseEntry(cacheKey);-
215 connections.setLocalData(0);-
216-
217-
218-
219-
220}
executed 76 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
76
221-
222-
223-
224void QHttpThreadDelegate::startRequest()-
225{-
226-
227-
228-
229-
230-
231 if (!connections.hasLocalData()
!connections.hasLocalData()Description
TRUEevaluated 540 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 332 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
) {
332-540
232 connections.setLocalData(new QNetworkAccessCache());-
233 }
executed 540 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
540
234-
235-
236 QUrl urlCopy = httpRequest.url();-
237 urlCopy.setPort(urlCopy.port(ssl ? 443 : 80));-
238-
239 QHttpNetworkConnection::ConnectionType connectionType-
240 = QHttpNetworkConnection::ConnectionTypeHTTP;-
241-
242 if (httpRequest.isSPDYAllowed()
httpRequest.isSPDYAllowed()Description
TRUEevaluated 113 times by 1 test
Evaluated by:
  • tst_Spdy
FALSEevaluated 759 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
&& ssl
sslDescription
TRUEevaluated 112 times by 1 test
Evaluated by:
  • tst_Spdy
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_Spdy
) {
1-759
243 connectionType = QHttpNetworkConnection::ConnectionTypeSPDY;-
244 urlCopy.setScheme(([]() -> QString { enum { Size = sizeof(u"" "spdy")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "spdy" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 112 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_Spdy
qstring_literal_temp;
executed 112 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_Spdy
}()));
112
245 QList<QByteArray> nextProtocols;-
246 nextProtocols << QSslConfiguration::NextProtocolSpdy3_0-
247 << QSslConfiguration::NextProtocolHttp1_1;-
248 incomingSslConfiguration.setAllowedNextProtocols(nextProtocols);-
249 }
executed 112 times by 1 test: end of block
Executed by:
  • tst_Spdy
112
250-
251-
252-
253 if (transparentProxy.type() != QNetworkProxy::NoProxy
transparentPro...Proxy::NoProxyDescription
TRUEevaluated 84 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 788 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
)
84-788
254 cacheKey = makeCacheKey(urlCopy, &transparentProxy);
executed 84 times by 2 tests: cacheKey = makeCacheKey(urlCopy, &transparentProxy);
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
84
255 else if (cacheProxy.type() != QNetworkProxy::NoProxy
cacheProxy.typ...Proxy::NoProxyDescription
TRUEevaluated 55 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 733 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
)
55-733
256 cacheKey = makeCacheKey(urlCopy, &cacheProxy);
executed 55 times by 1 test: cacheKey = makeCacheKey(urlCopy, &cacheProxy);
Executed by:
  • tst_QNetworkReply
55
257 else-
258-
259 cacheKey = makeCacheKey(urlCopy, 0);
executed 733 times by 8 tests: cacheKey = makeCacheKey(urlCopy, 0);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
733
260-
261-
262-
263 httpConnection = static_cast<QNetworkAccessCachedHttpConnection *>(connections.localData()->requestEntryNow(cacheKey));-
264 if (httpConnection == 0
httpConnection == 0Description
TRUEevaluated 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
FALSEevaluated 321 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
) {
321-551
265-
266-
267-
268-
269-
270-
271 httpConnection = new QNetworkAccessCachedHttpConnection(urlCopy.host(), urlCopy.port(), ssl,-
272 connectionType,-
273 networkSession);-
274-
275-
276-
277 if (ssl
sslDescription
TRUEevaluated 97 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 454 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
&& incomingSslConfiguration != QSslConfiguration::defaultConfiguration()
incomingSslCon...onfiguration()Description
TRUEevaluated 57 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 40 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
) {
40-454
278 httpConnection->setSslConfiguration(incomingSslConfiguration);-
279 }
executed 57 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
57
280-
281-
282-
283 httpConnection->setTransparentProxy(transparentProxy);-
284 httpConnection->setCacheProxy(cacheProxy);-
285-
286-
287-
288 connections.localData()->addEntry(cacheKey, httpConnection);-
289 }
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
else {
551
290 if (httpRequest.withCredentials()
httpRequest.withCredentials()Description
TRUEevaluated 320 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
1-320
291 QNetworkAuthenticationCredential credential = authenticationManager->fetchCachedCredentials(httpRequest.url(), 0);-
292 if (!credential.user.isEmpty()
!credential.user.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 320 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
&& !credential.password.isEmpty()
!credential.password.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-320
293 QAuthenticator auth;-
294 auth.setUser(credential.user);-
295 auth.setPassword(credential.password);-
296 httpConnection->d_func()->copyCredentials(-1, &auth, false);-
297 }
never executed: end of block
0
298 }
executed 320 times by 4 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
320
299 }
executed 321 times by 4 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
321
300-
301-
302-
303 httpReply = httpConnection->sendRequest(httpRequest);-
304 httpReply->setParent(this);-
305-
306-
307 if (synchronous
synchronousDescription
TRUEevaluated 76 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 796 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
76-796
308 connect(httpReply,qFlagLocation("2""headerChanged()" "\0" __FILE__ ":" "356"), this, qFlagLocation("1""synchronousHeaderChangedSlot()" "\0" __FILE__ ":" "356"));-
309 connect(httpReply,qFlagLocation("2""finished()" "\0" __FILE__ ":" "357"), this, qFlagLocation("1""synchronousFinishedSlot()" "\0" __FILE__ ":" "357"));-
310 connect(httpReply,qFlagLocation("2""finishedWithError(QNetworkReply::NetworkError,QString)" "\0" __FILE__ ":" "358"),-
311 this, qFlagLocation("1""synchronousFinishedWithErrorSlot(QNetworkReply::NetworkError,QString)" "\0" __FILE__ ":" "359"));-
312-
313 connect(httpReply, qFlagLocation("2""authenticationRequired(QHttpNetworkRequest,QAuthenticator*)" "\0" __FILE__ ":" "361"),-
314 this, qFlagLocation("1""synchronousAuthenticationRequiredSlot(QHttpNetworkRequest,QAuthenticator*)" "\0" __FILE__ ":" "362"));-
315-
316 connect(httpReply, qFlagLocation("2""proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)" "\0" __FILE__ ":" "364"),-
317 this, qFlagLocation("1""synchronousProxyAuthenticationRequiredSlot(QNetworkProxy,QAuthenticator*)" "\0" __FILE__ ":" "365"));-
318-
319-
320-
321 }
executed 76 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else if (!synchronous
!synchronousDescription
TRUEevaluated 796 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-796
322 connect(httpReply,qFlagLocation("2""headerChanged()" "\0" __FILE__ ":" "370"), this, qFlagLocation("1""headerChangedSlot()" "\0" __FILE__ ":" "370"));-
323 connect(httpReply,qFlagLocation("2""finished()" "\0" __FILE__ ":" "371"), this, qFlagLocation("1""finishedSlot()" "\0" __FILE__ ":" "371"));-
324 connect(httpReply,qFlagLocation("2""finishedWithError(QNetworkReply::NetworkError,QString)" "\0" __FILE__ ":" "372"),-
325 this, qFlagLocation("1""finishedWithErrorSlot(QNetworkReply::NetworkError,QString)" "\0" __FILE__ ":" "373"));-
326-
327 connect(httpReply,qFlagLocation("2""readyRead()" "\0" __FILE__ ":" "375"), this, qFlagLocation("1""readyReadSlot()" "\0" __FILE__ ":" "375"));-
328 connect(httpReply,qFlagLocation("2""dataReadProgress(qint64,qint64)" "\0" __FILE__ ":" "376"), this, qFlagLocation("1""dataReadProgressSlot(qint64,qint64)" "\0" __FILE__ ":" "376"));-
329-
330 connect(httpReply,qFlagLocation("2""encrypted()" "\0" __FILE__ ":" "378"), this, qFlagLocation("1""encryptedSlot()" "\0" __FILE__ ":" "378"));-
331 connect(httpReply,qFlagLocation("2""sslErrors(QList<QSslError>)" "\0" __FILE__ ":" "379"), this, qFlagLocation("1""sslErrorsSlot(QList<QSslError>)" "\0" __FILE__ ":" "379"));-
332 connect(httpReply,qFlagLocation("2""preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator*)" "\0" __FILE__ ":" "380"),-
333 this, qFlagLocation("1""preSharedKeyAuthenticationRequiredSlot(QSslPreSharedKeyAuthenticator*)" "\0" __FILE__ ":" "381"));-
334-
335-
336-
337-
338 connect(httpReply, qFlagLocation("2""authenticationRequired(QHttpNetworkRequest,QAuthenticator*)" "\0" __FILE__ ":" "386"),-
339 this, qFlagLocation("2""authenticationRequired(QHttpNetworkRequest,QAuthenticator*)" "\0" __FILE__ ":" "387"));-
340-
341 connect(httpReply, qFlagLocation("2""proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)" "\0" __FILE__ ":" "389"),-
342 this, qFlagLocation("2""proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)" "\0" __FILE__ ":" "390"));-
343-
344 }
executed 796 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
796
345-
346 connect(httpReply, qFlagLocation("2""cacheCredentials(QHttpNetworkRequest,QAuthenticator*)" "\0" __FILE__ ":" "394"),-
347 this, qFlagLocation("1""cacheCredentialsSlot(QHttpNetworkRequest,QAuthenticator*)" "\0" __FILE__ ":" "395"));-
348}
executed 872 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
872
349-
350-
351void QHttpThreadDelegate::abortRequest()-
352{-
353-
354-
355-
356 if (httpReply
httpReplyDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 112 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
) {
18-112
357 httpReply->abort();-
358 delete httpReply;-
359 httpReply = 0;-
360 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
18
361-
362-
363 if (synchronous
synchronousDescription
TRUEnever evaluated
FALSEevaluated 130 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
) {
0-130
364 incomingErrorCode = QNetworkReply::TimeoutError;-
365 QMetaObject::invokeMethod(synchronousRequestLoop, "quit", Qt::QueuedConnection);-
366 }
never executed: end of block
else {
0
367-
368 this->deleteLater();-
369 }
executed 130 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
130
370}-
371-
372void QHttpThreadDelegate::readBufferSizeChanged(qint64 size)-
373{-
374-
375-
376-
377 if (httpReply
httpReplyDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-18
378 httpReply->setDownstreamLimited(size > 0);-
379 httpReply->setReadBufferSize(size);-
380 readBufferMaxSize = size;-
381 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
18
382}
executed 18 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
18
383-
384void QHttpThreadDelegate::readBufferFreed(qint64 size)-
385{-
386 if (readBufferMaxSize
readBufferMaxSizeDescription
TRUEevaluated 198 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-198
387 bytesEmitted -= size;-
388-
389 QMetaObject::invokeMethod(this, "readyReadSlot", Qt::QueuedConnection);-
390 }
executed 198 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
198
391}
executed 198 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
198
392-
393void QHttpThreadDelegate::readyReadSlot()-
394{-
395 if (!httpReply
!httpReplyDescription
TRUEnever evaluated
FALSEevaluated 12708 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
)
0-12708
396 return;
never executed: return;
0
397-
398-
399 if (!downloadBuffer.isNull()
!downloadBuffer.isNull()Description
TRUEnever evaluated
FALSEevaluated 12708 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
)
0-12708
400 return;
never executed: return;
0
401-
402 if (readBufferMaxSize
readBufferMaxSizeDescription
TRUEevaluated 654 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 12054 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
) {
654-12054
403 if (bytesEmitted < readBufferMaxSize
bytesEmitted <...dBufferMaxSizeDescription
TRUEevaluated 628 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
26-628
404 qint64 sizeEmitted = 0;-
405 while (httpReply->readAnyAvailable()
httpReply->readAnyAvailable()Description
TRUEevaluated 295 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 584 times by 1 test
Evaluated by:
  • tst_QNetworkReply
&& (
(sizeEmitted <...bytesEmitted))Description
TRUEevaluated 251 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_QNetworkReply
sizeEmitted < (readBufferMaxSize-bytesEmitted))
(sizeEmitted <...bytesEmitted))Description
TRUEevaluated 251 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 44 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
44-584
406 if (httpReply->sizeNextBlock() > (readBufferMaxSize-bytesEmitted)
httpReply->siz...-bytesEmitted)Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 211 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
40-211
407 sizeEmitted = readBufferMaxSize-bytesEmitted;-
408 bytesEmitted += sizeEmitted;-
409 pendingDownloadData->fetchAndAddRelease(1);-
410 downloadData(httpReply->read(sizeEmitted));-
411 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else {
40
412 sizeEmitted = httpReply->sizeNextBlock();-
413 bytesEmitted += sizeEmitted;-
414 pendingDownloadData->fetchAndAddRelease(1);-
415 downloadData(httpReply->readAny());-
416 }
executed 211 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
211
417 }-
418 }
executed 628 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else {
628
419-
420 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
26
421-
422 } else {-
423 while (httpReply->readAnyAvailable()
httpReply->readAnyAvailable()Description
TRUEevaluated 6231 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 12054 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
) {
6231-12054
424 pendingDownloadData->fetchAndAddRelease(1);-
425 downloadData(httpReply->readAny());-
426 }
executed 6231 times by 4 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
6231
427 }
executed 12054 times by 4 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
12054
428}-
429-
430void QHttpThreadDelegate::finishedSlot()-
431{-
432 if (!httpReply
!httpReplyDescription
TRUEnever evaluated
FALSEevaluated 677 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
)
0-677
433 return;
never executed: return;
0
434-
435-
436-
437-
438-
439-
440 while (httpReply->readAnyAvailable()
httpReply->readAnyAvailable()Description
TRUEnever evaluated
FALSEevaluated 677 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
0-677
441 pendingDownloadData->fetchAndAddRelease(1);-
442 downloadData(httpReply->readAny());-
443 }
never executed: end of block
0
444-
445-
446 if (ssl
sslDescription
TRUEevaluated 181 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 496 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
)
181-496
447 sslConfigurationChanged(httpReply->sslConfiguration());
executed 181 times by 2 tests: sslConfigurationChanged(httpReply->sslConfiguration());
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
181
448-
449-
450 if (httpReply->statusCode() >= 400
httpReply->statusCode() >= 400Description
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 668 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
9-668
451-
452 QString msg = QLatin1String("Error transferring %1 - server replied: %2"-
453 );-
454 msg = msg.arg(httpRequest.url().toString(), httpReply->reasonPhrase());-
455 error(statusCodeFromHttp(httpReply->statusCode(), httpRequest.url()), msg);-
456 }
executed 9 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
9
457-
458 if (httpRequest.isFollowRedirects()
httpRequest.is...lowRedirects()Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 670 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
&& httpReply->isRedirecting()
httpReply->isRedirecting()Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
2-670
459 redirected(httpReply->redirectUrl(), httpReply->statusCode(), httpReply->request().redirectCount() - 1);
executed 5 times by 1 test: redirected(httpReply->redirectUrl(), httpReply->statusCode(), httpReply->request().redirectCount() - 1);
Executed by:
  • tst_QNetworkReply
5
460-
461 downloadFinished();-
462-
463 QMetaObject::invokeMethod(httpReply, "deleteLater", Qt::QueuedConnection);-
464 QMetaObject::invokeMethod(this, "deleteLater", Qt::QueuedConnection);-
465 httpReply = 0;-
466}
executed 677 times by 6 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
677
467-
468void QHttpThreadDelegate::synchronousFinishedSlot()-
469{-
470 if (!httpReply
!httpReplyDescription
TRUEnever evaluated
FALSEevaluated 63 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
0-63
471 return;
never executed: return;
0
472-
473-
474-
475-
476 if (httpReply->statusCode() >= 400
httpReply->statusCode() >= 400Description
TRUEnever evaluated
FALSEevaluated 63 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
0-63
477-
478 QString msg = QLatin1String("Error transferring %1 - server replied: %2"-
479 );-
480 incomingErrorDetail = msg.arg(httpRequest.url().toString(), httpReply->reasonPhrase());-
481 incomingErrorCode = statusCodeFromHttp(httpReply->statusCode(), httpRequest.url());-
482 }
never executed: end of block
0
483-
484 synchronousDownloadData = httpReply->readAll();-
485-
486 QMetaObject::invokeMethod(httpReply, "deleteLater", Qt::QueuedConnection);-
487 QMetaObject::invokeMethod(synchronousRequestLoop, "quit", Qt::QueuedConnection);-
488 httpReply = 0;-
489}
executed 63 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
63
490-
491void QHttpThreadDelegate::finishedWithErrorSlot(QNetworkReply::NetworkError errorCode, const QString &detail)-
492{-
493 if (!httpReply
!httpReplyDescription
TRUEnever evaluated
FALSEevaluated 91 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
)
0-91
494 return;
never executed: return;
0
495-
496-
497-
498-
499-
500-
501 if (ssl
sslDescription
TRUEevaluated 29 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 62 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
)
29-62
502 sslConfigurationChanged(httpReply->sslConfiguration());
executed 29 times by 2 tests: sslConfigurationChanged(httpReply->sslConfiguration());
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
29
503-
504 error(errorCode,detail);-
505 downloadFinished();-
506-
507-
508 QMetaObject::invokeMethod(httpReply, "deleteLater", Qt::QueuedConnection);-
509 QMetaObject::invokeMethod(this, "deleteLater", Qt::QueuedConnection);-
510 httpReply = 0;-
511}
executed 91 times by 4 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
91
512-
513-
514void QHttpThreadDelegate::synchronousFinishedWithErrorSlot(QNetworkReply::NetworkError errorCode, const QString &detail)-
515{-
516 if (!httpReply
!httpReplyDescription
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
0-13
517 return;
never executed: return;
0
518-
519-
520-
521-
522 incomingErrorCode = errorCode;-
523 incomingErrorDetail = detail;-
524-
525 synchronousDownloadData = httpReply->readAll();-
526-
527 QMetaObject::invokeMethod(httpReply, "deleteLater", Qt::QueuedConnection);-
528 QMetaObject::invokeMethod(synchronousRequestLoop, "quit", Qt::QueuedConnection);-
529 httpReply = 0;-
530}
executed 13 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
13
531-
532static void downloadBufferDeleter(char *ptr)-
533{-
534 delete[] ptr;-
535}
executed 364 times by 3 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
364
536-
537void QHttpThreadDelegate::headerChangedSlot()-
538{-
539 if (!httpReply
!httpReplyDescription
TRUEnever evaluated
FALSEevaluated 720 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
)
0-720
540 return;
never executed: return;
0
541-
542-
543-
544-
545-
546-
547 if (ssl
sslDescription
TRUEevaluated 193 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 527 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
)
193-527
548 sslConfigurationChanged(httpReply->sslConfiguration());
executed 193 times by 2 tests: sslConfigurationChanged(httpReply->sslConfiguration());
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
193
549-
550-
551-
552 if (httpReply->supportsUserProvidedDownloadBuffer()
httpReply->sup...wnloadBuffer()Description
TRUEevaluated 386 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 334 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
334-386
553 && (
(downloadBuffe...ximumSize > 0)Description
TRUEevaluated 386 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEnever evaluated
downloadBufferMaximumSize > 0)
(downloadBuffe...ximumSize > 0)Description
TRUEevaluated 386 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEnever evaluated
&& (
(httpReply->co...erMaximumSize)Description
TRUEevaluated 364 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
httpReply->contentLength() <= downloadBufferMaximumSize)
(httpReply->co...erMaximumSize)Description
TRUEevaluated 364 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
) {
0-386
554 if (true) {-
555 char *buf = new char[httpReply->contentLength()];-
556 if (buf
bufDescription
TRUEevaluated 364 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-364
557 downloadBuffer = QSharedPointer<char>(buf, downloadBufferDeleter);-
558 httpReply->setUserProvidedDownloadBuffer(buf);-
559 }
executed 364 times by 3 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
364
560 }
executed 364 times by 3 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
else {
dead code: { }
-
561-
562 }
dead code: { }
-
563 }-
564-
565-
566 incomingHeaders = httpReply->header();-
567 incomingStatusCode = httpReply->statusCode();-
568 incomingReasonPhrase = httpReply->reasonPhrase();-
569 isPipeliningUsed = httpReply->isPipeliningUsed();-
570 incomingContentLength = httpReply->contentLength();-
571 isSpdyUsed = httpReply->isSpdyUsed();-
572-
573 downloadMetaData(incomingHeaders,-
574 incomingStatusCode,-
575 incomingReasonPhrase,-
576 isPipeliningUsed,-
577 downloadBuffer,-
578 incomingContentLength,-
579 isSpdyUsed);-
580}
executed 720 times by 6 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
720
581-
582void QHttpThreadDelegate::synchronousHeaderChangedSlot()-
583{-
584 if (!httpReply
!httpReplyDescription
TRUEnever evaluated
FALSEevaluated 74 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
0-74
585 return;
never executed: return;
0
586-
587-
588-
589-
590-
591 incomingHeaders = httpReply->header();-
592 incomingStatusCode = httpReply->statusCode();-
593 incomingReasonPhrase = httpReply->reasonPhrase();-
594 isPipeliningUsed = httpReply->isPipeliningUsed();-
595 isSpdyUsed = httpReply->isSpdyUsed();-
596 incomingContentLength = httpReply->contentLength();-
597}
executed 74 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
74
598-
599-
600void QHttpThreadDelegate::dataReadProgressSlot(qint64 done, qint64 total)-
601{-
602-
603-
604 if (downloadBuffer.isNull()
downloadBuffer.isNull()Description
TRUEevaluated 12485 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 1490 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
)
1490-12485
605 return;
executed 12485 times by 4 tests: return;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
12485
606-
607 pendingDownloadProgress->fetchAndAddRelease(1);-
608 downloadProgress(done, total);-
609}
executed 1490 times by 3 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
1490
610-
611void QHttpThreadDelegate::cacheCredentialsSlot(const QHttpNetworkRequest &request, QAuthenticator *authenticator)-
612{-
613 authenticationManager->cacheCredentials(request.url(), authenticator);-
614}
executed 170 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
170
615-
616-
617-
618void QHttpThreadDelegate::encryptedSlot()-
619{-
620 if (!httpReply
!httpReplyDescription
TRUEnever evaluated
FALSEevaluated 75 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
0-75
621 return;
never executed: return;
0
622-
623 sslConfigurationChanged(httpReply->sslConfiguration());-
624 encrypted();-
625}
executed 75 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
75
626-
627void QHttpThreadDelegate::sslErrorsSlot(const QList<QSslError> &errors)-
628{-
629 if (!httpReply
!httpReplyDescription
TRUEnever evaluated
FALSEevaluated 48 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
0-48
630 return;
never executed: return;
0
631-
632 sslConfigurationChanged(httpReply->sslConfiguration());-
633-
634 bool ignoreAll = false;-
635 QList<QSslError> specificErrors;-
636 sslErrors(errors, &ignoreAll, &specificErrors);-
637 if (ignoreAll
ignoreAllDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
16-32
638 httpReply->ignoreSslErrors();
executed 32 times by 2 tests: httpReply->ignoreSslErrors();
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
32
639 if (!specificErrors.isEmpty()
!specificErrors.isEmpty()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 42 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
6-42
640 httpReply->ignoreSslErrors(specificErrors);
executed 6 times by 1 test: httpReply->ignoreSslErrors(specificErrors);
Executed by:
  • tst_QNetworkReply
6
641}
executed 48 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
48
642-
643void QHttpThreadDelegate::preSharedKeyAuthenticationRequiredSlot(QSslPreSharedKeyAuthenticator *authenticator)-
644{-
645 if (!httpReply
!httpReplyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
646 return;
never executed: return;
0
647-
648 preSharedKeyAuthenticationRequired(authenticator);-
649}
never executed: end of block
0
650-
651-
652void QHttpThreadDelegate::synchronousAuthenticationRequiredSlot(const QHttpNetworkRequest &request, QAuthenticator *a)-
653{-
654 if (!httpReply
!httpReplyDescription
TRUEnever evaluated
FALSEevaluated 17 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
0-17
655 return;
never executed: return;
0
656-
657 (void)request;;-
658-
659-
660-
661-
662-
663 QNetworkAuthenticationCredential credential = authenticationManager->fetchCachedCredentials(httpRequest.url(), a);-
664 if (!credential.isNull()
!credential.isNull()Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
6-11
665 a->setUser(credential.user);-
666 a->setPassword(credential.password);-
667 }
executed 11 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
11
668-
669-
670 QObject::disconnect(httpReply, qFlagLocation("2""authenticationRequired(QHttpNetworkRequest,QAuthenticator*)" "\0" __FILE__ ":" "718"),-
671 this, qFlagLocation("1""synchronousAuthenticationRequiredSlot(QHttpNetworkRequest,QAuthenticator*)" "\0" __FILE__ ":" "719"));-
672}
executed 17 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
17
673-
674-
675void QHttpThreadDelegate::synchronousProxyAuthenticationRequiredSlot(const QNetworkProxy &p, QAuthenticator *a)-
676{-
677 if (!httpReply
!httpReplyDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
)
0-1
678 return;
never executed: return;
0
679-
680-
681-
682-
683-
684 QNetworkAuthenticationCredential credential = authenticationManager->fetchCachedProxyCredentials(p, a);-
685 if (!credential.isNull()
!credential.isNull()Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
0-1
686 a->setUser(credential.user);-
687 a->setPassword(credential.password);-
688 }
never executed: end of block
0
689-
690-
691-
692 QObject::disconnect(httpReply, qFlagLocation("2""proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)" "\0" __FILE__ ":" "740"),-
693 this, qFlagLocation("1""synchronousProxyAuthenticationRequiredSlot(QNetworkProxy,QAuthenticator*)" "\0" __FILE__ ":" "741"));-
694-
695}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QNetworkReply
1
696-
697-
698-
699-
700-
701-
Switch to Source codePreprocessed file

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