qhttpprotocolhandler.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/access/qhttpprotocolhandler.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6QHttpProtocolHandler::QHttpProtocolHandler(QHttpNetworkConnectionChannel *channel)-
7 : QAbstractProtocolHandler(channel)-
8{-
9}
executed 731 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
731
10-
11void QHttpProtocolHandler::_q_receiveReply()-
12{-
13 ((!(m_socket)) ? qt_assert("m_socket",__FILE__,56) : qt_noop());-
14-
15 if (!m_reply
!m_replyDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 9894 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
7-9894
16 if (m_socket->bytesAvailable() > 0
m_socket->bytesAvailable() > 0Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
0-7
17 QMessageLogger(__FILE__, 60, __PRETTY_FUNCTION__).warning() << "QAbstractProtocolHandler::_q_receiveReply() called without QHttpNetworkReply,"
never executed: QMessageLogger(__FILE__, 60, __PRETTY_FUNCTION__).warning() << "QAbstractProtocolHandler::_q_receiveReply() called without QHttpNetworkReply," << m_socket->bytesAvailable() << "bytes on socket.";
0
18 << m_socket->bytesAvailable() << "bytes on socket.";
never executed: QMessageLogger(__FILE__, 60, __PRETTY_FUNCTION__).warning() << "QAbstractProtocolHandler::_q_receiveReply() called without QHttpNetworkReply," << m_socket->bytesAvailable() << "bytes on socket.";
0
19 m_channel->close();-
20 return;
executed 7 times by 1 test: return;
Executed by:
  • tst_QNetworkReply
7
21 }-
22-
23-
24-
25-
26 if (!qobject_cast<QHttpNetworkConnection*>(m_connection)
!qobject_cast<...(m_connection)Description
TRUEnever evaluated
FALSEevaluated 9894 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
0-9894
27 return;
never executed: return;
0
28 }-
29-
30 QAbstractSocket::SocketState socketState = m_socket->state();-
31-
32-
33 if (socketState == QAbstractSocket::UnconnectedState
socketState ==...connectedStateDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 9862 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
32-9862
34 if (m_socket->bytesAvailable() <= 0
m_socket->byte...ailable() <= 0Description
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-32
35 if (m_reply->d_func()->state == QHttpNetworkReplyPrivate::ReadingDataState
m_reply->d_fun...adingDataStateDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
16
36-
37 m_reply->d_func()->state = QHttpNetworkReplyPrivate::AllDoneState;-
38 m_channel->allDone();-
39 return;
executed 16 times by 1 test: return;
Executed by:
  • tst_QNetworkReply
16
40 } else {-
41 m_channel->handleUnexpectedEOF();-
42 return;
executed 16 times by 2 tests: return;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
16
43 }-
44 } else {-
45-
46 }
never executed: end of block
0
47 }-
48-
49-
50 qint64 bytes = 0;-
51 qint64 lastBytes = bytes;-
52 do {-
53 lastBytes = bytes;-
54-
55 QHttpNetworkReplyPrivate::ReplyState state = m_reply->d_func()->state;-
56 switch (state) {-
57 case
executed 1693 times by 7 tests: case QHttpNetworkReplyPrivate::NothingDoneState:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
QHttpNetworkReplyPrivate::NothingDoneState:
executed 1693 times by 7 tests: case QHttpNetworkReplyPrivate::NothingDoneState:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
{
1693
58 m_reply->d_func()->state = QHttpNetworkReplyPrivate::ReadingStatusState;-
59-
60 }-
61 case
executed 113 times by 2 tests: case QHttpNetworkReplyPrivate::ReadingStatusState:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
QHttpNetworkReplyPrivate::ReadingStatusState:
executed 113 times by 2 tests: case QHttpNetworkReplyPrivate::ReadingStatusState:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
code before this statement executed 1693 times by 7 tests: case QHttpNetworkReplyPrivate::ReadingStatusState:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
{
113-1693
62 qint64 statusBytes = m_reply->d_func()->readStatus(m_socket);-
63 if (statusBytes == -1
statusBytes == -1Description
TRUEevaluated 70 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1736 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
70-1736
64-
65 m_channel->handleUnexpectedEOF();-
66 return;
executed 70 times by 1 test: return;
Executed by:
  • tst_QNetworkReply
70
67 }-
68 bytes += statusBytes;-
69 m_channel->lastStatus = m_reply->d_func()->statusCode;-
70 break;
executed 1736 times by 7 tests: break;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
1736
71 }-
72 case
executed 1701 times by 7 tests: case QHttpNetworkReplyPrivate::ReadingHeaderState:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
QHttpNetworkReplyPrivate::ReadingHeaderState:
executed 1701 times by 7 tests: case QHttpNetworkReplyPrivate::ReadingHeaderState:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
{
1701
73 QHttpNetworkReplyPrivate *replyPrivate = m_reply->d_func();-
74 qint64 headerBytes = replyPrivate->readHeader(m_socket);-
75 if (headerBytes == -1
headerBytes == -1Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1695 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
6-1695
76-
77 m_channel->handleUnexpectedEOF();-
78 return;
executed 6 times by 1 test: return;
Executed by:
  • tst_QNetworkReply
6
79 }-
80 bytes += headerBytes;-
81-
82 if (replyPrivate->state == QHttpNetworkReplyPrivate::ReadingDataState
replyPrivate->...adingDataStateDescription
TRUEevaluated 1624 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 71 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
71-1624
83 if (replyPrivate->isCompressed()
replyPrivate->isCompressed()Description
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 1616 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
&& replyPrivate->autoDecompress
replyPrivate->autoDecompressDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QHttpNetworkConnection
) {
1-1616
84-
85 replyPrivate->removeAutoDecompressHeader();-
86 }
executed 7 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else {
7
87 replyPrivate->autoDecompress = false;-
88 }
executed 1617 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
1617
89 if (replyPrivate->statusCode == 100
replyPrivate->...tusCode == 100Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1617 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
7-1617
90 replyPrivate->clearHttpLayerInformation();-
91 replyPrivate->state = QHttpNetworkReplyPrivate::ReadingStatusState;-
92 break;
executed 7 times by 1 test: break;
Executed by:
  • tst_QNetworkReply
7
93 }-
94 if (replyPrivate->shouldEmitSignals()
replyPrivate->...dEmitSignals()Description
TRUEevaluated 1418 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 199 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
)
199-1418
95 m_reply->headerChanged();
executed 1418 times by 7 tests: m_reply->headerChanged();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
1418
96-
97-
98-
99-
100 if (!replyPrivate->expectContent()
!replyPrivate->expectContent()Description
TRUEevaluated 152 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
FALSEevaluated 1465 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
) {
152-1465
101 replyPrivate->state = QHttpNetworkReplyPrivate::AllDoneState;-
102 m_channel->allDone();-
103 break;
executed 152 times by 4 tests: break;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
152
104 }-
105 }
executed 1465 times by 6 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
1465
106 break;
executed 1536 times by 6 tests: break;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
1536
107 }-
108 case
executed 18056 times by 6 tests: case QHttpNetworkReplyPrivate::ReadingDataState:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
QHttpNetworkReplyPrivate::ReadingDataState:
executed 18056 times by 6 tests: case QHttpNetworkReplyPrivate::ReadingDataState:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
{
18056
109 QHttpNetworkReplyPrivate *replyPrivate = m_reply->d_func();-
110 if (m_socket->state() == QAbstractSocket::ConnectedState
m_socket->stat...ConnectedStateDescription
TRUEevaluated 18056 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
&&
0-18056
111 replyPrivate->downstreamLimited
replyPrivate->...nstreamLimitedDescription
TRUEevaluated 737 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 17319 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
&& !replyPrivate->responseData.isEmpty()
!replyPrivate-...Data.isEmpty()Description
TRUEevaluated 241 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 496 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
&& replyPrivate->shouldEmitSignals()
replyPrivate->...dEmitSignals()Description
TRUEevaluated 241 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-17319
112-
113-
114-
115-
116-
117-
118-
119 return;
executed 241 times by 2 tests: return;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
241
120 }-
121-
122 if (replyPrivate->userProvidedDownloadBuffer
replyPrivate->...DownloadBufferDescription
TRUEevaluated 2657 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 15158 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
) {
2657-15158
123-
124-
125-
126-
127 qint64 haveRead = replyPrivate->readBodyVeryFast(m_socket, replyPrivate->userProvidedDownloadBuffer + replyPrivate->totalProgress);-
128 if (haveRead > 0
haveRead > 0Description
TRUEevaluated 1490 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 1167 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
) {
1167-1490
129 bytes += haveRead;-
130 replyPrivate->totalProgress += haveRead;-
131-
132 m_reply->dataReadProgress(replyPrivate->totalProgress, replyPrivate->bodyLength);-
133 }
executed 1490 times by 3 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
else if (haveRead == 0
haveRead == 0Description
TRUEevaluated 1165 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
) {
2-1490
134-
135 }
executed 1165 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else if (haveRead < 0
haveRead < 0Description
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-1165
136 m_connection->d_func()->emitReplyError(m_socket, m_reply, QNetworkReply::RemoteHostClosedError);-
137 break;
executed 2 times by 2 tests: break;
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
2
138 }-
139 }
executed 2655 times by 3 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
else if (!replyPrivate->isChunked()
!replyPrivate->isChunked()Description
TRUEevaluated 14715 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
FALSEevaluated 443 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
&& !replyPrivate->autoDecompress
!replyPrivate->autoDecompressDescription
TRUEevaluated 14705 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_QNetworkReply
10-14715
140 && replyPrivate->bodyLength > 0
replyPrivate->bodyLength > 0Description
TRUEevaluated 14686 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
FALSEevaluated 19 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
19-14686
141-
142-
143 qint64 haveRead = replyPrivate->readBodyFast(m_socket, &replyPrivate->responseData);-
144 bytes += haveRead;-
145 replyPrivate->totalProgress += haveRead;-
146 if (replyPrivate->shouldEmitSignals()
replyPrivate->...dEmitSignals()Description
TRUEevaluated 14437 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
FALSEevaluated 249 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
) {
249-14437
147 m_reply->readyRead();-
148 m_reply->dataReadProgress(replyPrivate->totalProgress, replyPrivate->bodyLength);-
149 }
executed 14437 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
14437
150 }
executed 14686 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
14686
151 else-
152 {-
153-
154-
155 qint64 haveRead = replyPrivate->readBody(m_socket, &replyPrivate->responseData);-
156 if (haveRead > 0
haveRead > 0Description
TRUEevaluated 289 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 183 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
) {
183-289
157 bytes += haveRead;-
158 replyPrivate->totalProgress += haveRead;-
159 if (replyPrivate->shouldEmitSignals()
replyPrivate->...dEmitSignals()Description
TRUEevaluated 286 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
3-286
160 m_reply->readyRead();-
161 m_reply->dataReadProgress(replyPrivate->totalProgress, replyPrivate->bodyLength);-
162 }
executed 286 times by 4 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
286
163 }
executed 289 times by 4 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
else if (haveRead == -1
haveRead == -1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 182 times by 4 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
) {
1-289
164-
165 m_connection->d_func()->emitReplyError(m_socket, m_reply, QNetworkReply::ProtocolFailure);-
166 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QNetworkReply
1
167 }-
168 }
executed 471 times by 4 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
471
169-
170 if (replyPrivate->state == QHttpNetworkReplyPrivate::ReadingDataState
replyPrivate->...adingDataStateDescription
TRUEevaluated 16375 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 1437 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
)
1437-16375
171 break;
executed 16375 times by 6 tests: break;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
16375
172-
173-
174 }-
175 case
executed 157 times by 2 tests: case QHttpNetworkReplyPrivate::AllDoneState:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
QHttpNetworkReplyPrivate::AllDoneState:
executed 157 times by 2 tests: case QHttpNetworkReplyPrivate::AllDoneState:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
code before this statement executed 1437 times by 6 tests: case QHttpNetworkReplyPrivate::AllDoneState:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
157-1437
176 m_channel->allDone();-
177 break;
executed 1594 times by 6 tests: break;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
1594
178 default
never executed: default:
:
never executed: default:
0
179 break;
never executed: break;
0
180 }-
181 } while (bytes != lastBytes
bytes != lastBytesDescription
TRUEevaluated 12888 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 8515 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
&& m_reply
m_replyDescription
TRUEevaluated 11858 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 1030 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
);
1030-12888
182}
executed 9545 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
9545
183-
184void QHttpProtocolHandler::_q_readyRead()-
185{-
186 if (m_socket->state() == QAbstractSocket::ConnectedState
m_socket->stat...ConnectedStateDescription
TRUEevaluated 9717 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
&& m_socket->bytesAvailable() == 0
m_socket->byte...ailable() == 0Description
TRUEevaluated 188 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 9529 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
0-9717
187-
188-
189-
190-
191 char c;-
192 qint64 ret = m_socket->peek(&c, 1);-
193 if (ret < 0
ret < 0Description
TRUEevaluated 45 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 143 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
45-143
194 m_channel->_q_error(m_socket->error());-
195-
196 if (m_reply
m_replyDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 13 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
)
13-32
197 _q_receiveReply();
executed 32 times by 2 tests: _q_receiveReply();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
32
198 return;
executed 45 times by 3 tests: return;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
45
199 }-
200 }
executed 143 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
143
201-
202 if (m_channel->isSocketWaiting()
m_channel->isSocketWaiting()Description
TRUEevaluated 1158 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 8514 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
|| m_channel->isSocketReading()
m_channel->isSocketReading()Description
TRUEevaluated 8509 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
5-8514
203 if (m_socket->bytesAvailable()
m_socket->bytesAvailable()Description
TRUEevaluated 9530 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 137 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
137-9530
204-
205-
206-
207 m_channel->state = QHttpNetworkConnectionChannel::ReadingState;-
208 }
executed 9530 times by 6 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
9530
209 if (m_reply
m_replyDescription
TRUEevaluated 9667 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
)
0-9667
210 _q_receiveReply();
executed 9667 times by 6 tests: _q_receiveReply();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
9667
211 }
executed 9667 times by 6 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
9667
212}
executed 9672 times by 6 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
9672
213-
214bool QHttpProtocolHandler::sendRequest()-
215{-
216 m_reply = m_channel->reply;-
217-
218 if (!m_reply
!m_replyDescription
TRUEnever evaluated
FALSEevaluated 6085 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-6085
219-
220 QMessageLogger(__FILE__, 263, __PRETTY_FUNCTION__).warning("QAbstractProtocolHandler::sendRequest() called without QHttpNetworkReply");-
221 return
never executed: return false;
false;
never executed: return false;
0
222 }-
223-
224 switch (m_channel->state) {-
225 case
executed 1443 times by 8 tests: case QHttpNetworkConnectionChannel::IdleState:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
QHttpNetworkConnectionChannel::IdleState:
executed 1443 times by 8 tests: case QHttpNetworkConnectionChannel::IdleState:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
{
1443
226 if (!m_channel->ensureConnection()
!m_channel->ensureConnection()Description
TRUEevaluated 121 times by 2 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
FALSEevaluated 1322 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
121-1322
227-
228-
229-
230 return
executed 121 times by 2 tests: return false;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
false;
executed 121 times by 2 tests: return false;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
121
231 }-
232 QString scheme = m_channel->request.url().scheme();-
233 if (scheme == QLatin1String("preconnect-http")
scheme == QLat...connect-http")Description
TRUEnever evaluated
FALSEevaluated 1322 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-1322
234 || scheme == QLatin1String("preconnect-https")
scheme == QLat...onnect-https")Description
TRUEnever evaluated
FALSEevaluated 1322 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-1322
235 m_channel->state = QHttpNetworkConnectionChannel::IdleState;-
236 m_reply->d_func()->state = QHttpNetworkReplyPrivate::AllDoneState;-
237 m_channel->allDone();-
238 m_connection->preConnectFinished();-
239 m_reply = 0;-
240 return
never executed: return true;
true;
never executed: return true;
0
241 }-
242-
243 m_channel->written = 0;-
244 m_channel->bytesTotal = 0;-
245-
246 QHttpNetworkReplyPrivate *replyPrivate = m_reply->d_func();-
247 replyPrivate->clear();-
248 replyPrivate->connection = m_connection;-
249 replyPrivate->connectionChannel = m_channel;-
250 replyPrivate->autoDecompress = m_channel->request.d->autoDecompress;-
251 replyPrivate->pipeliningUsed = false;-
252-
253-
254-
255 if (!m_channel->request.url().userInfo().isEmpty()
!m_channel->re...fo().isEmpty()Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1296 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
&& m_channel->request.withCredentials()
m_channel->req...hCredentials()Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-1296
256 QUrl url = m_channel->request.url();-
257 QAuthenticator &auth = m_channel->authenticator;-
258 if (url.userName() != auth.user()
url.userName() != auth.user()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_QNetworkReply
10-16
259 || (!url.password().isEmpty()
!url.password().isEmpty()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
&& url.password() != auth.password()
url.password()...uth.password()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)) {
0-10
260 auth.setUser(url.userName());-
261 auth.setPassword(url.password());-
262 m_connection->d_func()->copyCredentials(m_connection->d_func()->indexOf(m_socket), &auth, false);-
263 }
executed 18 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
18
264-
265-
266 url.setUserInfo(QString());-
267 m_channel->request.setUrl(url);-
268 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
26
269-
270-
271 if (m_channel->request.withCredentials()
m_channel->req...hCredentials()Description
TRUEevaluated 1321 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 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
)
1-1321
272 m_connection->d_func()->createAuthorization(m_socket, m_channel->request);
executed 1321 times by 8 tests: m_connection->d_func()->createAuthorization(m_socket, m_channel->request);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1321
273-
274 QByteArray header = QHttpNetworkRequestPrivate::header(m_channel->request,-
275 (m_connection->d_func()->networkProxy.type() != QNetworkProxy::NoProxy));-
276-
277-
278-
279 m_socket->write(header);-
280-
281-
282 QNonContiguousByteDevice* uploadByteDevice = m_channel->request.uploadByteDevice();-
283 if (uploadByteDevice
uploadByteDeviceDescription
TRUEevaluated 227 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
FALSEevaluated 1095 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
227-1095
284-
285 QObject::connect(uploadByteDevice, qFlagLocation("2""readyRead()" "\0" __FILE__ ":" "328"), m_channel, qFlagLocation("1""_q_uploadDataReadyRead()" "\0" __FILE__ ":" "328"));-
286-
287 m_channel->bytesTotal = m_channel->request.contentLength();-
288-
289 m_channel->state = QHttpNetworkConnectionChannel::WritingState;-
290 sendRequest();-
291 }
executed 227 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
else {
227
292 m_channel->state = QHttpNetworkConnectionChannel::WaitingState;-
293 sendRequest();-
294 }
executed 1095 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
1095
295-
296 break;
executed 1322 times by 8 tests: break;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1322
297 }-
298 case
executed 3320 times by 3 tests: case QHttpNetworkConnectionChannel::WritingState:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
QHttpNetworkConnectionChannel::WritingState:
executed 3320 times by 3 tests: case QHttpNetworkConnectionChannel::WritingState:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
3320
299 {-
300-
301 QNonContiguousByteDevice* uploadByteDevice = m_channel->request.uploadByteDevice();-
302 if (!uploadByteDevice
!uploadByteDeviceDescription
TRUEnever evaluated
FALSEevaluated 3320 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
|| m_channel->bytesTotal == m_channel->written
m_channel->byt...annel->writtenDescription
TRUEevaluated 31 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 3289 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
) {
0-3320
303 if (uploadByteDevice
uploadByteDeviceDescription
TRUEevaluated 31 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
)
0-31
304 m_reply->dataSendProgress(m_channel->written, m_channel->bytesTotal);
executed 31 times by 1 test: m_reply->dataSendProgress(m_channel->written, m_channel->bytesTotal);
Executed by:
  • tst_QNetworkReply
31
305 m_channel->state = QHttpNetworkConnectionChannel::WaitingState;-
306 sendRequest();-
307 break;
executed 31 times by 1 test: break;
Executed by:
  • tst_QNetworkReply
31
308 }-
309-
310-
311 const qint64 socketBufferFill = 32*1024;-
312 const qint64 socketWriteMaxSize = 16*1024;-
313-
314-
315-
316 QSslSocket *sslSocket = qobject_cast<QSslSocket*>(m_socket);-
317-
318 while ((
(m_socket->byt...cketBufferFillDescription
TRUEevaluated 5428 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
FALSEevaluated 341 times by 1 test
Evaluated by:
  • tst_QNetworkReply
m_socket->bytesToWrite() + (sslSocket ? sslSocket->encryptedBytesToWrite() : 0))
(m_socket->byt...cketBufferFillDescription
TRUEevaluated 5428 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
FALSEevaluated 341 times by 1 test
Evaluated by:
  • tst_QNetworkReply
341-5428
319 <= socketBufferFill
(m_socket->byt...cketBufferFillDescription
TRUEevaluated 5428 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
FALSEevaluated 341 times by 1 test
Evaluated by:
  • tst_QNetworkReply
&& m_channel->bytesTotal != m_channel->written
m_channel->byt...annel->writtenDescription
TRUEevaluated 5428 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
FALSEnever evaluated
)
0-5428
320-
321-
322-
323-
324 {-
325-
326 qint64 currentReadSize = 0;-
327 qint64 desiredReadSize = qMin(socketWriteMaxSize, m_channel->bytesTotal - m_channel->written);-
328 const char *readPointer = uploadByteDevice->readPointer(desiredReadSize, currentReadSize);-
329-
330 if (currentReadSize == -1
currentReadSize == -1Description
TRUEnever evaluated
FALSEevaluated 5428 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
) {
0-5428
331-
332 m_connection->d_func()->emitReplyError(m_socket, m_reply, QNetworkReply::UnknownNetworkError);-
333 return
never executed: return false;
false;
never executed: return false;
0
334 } else if (readPointer == 0
readPointer == 0Description
TRUEevaluated 2752 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
FALSEevaluated 2676 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
|| currentReadSize == 0
currentReadSize == 0Description
TRUEnever evaluated
FALSEevaluated 2676 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
) {
0-2752
335-
336 break;
executed 2752 times by 2 tests: break;
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
2752
337 } else {-
338 if (m_channel->written != uploadByteDevice->pos()
m_channel->wri...eDevice->pos()Description
TRUEnever evaluated
FALSEevaluated 2676 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
) {
0-2676
339-
340 QMessageLogger(__FILE__, 383, __PRETTY_FUNCTION__).warning() << "QHttpProtocolHandler: Internal error in sendRequest. Expected to write at position" << m_channel->written << "but read device is at" << uploadByteDevice->pos();-
341 ((!(m_channel->written == uploadByteDevice->pos())) ? qt_assert("m_channel->written == uploadByteDevice->pos()",__FILE__,384) : qt_noop());-
342 m_connection->d_func()->emitReplyError(m_socket, m_reply, QNetworkReply::ProtocolFailure);-
343 return
never executed: return false;
false;
never executed: return false;
0
344 }-
345 qint64 currentWriteSize = m_socket->write(readPointer, currentReadSize);-
346 if (currentWriteSize == -1
currentWriteSize == -1Description
TRUEnever evaluated
FALSEevaluated 2676 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
|| currentWriteSize != currentReadSize
currentWriteSi...urrentReadSizeDescription
TRUEnever evaluated
FALSEevaluated 2676 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
) {
0-2676
347-
348 m_connection->d_func()->emitReplyError(m_socket, m_reply, QNetworkReply::UnknownNetworkError);-
349 return
never executed: return false;
false;
never executed: return false;
0
350 } else {-
351 m_channel->written += currentWriteSize;-
352 uploadByteDevice->advanceReadPointer(currentWriteSize);-
353-
354 m_reply->dataSendProgress(m_channel->written, m_channel->bytesTotal);-
355-
356 if (m_channel->written == m_channel->bytesTotal
m_channel->wri...el->bytesTotalDescription
TRUEevaluated 196 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
FALSEevaluated 2480 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
196-2480
357-
358 m_channel->state = QHttpNetworkConnectionChannel::WaitingState;-
359 sendRequest();-
360 break;
executed 196 times by 3 tests: break;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
196
361 }-
362 }
executed 2480 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
2480
363 }-
364 }-
365 break;
executed 3289 times by 3 tests: break;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
3289
366 }-
367-
368 case
executed 1322 times by 8 tests: case QHttpNetworkConnectionChannel::WaitingState:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
QHttpNetworkConnectionChannel::WaitingState:
executed 1322 times by 8 tests: case QHttpNetworkConnectionChannel::WaitingState:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1322
369 {-
370 QNonContiguousByteDevice* uploadByteDevice = m_channel->request.uploadByteDevice();-
371 if (uploadByteDevice
uploadByteDeviceDescription
TRUEevaluated 227 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
FALSEevaluated 1095 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
227-1095
372 QObject::disconnect(uploadByteDevice, qFlagLocation("2""readyRead()" "\0" __FILE__ ":" "415"), m_channel, qFlagLocation("1""_q_uploadDataReadyRead()" "\0" __FILE__ ":" "415"));-
373 }
executed 227 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
227
374 if (m_socket->bytesAvailable()
m_socket->bytesAvailable()Description
TRUEevaluated 197 times by 2 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 1125 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
)
197-1125
375 QMetaObject::invokeMethod(m_channel, "_q_receiveReply", Qt::QueuedConnection);
executed 197 times by 2 tests: QMetaObject::invokeMethod(m_channel, "_q_receiveReply", Qt::QueuedConnection);
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
197
376 break;
executed 1322 times by 8 tests: break;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1322
377 }-
378 case
never executed: case QHttpNetworkConnectionChannel::ReadingState:
QHttpNetworkConnectionChannel::ReadingState:
never executed: case QHttpNetworkConnectionChannel::ReadingState:
0
379-
380-
381 default
never executed: default:
:
never executed: default:
0
382 break;
never executed: break;
0
383 }-
384 return
executed 5964 times by 8 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
true;
executed 5964 times by 8 tests: return true;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
5964
385}-
386-
387-
Switch to Source codePreprocessed file

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