qhttpnetworkrequest.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/access/qhttpnetworkrequest.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(QHttpNetworkRequest::Operation op,-
7 QHttpNetworkRequest::Priority pri, const QUrl &newUrl)-
8 : QHttpNetworkHeaderPrivate(newUrl), operation(op), priority(pri), uploadByteDevice(0),-
9 autoDecompress(false), pipeliningAllowed(false), spdyAllowed(false),-
10 withCredentials(true), preConnect(false), followRedirect(false), redirectCount(0)-
11{-
12}
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
13-
14QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(const QHttpNetworkRequestPrivate &other)-
15 : QHttpNetworkHeaderPrivate(other),-
16 operation(other.operation),-
17 customVerb(other.customVerb),-
18 priority(other.priority),-
19 uploadByteDevice(other.uploadByteDevice),-
20 autoDecompress(other.autoDecompress),-
21 pipeliningAllowed(other.pipeliningAllowed),-
22 spdyAllowed(other.spdyAllowed),-
23 withCredentials(other.withCredentials),-
24 ssl(other.ssl),-
25 preConnect(other.preConnect),-
26 followRedirect(other.followRedirect),-
27 redirectCount(other.redirectCount)-
28{-
29}
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
30-
31QHttpNetworkRequestPrivate::~QHttpNetworkRequestPrivate()-
32{-
33}-
34-
35bool QHttpNetworkRequestPrivate::operator==(const QHttpNetworkRequestPrivate &other) const-
36{-
37 return
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);
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
38 && (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
39 && (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
40 && (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
41 && (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
42 && (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
43 && (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
440
45 && (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
46 && (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
47 && (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
48 && (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
49}-
50-
51QByteArray QHttpNetworkRequest::methodName() const-
52{-
53 switch (d->operation) {-
54 case
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
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
55 return
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
"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
56 case
executed 118 times by 2 tests: case QHttpNetworkRequest::Head:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
QHttpNetworkRequest::Head:
executed 118 times by 2 tests: case QHttpNetworkRequest::Head:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
118
57 return
executed 118 times by 2 tests: return "HEAD";
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
"HEAD";
executed 118 times by 2 tests: return "HEAD";
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
118
58 case
executed 248 times by 4 tests: case QHttpNetworkRequest::Post:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
QHttpNetworkRequest::Post:
executed 248 times by 4 tests: case QHttpNetworkRequest::Post:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
248
59 return
executed 248 times by 4 tests: return "POST";
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
"POST";
executed 248 times by 4 tests: return "POST";
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
248
60 case
never executed: case QHttpNetworkRequest::Options:
QHttpNetworkRequest::Options:
never executed: case QHttpNetworkRequest::Options:
0
61 return
never executed: return "OPTIONS";
"OPTIONS";
never executed: return "OPTIONS";
0
62 case
executed 38 times by 3 tests: case QHttpNetworkRequest::Put:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
QHttpNetworkRequest::Put:
executed 38 times by 3 tests: case QHttpNetworkRequest::Put:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
38
63 return
executed 38 times by 3 tests: return "PUT";
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
"PUT";
executed 38 times by 3 tests: return "PUT";
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
38
64 case
executed 7 times by 1 test: case QHttpNetworkRequest::Delete:
Executed by:
  • tst_QNetworkReply
QHttpNetworkRequest::Delete:
executed 7 times by 1 test: case QHttpNetworkRequest::Delete:
Executed by:
  • tst_QNetworkReply
7
65 return
executed 7 times by 1 test: return "DELETE";
Executed by:
  • tst_QNetworkReply
"DELETE";
executed 7 times by 1 test: return "DELETE";
Executed by:
  • tst_QNetworkReply
7
66 case
never executed: case QHttpNetworkRequest::Trace:
QHttpNetworkRequest::Trace:
never executed: case QHttpNetworkRequest::Trace:
0
67 return
never executed: return "TRACE";
"TRACE";
never executed: return "TRACE";
0
68 case
never executed: case QHttpNetworkRequest::Connect:
QHttpNetworkRequest::Connect:
never executed: case QHttpNetworkRequest::Connect:
0
69 return
never executed: return "CONNECT";
"CONNECT";
never executed: return "CONNECT";
0
70 case
executed 7 times by 1 test: case QHttpNetworkRequest::Custom:
Executed by:
  • tst_QNetworkReply
QHttpNetworkRequest::Custom:
executed 7 times by 1 test: case QHttpNetworkRequest::Custom:
Executed by:
  • tst_QNetworkReply
7
71 return
executed 7 times by 1 test: return d->customVerb;
Executed by:
  • tst_QNetworkReply
d->customVerb;
executed 7 times by 1 test: return d->customVerb;
Executed by:
  • tst_QNetworkReply
7
72 default
never executed: default:
:
never executed: default:
0
73 break;
never executed: break;
0
74 }-
75 return
never executed: return QByteArray();
QByteArray();
never executed: return QByteArray();
0
76}-
77-
78QByteArray QHttpNetworkRequest::uri(bool throughProxy) const-
79{-
80 QUrl::FormattingOptions format(QUrl::RemoveFragment | QUrl::RemoveUserInfo | QUrl::FullyEncoded);-
81-
82-
83 if (d->operation == QHttpNetworkRequest::Post
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->uploadByteDevice
!d->uploadByteDeviceDescription
TRUEnever evaluated
FALSEevaluated 248 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
)
0-1773
84 format |= QUrl::RemoveQuery;
never executed: format |= QUrl::RemoveQuery;
0
85-
86 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
87 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
88 QUrl copy = d->url;-
89 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
90 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
executed 253 times by 6 tests: return qstring_literal_temp;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
qstring_literal_temp;
executed 253 times by 6 tests: return qstring_literal_temp;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
}()));
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
253
91 QByteArray uri = copy.toEncoded(format);-
92 return
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
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
93}-
94-
95QByteArray QHttpNetworkRequestPrivate::header(const QHttpNetworkRequest &request, bool throughProxy)-
96{-
97 QList<QPair<QByteArray, QByteArray> > fields = request.header();-
98 QByteArray ba;-
99 ba.reserve(40 + fields.length()*25);-
100-
101 ba += request.methodName();-
102 ba += ' ';-
103 ba += request.uri(throughProxy);-
104-
105 ba += " HTTP/";-
106 ba += QByteArray::number(request.majorVersion());-
107 ba += '.';-
108 ba += QByteArray::number(request.minorVersion());-
109 ba += "\r\n";-
110-
111 QList<QPair<QByteArray, QByteArray> >::const_iterator it = fields.constBegin();-
112 QList<QPair<QByteArray, QByteArray> >::const_iterator endIt = fields.constEnd();-
113 for (; it != endIt
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
; ++it) {
1724-9299
114 ba += it->first;-
115 ba += ": ";-
116 ba += it->second;-
117 ba += "\r\n";-
118 }
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
119 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
120-
121 if (request.headerField("content-type").isEmpty()
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->uploadByteDevice
request.d->uploadByteDeviceDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
FALSEnever evaluated
&& request.d->uploadByteDevice->size() > 0
request.d->upl...ce->size() > 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
FALSEnever evaluated
) || request.d->url.hasQuery()
request.d->url.hasQuery()Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0-185
122-
123-
124-
125 QMessageLogger(__FILE__, 166, __PRETTY_FUNCTION__).warning("content-type missing in HTTP POST, defaulting to application/x-www-form-urlencoded. Use QNetworkRequest::setHeader() to fix this problem.");-
126 ba += "Content-Type: application/x-www-form-urlencoded\r\n";-
127 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QHttpNetworkConnection
2
128 if (!request.d->uploadByteDevice
!request.d->uploadByteDeviceDescription
TRUEnever evaluated
FALSEevaluated 187 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
&& request.d->url.hasQuery()
request.d->url.hasQuery()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-187
129 QByteArray query = request.d->url.query(QUrl::FullyEncoded).toLatin1();-
130 ba += "Content-Length: ";-
131 ba += QByteArray::number(query.size());-
132 ba += "\r\n\r\n";-
133 ba += query;-
134 }
never executed: end of block
else {
0
135 ba += "\r\n";-
136 }
executed 187 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
187
137 } else {-
138 ba += "\r\n";-
139 }
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
140 return
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
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
141}-
142-
143-
144-
145-
146QHttpNetworkRequest::QHttpNetworkRequest(const QUrl &url, Operation operation, Priority priority)-
147 : d(new QHttpNetworkRequestPrivate(operation, priority, url))-
148{-
149}
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
150-
151QHttpNetworkRequest::QHttpNetworkRequest(const QHttpNetworkRequest &other)-
152 : QHttpNetworkHeader(other), d(other.d)-
153{-
154}
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
155-
156QHttpNetworkRequest::~QHttpNetworkRequest()-
157{-
158}-
159-
160QUrl QHttpNetworkRequest::url() const-
161{-
162 return
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
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
163}-
164void QHttpNetworkRequest::setUrl(const QUrl &url)-
165{-
166 d->url = url;-
167}
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
168-
169bool QHttpNetworkRequest::isSsl() const-
170{-
171 return
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
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
172}-
173void QHttpNetworkRequest::setSsl(bool s)-
174{-
175 d->ssl = s;-
176}
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
177-
178bool QHttpNetworkRequest::isPreConnect() const-
179{-
180 return
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
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
181}-
182void QHttpNetworkRequest::setPreConnect(bool preConnect)-
183{-
184 d->preConnect = preConnect;-
185}
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
186-
187bool QHttpNetworkRequest::isFollowRedirects() const-
188{-
189 return
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
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
190}-
191-
192void QHttpNetworkRequest::setFollowRedirects(bool followRedirect)-
193{-
194 d->followRedirect = followRedirect;-
195}
executed 9 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
9
196-
197int QHttpNetworkRequest::redirectCount() const-
198{-
199 return
executed 11 times by 1 test: return d->redirectCount;
Executed by:
  • tst_QNetworkReply
d->redirectCount;
executed 11 times by 1 test: return d->redirectCount;
Executed by:
  • tst_QNetworkReply
11
200}-
201-
202void QHttpNetworkRequest::setRedirectCount(int count)-
203{-
204 d->redirectCount = count;-
205}
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
206-
207qint64 QHttpNetworkRequest::contentLength() const-
208{-
209 return
executed 2643 times by 4 tests: return d->contentLength();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
d->contentLength();
executed 2643 times by 4 tests: return d->contentLength();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
2643
210}-
211-
212void QHttpNetworkRequest::setContentLength(qint64 length)-
213{-
214 d->setContentLength(length);-
215}
executed 200 times by 4 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
200
216-
217QList<QPair<QByteArray, QByteArray> > QHttpNetworkRequest::header() const-
218{-
219 return
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
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
220}-
221-
222QByteArray QHttpNetworkRequest::headerField(const QByteArray &name, const QByteArray &defaultValue) const-
223{-
224 return
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
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
225}-
226-
227void QHttpNetworkRequest::setHeaderField(const QByteArray &name, const QByteArray &data)-
228{-
229 d->setHeaderField(name, data);-
230}
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
231-
232QHttpNetworkRequest &QHttpNetworkRequest::operator=(const QHttpNetworkRequest &other)-
233{-
234 d = other.d;-
235 return
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
*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
236}-
237-
238bool QHttpNetworkRequest::operator==(const QHttpNetworkRequest &other) const-
239{-
240 return
never executed: return d->operator==(*other.d);
d->operator==(*other.d);
never executed: return d->operator==(*other.d);
0
241}-
242-
243QHttpNetworkRequest::Operation QHttpNetworkRequest::operation() const-
244{-
245 return
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
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
246}-
247-
248void QHttpNetworkRequest::setOperation(Operation operation)-
249{-
250 d->operation = operation;-
251}
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
252-
253QByteArray QHttpNetworkRequest::customVerb() const-
254{-
255 return
never executed: return d->customVerb;
d->customVerb;
never executed: return d->customVerb;
0
256}-
257-
258void QHttpNetworkRequest::setCustomVerb(const QByteArray &customVerb)-
259{-
260 d->customVerb = customVerb;-
261}
executed 7 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
7
262-
263QHttpNetworkRequest::Priority QHttpNetworkRequest::priority() const-
264{-
265 return
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
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
266}-
267-
268void QHttpNetworkRequest::setPriority(Priority priority)-
269{-
270 d->priority = priority;-
271}
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
272-
273bool QHttpNetworkRequest::isPipeliningAllowed() const-
274{-
275 return
executed 3371 times by 2 tests: return d->pipeliningAllowed;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
d->pipeliningAllowed;
executed 3371 times by 2 tests: return d->pipeliningAllowed;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
3371
276}-
277-
278void QHttpNetworkRequest::setPipeliningAllowed(bool b)-
279{-
280 d->pipeliningAllowed = b;-
281}
executed 453 times by 2 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
453
282-
283bool QHttpNetworkRequest::isSPDYAllowed() const-
284{-
285 return
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
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
286}-
287-
288void QHttpNetworkRequest::setSPDYAllowed(bool b)-
289{-
290 d->spdyAllowed = b;-
291}
executed 113 times by 1 test: end of block
Executed by:
  • tst_Spdy
113
292-
293bool QHttpNetworkRequest::withCredentials() const-
294{-
295 return
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
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
296}-
297-
298void QHttpNetworkRequest::setWithCredentials(bool b)-
299{-
300 d->withCredentials = b;-
301}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QNetworkReply
1
302-
303void QHttpNetworkRequest::setUploadByteDevice(QNonContiguousByteDevice *bd)-
304{-
305 d->uploadByteDevice = bd;-
306}
executed 201 times by 4 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
201
307-
308QNonContiguousByteDevice* QHttpNetworkRequest::uploadByteDevice() const-
309{-
310 return
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
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
311}-
312-
313int QHttpNetworkRequest::majorVersion() const-
314{-
315 return
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
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
316}-
317-
318int QHttpNetworkRequest::minorVersion() const-
319{-
320 return
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
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
321}-
322-
323-
324-
Switch to Source codePreprocessed file

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