OpenCoverage

qhttpnetworkrequest.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/access/qhttpnetworkrequest.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtNetwork module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qhttpnetworkrequest_p.h"-
41#include "private/qnoncontiguousbytedevice_p.h"-
42-
43#ifndef QT_NO_HTTP-
44-
45QT_BEGIN_NAMESPACE-
46-
47QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(QHttpNetworkRequest::Operation op,-
48 QHttpNetworkRequest::Priority pri, const QUrl &newUrl)-
49 : QHttpNetworkHeaderPrivate(newUrl), operation(op), priority(pri), uploadByteDevice(0),-
50 autoDecompress(false), pipeliningAllowed(false), spdyAllowed(false),-
51 withCredentials(true), preConnect(false), followRedirect(false), redirectCount(0)-
52{-
53}
executed 9653 times by 14 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_qhttpnetworkreply - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
9653
54-
55QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(const QHttpNetworkRequestPrivate &other) // = default-
56 : QHttpNetworkHeaderPrivate(other),-
57 operation(other.operation),-
58 customVerb(other.customVerb),-
59 priority(other.priority),-
60 uploadByteDevice(other.uploadByteDevice),-
61 autoDecompress(other.autoDecompress),-
62 pipeliningAllowed(other.pipeliningAllowed),-
63 spdyAllowed(other.spdyAllowed),-
64 withCredentials(other.withCredentials),-
65 ssl(other.ssl),-
66 preConnect(other.preConnect),-
67 followRedirect(other.followRedirect),-
68 redirectCount(other.redirectCount)-
69{-
70}
executed 2184 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
2184
71-
72QHttpNetworkRequestPrivate::~QHttpNetworkRequestPrivate()-
73{-
74}-
75-
76bool QHttpNetworkRequestPrivate::operator==(const QHttpNetworkRequestPrivate &other) const-
77{-
78 return QHttpNetworkHeaderPrivate::operator==(other)
never executed: return QHttpNetworkHeaderPrivate::operator==(other) && (operation == other.operation) && (priority == other.priority) && (uploadByteDevice == other.uploadByteDevice) && (autoDecompress == other.autoDecompress) && (pipeliningAllowed == other.pipeliningAllowed) && (spdyAllowed == other.spdyAllowed) && (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb)) && (withCredentials == other.withCredentials) && (ssl == other.ssl) && (preConnect == other.preConnect);
0
79 && (operation == other.operation)
never executed: return QHttpNetworkHeaderPrivate::operator==(other) && (operation == other.operation) && (priority == other.priority) && (uploadByteDevice == other.uploadByteDevice) && (autoDecompress == other.autoDecompress) && (pipeliningAllowed == other.pipeliningAllowed) && (spdyAllowed == other.spdyAllowed) && (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb)) && (withCredentials == other.withCredentials) && (ssl == other.ssl) && (preConnect == other.preConnect);
0
80 && (priority == other.priority)
never executed: return QHttpNetworkHeaderPrivate::operator==(other) && (operation == other.operation) && (priority == other.priority) && (uploadByteDevice == other.uploadByteDevice) && (autoDecompress == other.autoDecompress) && (pipeliningAllowed == other.pipeliningAllowed) && (spdyAllowed == other.spdyAllowed) && (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb)) && (withCredentials == other.withCredentials) && (ssl == other.ssl) && (preConnect == other.preConnect);
0
81 && (uploadByteDevice == other.uploadByteDevice)
never executed: return QHttpNetworkHeaderPrivate::operator==(other) && (operation == other.operation) && (priority == other.priority) && (uploadByteDevice == other.uploadByteDevice) && (autoDecompress == other.autoDecompress) && (pipeliningAllowed == other.pipeliningAllowed) && (spdyAllowed == other.spdyAllowed) && (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb)) && (withCredentials == other.withCredentials) && (ssl == other.ssl) && (preConnect == other.preConnect);
0
82 && (autoDecompress == other.autoDecompress)
never executed: return QHttpNetworkHeaderPrivate::operator==(other) && (operation == other.operation) && (priority == other.priority) && (uploadByteDevice == other.uploadByteDevice) && (autoDecompress == other.autoDecompress) && (pipeliningAllowed == other.pipeliningAllowed) && (spdyAllowed == other.spdyAllowed) && (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb)) && (withCredentials == other.withCredentials) && (ssl == other.ssl) && (preConnect == other.preConnect);
0
83 && (pipeliningAllowed == other.pipeliningAllowed)
never executed: return QHttpNetworkHeaderPrivate::operator==(other) && (operation == other.operation) && (priority == other.priority) && (uploadByteDevice == other.uploadByteDevice) && (autoDecompress == other.autoDecompress) && (pipeliningAllowed == other.pipeliningAllowed) && (spdyAllowed == other.spdyAllowed) && (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb)) && (withCredentials == other.withCredentials) && (ssl == other.ssl) && (preConnect == other.preConnect);
0
84 && (spdyAllowed == other.spdyAllowed)
never executed: return QHttpNetworkHeaderPrivate::operator==(other) && (operation == other.operation) && (priority == other.priority) && (uploadByteDevice == other.uploadByteDevice) && (autoDecompress == other.autoDecompress) && (pipeliningAllowed == other.pipeliningAllowed) && (spdyAllowed == other.spdyAllowed) && (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb)) && (withCredentials == other.withCredentials) && (ssl == other.ssl) && (preConnect == other.preConnect);
0
85 // we do not clear the customVerb in setOperation
never executed: return QHttpNetworkHeaderPrivate::operator==(other) && (operation == other.operation) && (priority == other.priority) && (uploadByteDevice == other.uploadByteDevice) && (autoDecompress == other.autoDecompress) && (pipeliningAllowed == other.pipeliningAllowed) && (spdyAllowed == other.spdyAllowed) && (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb)) && (withCredentials == other.withCredentials) && (ssl == other.ssl) && (preConnect == other.preConnect);
0
86 && (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb))
never executed: return QHttpNetworkHeaderPrivate::operator==(other) && (operation == other.operation) && (priority == other.priority) && (uploadByteDevice == other.uploadByteDevice) && (autoDecompress == other.autoDecompress) && (pipeliningAllowed == other.pipeliningAllowed) && (spdyAllowed == other.spdyAllowed) && (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb)) && (withCredentials == other.withCredentials) && (ssl == other.ssl) && (preConnect == other.preConnect);
0
87 && (withCredentials == other.withCredentials)
never executed: return QHttpNetworkHeaderPrivate::operator==(other) && (operation == other.operation) && (priority == other.priority) && (uploadByteDevice == other.uploadByteDevice) && (autoDecompress == other.autoDecompress) && (pipeliningAllowed == other.pipeliningAllowed) && (spdyAllowed == other.spdyAllowed) && (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb)) && (withCredentials == other.withCredentials) && (ssl == other.ssl) && (preConnect == other.preConnect);
0
88 && (ssl == other.ssl)
never executed: return QHttpNetworkHeaderPrivate::operator==(other) && (operation == other.operation) && (priority == other.priority) && (uploadByteDevice == other.uploadByteDevice) && (autoDecompress == other.autoDecompress) && (pipeliningAllowed == other.pipeliningAllowed) && (spdyAllowed == other.spdyAllowed) && (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb)) && (withCredentials == other.withCredentials) && (ssl == other.ssl) && (preConnect == other.preConnect);
0
89 && (preConnect == other.preConnect);
never executed: return QHttpNetworkHeaderPrivate::operator==(other) && (operation == other.operation) && (priority == other.priority) && (uploadByteDevice == other.uploadByteDevice) && (autoDecompress == other.autoDecompress) && (pipeliningAllowed == other.pipeliningAllowed) && (spdyAllowed == other.spdyAllowed) && (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb)) && (withCredentials == other.withCredentials) && (ssl == other.ssl) && (preConnect == other.preConnect);
0
90}-
91-
92QByteArray QHttpNetworkRequest::methodName() const-
93{-
94 switch (d->operation) {-
95 case QHttpNetworkRequest::Get:
executed 1603 times by 7 tests: case QHttpNetworkRequest::Get:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
1603
96 return "GET";
executed 1603 times by 7 tests: return "GET";
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
1603
97 case QHttpNetworkRequest::Head:
executed 118 times by 2 tests: case QHttpNetworkRequest::Head:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
118
98 return "HEAD";
executed 118 times by 2 tests: return "HEAD";
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
118
99 case QHttpNetworkRequest::Post:
executed 248 times by 4 tests: case QHttpNetworkRequest::Post:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
248
100 return "POST";
executed 248 times by 4 tests: return "POST";
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
248
101 case QHttpNetworkRequest::Options:
never executed: case QHttpNetworkRequest::Options:
0
102 return "OPTIONS";
never executed: return "OPTIONS";
0
103 case QHttpNetworkRequest::Put:
executed 38 times by 3 tests: case QHttpNetworkRequest::Put:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
38
104 return "PUT";
executed 38 times by 3 tests: return "PUT";
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
38
105 case QHttpNetworkRequest::Delete:
executed 7 times by 1 test: case QHttpNetworkRequest::Delete:
Executed by:
  • tst_QNetworkReply
7
106 return "DELETE";
executed 7 times by 1 test: return "DELETE";
Executed by:
  • tst_QNetworkReply
7
107 case QHttpNetworkRequest::Trace:
never executed: case QHttpNetworkRequest::Trace:
0
108 return "TRACE";
never executed: return "TRACE";
0
109 case QHttpNetworkRequest::Connect:
never executed: case QHttpNetworkRequest::Connect:
0
110 return "CONNECT";
never executed: return "CONNECT";
0
111 case QHttpNetworkRequest::Custom:
executed 7 times by 1 test: case QHttpNetworkRequest::Custom:
Executed by:
  • tst_QNetworkReply
7
112 return d->customVerb;
executed 7 times by 1 test: return d->customVerb;
Executed by:
  • tst_QNetworkReply
7
113 default:
never executed: default:
0
114 break;
never executed: break;
0
115 }-
116 return QByteArray();
never executed: return QByteArray();
0
117}-
118-
119QByteArray QHttpNetworkRequest::uri(bool throughProxy) const-
120{-
121 QUrl::FormattingOptions format(QUrl::RemoveFragment | QUrl::RemoveUserInfo | QUrl::FullyEncoded);-
122-
123 // for POST, query data is sent as content-
124 if (d->operation == QHttpNetworkRequest::Post && !d->uploadByteDevice)
d->operation =...kRequest::PostDescription
TRUEevaluated 248 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 1773 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
!d->uploadByteDeviceDescription
TRUEnever evaluated
FALSEevaluated 248 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
0-1773
125 format |= QUrl::RemoveQuery;
never executed: format |= QUrl::RemoveQuery;
0
126 // for requests through proxy, the Request-URI contains full url-
127 if (!throughProxy)
!throughProxyDescription
TRUEevaluated 1922 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 99 times by 1 test
Evaluated by:
  • tst_QNetworkReply
99-1922
128 format |= QUrl::RemoveScheme | QUrl::RemoveAuthority;
executed 1922 times by 8 tests: format |= QUrl::RemoveScheme | QUrl::RemoveAuthority;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1922
129 QUrl copy = d->url;-
130 if (copy.path().isEmpty())
copy.path().isEmpty()Description
TRUEevaluated 253 times by 6 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 1768 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
253-1768
131 copy.setPath(QStringLiteral("/"));
executed 253 times by 6 tests: copy.setPath(([]() -> QString { enum { Size = sizeof(u"" "/")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "/" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
executed 253 times by 6 tests: return qstring_literal_temp;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
253
132 QByteArray uri = copy.toEncoded(format);-
133 return uri;
executed 2021 times by 8 tests: return uri;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
2021
134}-
135-
136QByteArray QHttpNetworkRequestPrivate::header(const QHttpNetworkRequest &request, bool throughProxy)-
137{-
138 QList<QPair<QByteArray, QByteArray> > fields = request.header();-
139 QByteArray ba;-
140 ba.reserve(40 + fields.length()*25); // very rough lower bound estimation-
141-
142 ba += request.methodName();-
143 ba += ' ';-
144 ba += request.uri(throughProxy);-
145-
146 ba += " HTTP/";-
147 ba += QByteArray::number(request.majorVersion());-
148 ba += '.';-
149 ba += QByteArray::number(request.minorVersion());-
150 ba += "\r\n";-
151-
152 QList<QPair<QByteArray, QByteArray> >::const_iterator it = fields.constBegin();-
153 QList<QPair<QByteArray, QByteArray> >::const_iterator endIt = fields.constEnd();-
154 for (; it != endIt; ++it) {
it != endItDescription
TRUEevaluated 9299 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 1724 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1724-9299
155 ba += it->first;-
156 ba += ": ";-
157 ba += it->second;-
158 ba += "\r\n";-
159 }
executed 9299 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
9299
160 if (request.d->operation == QHttpNetworkRequest::Post) {
request.d->ope...kRequest::PostDescription
TRUEevaluated 187 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
FALSEevaluated 1537 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
187-1537
161 // add content type, if not set in the request-
162 if (request.headerField("content-type").isEmpty() && ((request.d->uploadByteDevice && request.d->uploadByteDevice->size() > 0) || request.d->url.hasQuery())) {
request.header...pe").isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
FALSEevaluated 185 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
request.d->uploadByteDeviceDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
FALSEnever evaluated
request.d->upl...ce->size() > 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
FALSEnever evaluated
request.d->url.hasQuery()Description
TRUEnever evaluated
FALSEnever evaluated
0-185
163 //Content-Type is mandatory. We can't say anything about the encoding, but x-www-form-urlencoded is the most likely to work.-
164 //This warning indicates a bug in application code not setting a required header.-
165 //Note that if using QHttpMultipart, the content-type is set in QNetworkAccessManagerPrivate::prepareMultipart already-
166 qWarning("content-type missing in HTTP POST, defaulting to application/x-www-form-urlencoded. Use QNetworkRequest::setHeader() to fix this problem.");-
167 ba += "Content-Type: application/x-www-form-urlencoded\r\n";-
168 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QHttpNetworkConnection
2
169 if (!request.d->uploadByteDevice && request.d->url.hasQuery()) {
!request.d->uploadByteDeviceDescription
TRUEnever evaluated
FALSEevaluated 187 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
request.d->url.hasQuery()Description
TRUEnever evaluated
FALSEnever evaluated
0-187
170 QByteArray query = request.d->url.query(QUrl::FullyEncoded).toLatin1();-
171 ba += "Content-Length: ";-
172 ba += QByteArray::number(query.size());-
173 ba += "\r\n\r\n";-
174 ba += query;-
175 } else {
never executed: end of block
0
176 ba += "\r\n";-
177 }
executed 187 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
187
178 } else {-
179 ba += "\r\n";-
180 }
executed 1537 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
1537
181 return ba;
executed 1724 times by 8 tests: return ba;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1724
182}-
183-
184-
185// QHttpNetworkRequest-
186-
187QHttpNetworkRequest::QHttpNetworkRequest(const QUrl &url, Operation operation, Priority priority)-
188 : d(new QHttpNetworkRequestPrivate(operation, priority, url))-
189{-
190}
executed 9653 times by 14 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_qhttpnetworkreply - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
9653
191-
192QHttpNetworkRequest::QHttpNetworkRequest(const QHttpNetworkRequest &other)-
193 : QHttpNetworkHeader(other), d(other.d)-
194{-
195}
executed 12106 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
12106
196-
197QHttpNetworkRequest::~QHttpNetworkRequest()-
198{-
199}-
200-
201QUrl QHttpNetworkRequest::url() const-
202{-
203 return d->url;
executed 8461 times by 8 tests: return d->url;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
8461
204}-
205void QHttpNetworkRequest::setUrl(const QUrl &url)-
206{-
207 d->url = url;-
208}
executed 916 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
916
209-
210bool QHttpNetworkRequest::isSsl() const-
211{-
212 return d->ssl;
executed 1753 times by 8 tests: return d->ssl;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1753
213}-
214void QHttpNetworkRequest::setSsl(bool s)-
215{-
216 d->ssl = s;-
217}
executed 890 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
890
218-
219bool QHttpNetworkRequest::isPreConnect() const-
220{-
221 return d->preConnect;
executed 1646 times by 8 tests: return d->preConnect;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1646
222}-
223void QHttpNetworkRequest::setPreConnect(bool preConnect)-
224{-
225 d->preConnect = preConnect;-
226}
executed 890 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
890
227-
228bool QHttpNetworkRequest::isFollowRedirects() const-
229{-
230 return d->followRedirect;
executed 15688 times by 7 tests: return d->followRedirect;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
15688
231}-
232-
233void QHttpNetworkRequest::setFollowRedirects(bool followRedirect)-
234{-
235 d->followRedirect = followRedirect;-
236}
executed 9 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
9
237-
238int QHttpNetworkRequest::redirectCount() const-
239{-
240 return d->redirectCount;
executed 11 times by 1 test: return d->redirectCount;
Executed by:
  • tst_QNetworkReply
11
241}-
242-
243void QHttpNetworkRequest::setRedirectCount(int count)-
244{-
245 d->redirectCount = count;-
246}
executed 890 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
890
247-
248qint64 QHttpNetworkRequest::contentLength() const-
249{-
250 return d->contentLength();
executed 2643 times by 4 tests: return d->contentLength();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
2643
251}-
252-
253void QHttpNetworkRequest::setContentLength(qint64 length)-
254{-
255 d->setContentLength(length);-
256}
executed 200 times by 4 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
200
257-
258QList<QPair<QByteArray, QByteArray> > QHttpNetworkRequest::header() const-
259{-
260 return d->fields;
executed 3273 times by 8 tests: return d->fields;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
3273
261}-
262-
263QByteArray QHttpNetworkRequest::headerField(const QByteArray &name, const QByteArray &defaultValue) const-
264{-
265 return d->headerField(name, defaultValue);
executed 8571 times by 8 tests: return d->headerField(name, defaultValue);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
8571
266}-
267-
268void QHttpNetworkRequest::setHeaderField(const QByteArray &name, const QByteArray &data)-
269{-
270 d->setHeaderField(name, data);-
271}
executed 8739 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
8739
272-
273QHttpNetworkRequest &QHttpNetworkRequest::operator=(const QHttpNetworkRequest &other)-
274{-
275 d = other.d;-
276 return *this;
executed 5645 times by 8 tests: return *this;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
5645
277}-
278-
279bool QHttpNetworkRequest::operator==(const QHttpNetworkRequest &other) const-
280{-
281 return d->operator==(*other.d);
never executed: return d->operator==(*other.d);
0
282}-
283-
284QHttpNetworkRequest::Operation QHttpNetworkRequest::operation() const-
285{-
286 return d->operation;
executed 2721 times by 7 tests: return d->operation;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
2721
287}-
288-
289void QHttpNetworkRequest::setOperation(Operation operation)-
290{-
291 d->operation = operation;-
292}
executed 887 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
887
293-
294QByteArray QHttpNetworkRequest::customVerb() const-
295{-
296 return d->customVerb;
never executed: return d->customVerb;
0
297}-
298-
299void QHttpNetworkRequest::setCustomVerb(const QByteArray &customVerb)-
300{-
301 d->customVerb = customVerb;-
302}
executed 7 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
7
303-
304QHttpNetworkRequest::Priority QHttpNetworkRequest::priority() const-
305{-
306 return d->priority;
executed 1903 times by 8 tests: return d->priority;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1903
307}-
308-
309void QHttpNetworkRequest::setPriority(Priority priority)-
310{-
311 d->priority = priority;-
312}
executed 1086 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
1086
313-
314bool QHttpNetworkRequest::isPipeliningAllowed() const-
315{-
316 return d->pipeliningAllowed;
executed 3371 times by 2 tests: return d->pipeliningAllowed;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
3371
317}-
318-
319void QHttpNetworkRequest::setPipeliningAllowed(bool b)-
320{-
321 d->pipeliningAllowed = b;-
322}
executed 453 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
453
323-
324bool QHttpNetworkRequest::isSPDYAllowed() const-
325{-
326 return d->spdyAllowed;
executed 872 times by 8 tests: return d->spdyAllowed;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
872
327}-
328-
329void QHttpNetworkRequest::setSPDYAllowed(bool b)-
330{-
331 d->spdyAllowed = b;-
332}
executed 113 times by 1 test: end of block
Executed by:
  • tst_Spdy
113
333-
334bool QHttpNetworkRequest::withCredentials() const-
335{-
336 return d->withCredentials;
executed 2108 times by 8 tests: return d->withCredentials;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
2108
337}-
338-
339void QHttpNetworkRequest::setWithCredentials(bool b)-
340{-
341 d->withCredentials = b;-
342}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QNetworkReply
1
343-
344void QHttpNetworkRequest::setUploadByteDevice(QNonContiguousByteDevice *bd)-
345{-
346 d->uploadByteDevice = bd;-
347}
executed 201 times by 4 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
201
348-
349QNonContiguousByteDevice* QHttpNetworkRequest::uploadByteDevice() const-
350{-
351 return d->uploadByteDevice;
executed 12168 times by 8 tests: return d->uploadByteDevice;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
12168
352}-
353-
354int QHttpNetworkRequest::majorVersion() const-
355{-
356 return 1;
executed 1724 times by 8 tests: return 1;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1724
357}-
358-
359int QHttpNetworkRequest::minorVersion() const-
360{-
361 return 1;
executed 1724 times by 8 tests: return 1;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1724
362}-
363-
364-
365QT_END_NAMESPACE-
366-
367#endif-
368-
Source codeSwitch to Preprocessed file

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