| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/network/access/qhttpnetworkconnectionchannel.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||
| 14 | - | |||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||
| 19 | static const int reconnectAttemptsDefault = 3; | - | ||||||||||||||||||||||||
| 20 | - | |||||||||||||||||||||||||
| 21 | QHttpNetworkConnectionChannel::QHttpNetworkConnectionChannel() | - | ||||||||||||||||||||||||
| 22 | : socket(0) | - | ||||||||||||||||||||||||
| 23 | , ssl(false) | - | ||||||||||||||||||||||||
| 24 | , isInitialized(false) | - | ||||||||||||||||||||||||
| 25 | , state(IdleState) | - | ||||||||||||||||||||||||
| 26 | , reply(0) | - | ||||||||||||||||||||||||
| 27 | , written(0) | - | ||||||||||||||||||||||||
| 28 | , bytesTotal(0) | - | ||||||||||||||||||||||||
| 29 | , resendCurrent(false) | - | ||||||||||||||||||||||||
| 30 | , lastStatus(0) | - | ||||||||||||||||||||||||
| 31 | , pendingEncrypt(false) | - | ||||||||||||||||||||||||
| 32 | , reconnectAttempts(reconnectAttemptsDefault) | - | ||||||||||||||||||||||||
| 33 | , authMethod(QAuthenticatorPrivate::None) | - | ||||||||||||||||||||||||
| 34 | , proxyAuthMethod(QAuthenticatorPrivate::None) | - | ||||||||||||||||||||||||
| 35 | , authenticationCredentialsSent(false) | - | ||||||||||||||||||||||||
| 36 | , proxyCredentialsSent(false) | - | ||||||||||||||||||||||||
| 37 | , protocolHandler(0) | - | ||||||||||||||||||||||||
| 38 | - | |||||||||||||||||||||||||
| 39 | , ignoreAllSslErrors(false) | - | ||||||||||||||||||||||||
| 40 | - | |||||||||||||||||||||||||
| 41 | , pipeliningSupported(PipeliningSupportUnknown) | - | ||||||||||||||||||||||||
| 42 | , networkLayerPreference(QAbstractSocket::AnyIPProtocol) | - | ||||||||||||||||||||||||
| 43 | , connection(0) | - | ||||||||||||||||||||||||
| 44 | { | - | ||||||||||||||||||||||||
| 45 | - | |||||||||||||||||||||||||
| 46 | - | |||||||||||||||||||||||||
| 47 | } executed 3416 times by 8 tests: end of blockExecuted by:
| 3416 | ||||||||||||||||||||||||
| 48 | - | |||||||||||||||||||||||||
| 49 | void QHttpNetworkConnectionChannel::init() | - | ||||||||||||||||||||||||
| 50 | { | - | ||||||||||||||||||||||||
| 51 | - | |||||||||||||||||||||||||
| 52 | if (connection->d_func()->encrypt
| 108-646 | ||||||||||||||||||||||||
| 53 | socket = new QSslSocket; executed 108 times by 3 tests: socket = new QSslSocket;Executed by:
| 108 | ||||||||||||||||||||||||
| 54 | else | - | ||||||||||||||||||||||||
| 55 | socket = new QTcpSocket; executed 646 times by 8 tests: socket = new QTcpSocket;Executed by:
| 646 | ||||||||||||||||||||||||
| 56 | - | |||||||||||||||||||||||||
| 57 | - | |||||||||||||||||||||||||
| 58 | - | |||||||||||||||||||||||||
| 59 | - | |||||||||||||||||||||||||
| 60 | - | |||||||||||||||||||||||||
| 61 | if (networkSession
| 44-710 | ||||||||||||||||||||||||
| 62 | socket->setProperty("_q_networksession", QVariant::fromValue(networkSession)); executed 710 times by 8 tests: socket->setProperty("_q_networksession", QVariant::fromValue(networkSession));Executed by:
| 710 | ||||||||||||||||||||||||
| 63 | - | |||||||||||||||||||||||||
| 64 | - | |||||||||||||||||||||||||
| 65 | - | |||||||||||||||||||||||||
| 66 | socket->setProxy(QNetworkProxy::NoProxy); | - | ||||||||||||||||||||||||
| 67 | - | |||||||||||||||||||||||||
| 68 | - | |||||||||||||||||||||||||
| 69 | - | |||||||||||||||||||||||||
| 70 | - | |||||||||||||||||||||||||
| 71 | - | |||||||||||||||||||||||||
| 72 | QObject::connect(socket, qFlagLocation("2""bytesWritten(qint64)" "\0" __FILE__ ":" "123"), | - | ||||||||||||||||||||||||
| 73 | this, qFlagLocation("1""_q_bytesWritten(qint64)" "\0" __FILE__ ":" "124"), | - | ||||||||||||||||||||||||
| 74 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 75 | QObject::connect(socket, qFlagLocation("2""connected()" "\0" __FILE__ ":" "126"), | - | ||||||||||||||||||||||||
| 76 | this, qFlagLocation("1""_q_connected()" "\0" __FILE__ ":" "127"), | - | ||||||||||||||||||||||||
| 77 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 78 | QObject::connect(socket, qFlagLocation("2""readyRead()" "\0" __FILE__ ":" "129"), | - | ||||||||||||||||||||||||
| 79 | this, qFlagLocation("1""_q_readyRead()" "\0" __FILE__ ":" "130"), | - | ||||||||||||||||||||||||
| 80 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 81 | - | |||||||||||||||||||||||||
| 82 | - | |||||||||||||||||||||||||
| 83 | - | |||||||||||||||||||||||||
| 84 | - | |||||||||||||||||||||||||
| 85 | - | |||||||||||||||||||||||||
| 86 | - | |||||||||||||||||||||||||
| 87 | - | |||||||||||||||||||||||||
| 88 | qRegisterMetaType<QAbstractSocket::SocketError>(); | - | ||||||||||||||||||||||||
| 89 | QObject::connect(socket, qFlagLocation("2""disconnected()" "\0" __FILE__ ":" "140"), | - | ||||||||||||||||||||||||
| 90 | this, qFlagLocation("1""_q_disconnected()" "\0" __FILE__ ":" "141"), | - | ||||||||||||||||||||||||
| 91 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 92 | QObject::connect(socket, qFlagLocation("2""error(QAbstractSocket::SocketError)" "\0" __FILE__ ":" "143"), | - | ||||||||||||||||||||||||
| 93 | this, qFlagLocation("1""_q_error(QAbstractSocket::SocketError)" "\0" __FILE__ ":" "144"), | - | ||||||||||||||||||||||||
| 94 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 95 | - | |||||||||||||||||||||||||
| 96 | - | |||||||||||||||||||||||||
| 97 | - | |||||||||||||||||||||||||
| 98 | QObject::connect(socket, qFlagLocation("2""proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)" "\0" __FILE__ ":" "149"), | - | ||||||||||||||||||||||||
| 99 | this, qFlagLocation("1""_q_proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)" "\0" __FILE__ ":" "150"), | - | ||||||||||||||||||||||||
| 100 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 101 | - | |||||||||||||||||||||||||
| 102 | - | |||||||||||||||||||||||||
| 103 | - | |||||||||||||||||||||||||
| 104 | QSslSocket *sslSocket = qobject_cast<QSslSocket*>(socket); | - | ||||||||||||||||||||||||
| 105 | if (sslSocket
| 108-646 | ||||||||||||||||||||||||
| 106 | - | |||||||||||||||||||||||||
| 107 | QObject::connect(sslSocket, qFlagLocation("2""encrypted()" "\0" __FILE__ ":" "158"), | - | ||||||||||||||||||||||||
| 108 | this, qFlagLocation("1""_q_encrypted()" "\0" __FILE__ ":" "159"), | - | ||||||||||||||||||||||||
| 109 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 110 | QObject::connect(sslSocket, qFlagLocation("2""sslErrors(QList<QSslError>)" "\0" __FILE__ ":" "161"), | - | ||||||||||||||||||||||||
| 111 | this, qFlagLocation("1""_q_sslErrors(QList<QSslError>)" "\0" __FILE__ ":" "162"), | - | ||||||||||||||||||||||||
| 112 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 113 | QObject::connect(sslSocket, qFlagLocation("2""preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator*)" "\0" __FILE__ ":" "164"), | - | ||||||||||||||||||||||||
| 114 | this, qFlagLocation("1""_q_preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator*)" "\0" __FILE__ ":" "165"), | - | ||||||||||||||||||||||||
| 115 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 116 | QObject::connect(sslSocket, qFlagLocation("2""encryptedBytesWritten(qint64)" "\0" __FILE__ ":" "167"), | - | ||||||||||||||||||||||||
| 117 | this, qFlagLocation("1""_q_encryptedBytesWritten(qint64)" "\0" __FILE__ ":" "168"), | - | ||||||||||||||||||||||||
| 118 | Qt::DirectConnection); | - | ||||||||||||||||||||||||
| 119 | - | |||||||||||||||||||||||||
| 120 | if (ignoreAllSslErrors
| 11-97 | ||||||||||||||||||||||||
| 121 | sslSocket->ignoreSslErrors(); executed 11 times by 2 tests: sslSocket->ignoreSslErrors();Executed by:
| 11 | ||||||||||||||||||||||||
| 122 | - | |||||||||||||||||||||||||
| 123 | if (!ignoreSslErrorsList.isEmpty()
| 0-108 | ||||||||||||||||||||||||
| 124 | sslSocket->ignoreSslErrors(ignoreSslErrorsList); never executed: sslSocket->ignoreSslErrors(ignoreSslErrorsList); | 0 | ||||||||||||||||||||||||
| 125 | - | |||||||||||||||||||||||||
| 126 | if (!sslConfiguration.isNull()
| 49-59 | ||||||||||||||||||||||||
| 127 | sslSocket->setSslConfiguration(sslConfiguration); executed 59 times by 2 tests: sslSocket->setSslConfiguration(sslConfiguration);Executed by:
| 59 | ||||||||||||||||||||||||
| 128 | } executed 108 times by 3 tests: else {end of blockExecuted by:
| 108 | ||||||||||||||||||||||||
| 129 | - | |||||||||||||||||||||||||
| 130 | protocolHandler.reset(new QHttpProtocolHandler(this)); | - | ||||||||||||||||||||||||
| 131 | - | |||||||||||||||||||||||||
| 132 | } executed 646 times by 8 tests: end of blockExecuted by:
| 646 | ||||||||||||||||||||||||
| 133 | - | |||||||||||||||||||||||||
| 134 | - | |||||||||||||||||||||||||
| 135 | - | |||||||||||||||||||||||||
| 136 | if (proxy.type() != QNetworkProxy::NoProxy
| 101-653 | ||||||||||||||||||||||||
| 137 | socket->setProxy(proxy); executed 101 times by 3 tests: socket->setProxy(proxy);Executed by:
| 101 | ||||||||||||||||||||||||
| 138 | - | |||||||||||||||||||||||||
| 139 | isInitialized = true; | - | ||||||||||||||||||||||||
| 140 | } executed 754 times by 8 tests: end of blockExecuted by:
| 754 | ||||||||||||||||||||||||
| 141 | - | |||||||||||||||||||||||||
| 142 | - | |||||||||||||||||||||||||
| 143 | void QHttpNetworkConnectionChannel::close() | - | ||||||||||||||||||||||||
| 144 | { | - | ||||||||||||||||||||||||
| 145 | if (!socket
| 4-406 | ||||||||||||||||||||||||
| 146 | state = QHttpNetworkConnectionChannel::IdleState; executed 4 times by 3 tests: state = QHttpNetworkConnectionChannel::IdleState;Executed by:
| 4 | ||||||||||||||||||||||||
| 147 | else if (socket->state() == QAbstractSocket::UnconnectedState
| 182-224 | ||||||||||||||||||||||||
| 148 | state = QHttpNetworkConnectionChannel::IdleState; executed 182 times by 4 tests: state = QHttpNetworkConnectionChannel::IdleState;Executed by:
| 182 | ||||||||||||||||||||||||
| 149 | else | - | ||||||||||||||||||||||||
| 150 | state = QHttpNetworkConnectionChannel::ClosingState; executed 224 times by 4 tests: state = QHttpNetworkConnectionChannel::ClosingState;Executed by:
| 224 | ||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||
| 152 | - | |||||||||||||||||||||||||
| 153 | pendingEncrypt = false; | - | ||||||||||||||||||||||||
| 154 | - | |||||||||||||||||||||||||
| 155 | if (socket
| 4-406 | ||||||||||||||||||||||||
| 156 | - | |||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||
| 158 | socket->close(); | - | ||||||||||||||||||||||||
| 159 | } executed 405 times by 5 tests: end of blockExecuted by:
| 405 | ||||||||||||||||||||||||
| 160 | } executed 409 times by 5 tests: end of blockExecuted by:
| 409 | ||||||||||||||||||||||||
| 161 | - | |||||||||||||||||||||||||
| 162 | - | |||||||||||||||||||||||||
| 163 | void QHttpNetworkConnectionChannel::abort() | - | ||||||||||||||||||||||||
| 164 | { | - | ||||||||||||||||||||||||
| 165 | if (!socket
| 0-13 | ||||||||||||||||||||||||
| 166 | state = QHttpNetworkConnectionChannel::IdleState; never executed: state = QHttpNetworkConnectionChannel::IdleState; | 0 | ||||||||||||||||||||||||
| 167 | else if (socket->state() == QAbstractSocket::UnconnectedState
| 0-13 | ||||||||||||||||||||||||
| 168 | state = QHttpNetworkConnectionChannel::IdleState; never executed: state = QHttpNetworkConnectionChannel::IdleState; | 0 | ||||||||||||||||||||||||
| 169 | else | - | ||||||||||||||||||||||||
| 170 | state = QHttpNetworkConnectionChannel::ClosingState; executed 13 times by 1 test: state = QHttpNetworkConnectionChannel::ClosingState;Executed by:
| 13 | ||||||||||||||||||||||||
| 171 | - | |||||||||||||||||||||||||
| 172 | - | |||||||||||||||||||||||||
| 173 | pendingEncrypt = false; | - | ||||||||||||||||||||||||
| 174 | - | |||||||||||||||||||||||||
| 175 | if (socket
| 0-13 | ||||||||||||||||||||||||
| 176 | - | |||||||||||||||||||||||||
| 177 | - | |||||||||||||||||||||||||
| 178 | socket->abort(); | - | ||||||||||||||||||||||||
| 179 | } executed 13 times by 1 test: end of blockExecuted by:
| 13 | ||||||||||||||||||||||||
| 180 | } executed 13 times by 1 test: end of blockExecuted by:
| 13 | ||||||||||||||||||||||||
| 181 | - | |||||||||||||||||||||||||
| 182 | - | |||||||||||||||||||||||||
| 183 | bool QHttpNetworkConnectionChannel::sendRequest() | - | ||||||||||||||||||||||||
| 184 | { | - | ||||||||||||||||||||||||
| 185 | ((!(!protocolHandler.isNull())) ? qt_assert("!protocolHandler.isNull()",__FILE__,236) : qt_noop()); | - | ||||||||||||||||||||||||
| 186 | return executed 4643 times by 8 tests: protocolHandler->sendRequest();return protocolHandler->sendRequest();Executed by:
executed 4643 times by 8 tests: return protocolHandler->sendRequest();Executed by:
| 4643 | ||||||||||||||||||||||||
| 187 | } | - | ||||||||||||||||||||||||
| 188 | - | |||||||||||||||||||||||||
| 189 | - | |||||||||||||||||||||||||
| 190 | void QHttpNetworkConnectionChannel::_q_receiveReply() | - | ||||||||||||||||||||||||
| 191 | { | - | ||||||||||||||||||||||||
| 192 | ((!(!protocolHandler.isNull())) ? qt_assert("!protocolHandler.isNull()",__FILE__,243) : qt_noop()); | - | ||||||||||||||||||||||||
| 193 | protocolHandler->_q_receiveReply(); | - | ||||||||||||||||||||||||
| 194 | } executed 202 times by 2 tests: end of blockExecuted by:
| 202 | ||||||||||||||||||||||||
| 195 | - | |||||||||||||||||||||||||
| 196 | void QHttpNetworkConnectionChannel::_q_readyRead() | - | ||||||||||||||||||||||||
| 197 | { | - | ||||||||||||||||||||||||
| 198 | ((!(!protocolHandler.isNull())) ? qt_assert("!protocolHandler.isNull()",__FILE__,249) : qt_noop()); | - | ||||||||||||||||||||||||
| 199 | protocolHandler->_q_readyRead(); | - | ||||||||||||||||||||||||
| 200 | } executed 11090 times by 7 tests: end of blockExecuted by:
| 11090 | ||||||||||||||||||||||||
| 201 | - | |||||||||||||||||||||||||
| 202 | - | |||||||||||||||||||||||||
| 203 | void QHttpNetworkConnectionChannel::handleUnexpectedEOF() | - | ||||||||||||||||||||||||
| 204 | { | - | ||||||||||||||||||||||||
| 205 | ((!(reply)) ? qt_assert("reply",__FILE__,256) : qt_noop()); | - | ||||||||||||||||||||||||
| 206 | if (reconnectAttempts <= 0
| 27-65 | ||||||||||||||||||||||||
| 207 | - | |||||||||||||||||||||||||
| 208 | requeueCurrentlyPipelinedRequests(); | - | ||||||||||||||||||||||||
| 209 | close(); | - | ||||||||||||||||||||||||
| 210 | reply->d_func()->errorString = connection->d_func()->errorDetail(QNetworkReply::RemoteHostClosedError, socket); | - | ||||||||||||||||||||||||
| 211 | reply->finishedWithError(QNetworkReply::RemoteHostClosedError, reply->d_func()->errorString); | - | ||||||||||||||||||||||||
| 212 | reply = 0; | - | ||||||||||||||||||||||||
| 213 | if (protocolHandler
| 0-27 | ||||||||||||||||||||||||
| 214 | protocolHandler->setReply(0); executed 27 times by 2 tests: protocolHandler->setReply(0);Executed by:
| 27 | ||||||||||||||||||||||||
| 215 | request = QHttpNetworkRequest(); | - | ||||||||||||||||||||||||
| 216 | QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); | - | ||||||||||||||||||||||||
| 217 | } executed 27 times by 2 tests: else {end of blockExecuted by:
| 27 | ||||||||||||||||||||||||
| 218 | reconnectAttempts--; | - | ||||||||||||||||||||||||
| 219 | reply->d_func()->clear(); | - | ||||||||||||||||||||||||
| 220 | reply->d_func()->connection = connection; | - | ||||||||||||||||||||||||
| 221 | reply->d_func()->connectionChannel = this; | - | ||||||||||||||||||||||||
| 222 | closeAndResendCurrentRequest(); | - | ||||||||||||||||||||||||
| 223 | } executed 65 times by 2 tests: end of blockExecuted by:
| 65 | ||||||||||||||||||||||||
| 224 | } | - | ||||||||||||||||||||||||
| 225 | - | |||||||||||||||||||||||||
| 226 | bool QHttpNetworkConnectionChannel::ensureConnection() | - | ||||||||||||||||||||||||
| 227 | { | - | ||||||||||||||||||||||||
| 228 | if (!isInitialized
| 754-1600 | ||||||||||||||||||||||||
| 229 | init(); executed 754 times by 8 tests: init();Executed by:
| 754 | ||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||
| 231 | QAbstractSocket::SocketState socketState = socket->state(); | - | ||||||||||||||||||||||||
| 232 | - | |||||||||||||||||||||||||
| 233 | - | |||||||||||||||||||||||||
| 234 | - | |||||||||||||||||||||||||
| 235 | - | |||||||||||||||||||||||||
| 236 | - | |||||||||||||||||||||||||
| 237 | - | |||||||||||||||||||||||||
| 238 | if (socketState == QAbstractSocket::ClosingState
| 0-2354 | ||||||||||||||||||||||||
| 239 | (socketState != QAbstractSocket::UnconnectedState
| 0-1432 | ||||||||||||||||||||||||
| 240 | if (reply
| 0 | ||||||||||||||||||||||||
| 241 | resendCurrent = true; never executed: resendCurrent = true; | 0 | ||||||||||||||||||||||||
| 242 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 243 | } | - | ||||||||||||||||||||||||
| 244 | - | |||||||||||||||||||||||||
| 245 | - | |||||||||||||||||||||||||
| 246 | if (socketState == QAbstractSocket::HostLookupState
| 0-2354 | ||||||||||||||||||||||||
| 247 | socketState == QAbstractSocket::ConnectingState
| 3-2351 | ||||||||||||||||||||||||
| 248 | return executed 3 times by 1 test: false;return false;Executed by:
executed 3 times by 1 test: return false;Executed by:
| 3 | ||||||||||||||||||||||||
| 249 | } | - | ||||||||||||||||||||||||
| 250 | - | |||||||||||||||||||||||||
| 251 | - | |||||||||||||||||||||||||
| 252 | - | |||||||||||||||||||||||||
| 253 | if (socketState != QAbstractSocket::ConnectedState
| 922-1429 | ||||||||||||||||||||||||
| 254 | - | |||||||||||||||||||||||||
| 255 | state = QHttpNetworkConnectionChannel::ConnectingState; | - | ||||||||||||||||||||||||
| 256 | pendingEncrypt = ssl; | - | ||||||||||||||||||||||||
| 257 | - | |||||||||||||||||||||||||
| 258 | - | |||||||||||||||||||||||||
| 259 | pipeliningSupported = PipeliningSupportUnknown; | - | ||||||||||||||||||||||||
| 260 | authenticationCredentialsSent = false; | - | ||||||||||||||||||||||||
| 261 | proxyCredentialsSent = false; | - | ||||||||||||||||||||||||
| 262 | authenticator.detach(); | - | ||||||||||||||||||||||||
| 263 | QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(authenticator); | - | ||||||||||||||||||||||||
| 264 | priv->hasFailed = false; | - | ||||||||||||||||||||||||
| 265 | proxyAuthenticator.detach(); | - | ||||||||||||||||||||||||
| 266 | priv = QAuthenticatorPrivate::getPrivate(proxyAuthenticator); | - | ||||||||||||||||||||||||
| 267 | priv->hasFailed = false; | - | ||||||||||||||||||||||||
| 268 | - | |||||||||||||||||||||||||
| 269 | - | |||||||||||||||||||||||||
| 270 | - | |||||||||||||||||||||||||
| 271 | - | |||||||||||||||||||||||||
| 272 | - | |||||||||||||||||||||||||
| 273 | - | |||||||||||||||||||||||||
| 274 | - | |||||||||||||||||||||||||
| 275 | priv = QAuthenticatorPrivate::getPrivate(authenticator); | - | ||||||||||||||||||||||||
| 276 | if (priv
| 0-922 | ||||||||||||||||||||||||
| 277 | priv->phase = QAuthenticatorPrivate::Start; never executed: priv->phase = QAuthenticatorPrivate::Start; | 0 | ||||||||||||||||||||||||
| 278 | priv = QAuthenticatorPrivate::getPrivate(proxyAuthenticator); | - | ||||||||||||||||||||||||
| 279 | if (priv
| 0-922 | ||||||||||||||||||||||||
| 280 | priv->phase = QAuthenticatorPrivate::Start; never executed: priv->phase = QAuthenticatorPrivate::Start; | 0 | ||||||||||||||||||||||||
| 281 | - | |||||||||||||||||||||||||
| 282 | QString connectHost = connection->d_func()->hostName; | - | ||||||||||||||||||||||||
| 283 | quint16 connectPort = connection->d_func()->port; | - | ||||||||||||||||||||||||
| 284 | - | |||||||||||||||||||||||||
| 285 | - | |||||||||||||||||||||||||
| 286 | - | |||||||||||||||||||||||||
| 287 | if (connection->d_func()->networkProxy.type() != QNetworkProxy::NoProxy
| 0-827 | ||||||||||||||||||||||||
| 288 | connectHost = connection->d_func()->networkProxy.hostName(); | - | ||||||||||||||||||||||||
| 289 | connectPort = connection->d_func()->networkProxy.port(); | - | ||||||||||||||||||||||||
| 290 | } executed 95 times by 1 test: end of blockExecuted by:
| 95 | ||||||||||||||||||||||||
| 291 | if (socket->proxy().type() == QNetworkProxy::HttpProxy
| 23-899 | ||||||||||||||||||||||||
| 292 | - | |||||||||||||||||||||||||
| 293 | QByteArray value; | - | ||||||||||||||||||||||||
| 294 | - | |||||||||||||||||||||||||
| 295 | if (request.url().isEmpty()
| 2-21 | ||||||||||||||||||||||||
| 296 | value = connection->d_func()->predictNextRequest().headerField("user-agent"); executed 21 times by 2 tests: value = connection->d_func()->predictNextRequest().headerField("user-agent");Executed by:
| 21 | ||||||||||||||||||||||||
| 297 | else | - | ||||||||||||||||||||||||
| 298 | value = request.headerField("user-agent"); executed 2 times by 1 test: value = request.headerField("user-agent");Executed by:
| 2 | ||||||||||||||||||||||||
| 299 | if (!value.isEmpty()
| 6-17 | ||||||||||||||||||||||||
| 300 | QNetworkProxy proxy(socket->proxy()); | - | ||||||||||||||||||||||||
| 301 | proxy.setRawHeader("User-Agent", value); | - | ||||||||||||||||||||||||
| 302 | socket->setProxy(proxy); | - | ||||||||||||||||||||||||
| 303 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 304 | } executed 23 times by 2 tests: end of blockExecuted by:
| 23 | ||||||||||||||||||||||||
| 305 | - | |||||||||||||||||||||||||
| 306 | if (ssl
| 127-795 | ||||||||||||||||||||||||
| 307 | - | |||||||||||||||||||||||||
| 308 | QSslSocket *sslSocket = qobject_cast<QSslSocket*>(socket); | - | ||||||||||||||||||||||||
| 309 | - | |||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||
| 311 | - | |||||||||||||||||||||||||
| 312 | - | |||||||||||||||||||||||||
| 313 | if (!connection->sslContext().isNull()
| 26-101 | ||||||||||||||||||||||||
| 314 | QSslSocketPrivate::checkSettingSslContext(sslSocket, connection->sslContext()); executed 26 times by 1 test: QSslSocketPrivate::checkSettingSslContext(sslSocket, connection->sslContext());Executed by:
| 26 | ||||||||||||||||||||||||
| 315 | - | |||||||||||||||||||||||||
| 316 | sslSocket->connectToHostEncrypted(connectHost, connectPort, QIODevice::ReadWrite, networkLayerPreference); | - | ||||||||||||||||||||||||
| 317 | if (ignoreAllSslErrors
| 21-106 | ||||||||||||||||||||||||
| 318 | sslSocket->ignoreSslErrors(); executed 21 times by 2 tests: sslSocket->ignoreSslErrors();Executed by:
| 21 | ||||||||||||||||||||||||
| 319 | sslSocket->ignoreSslErrors(ignoreSslErrorsList); | - | ||||||||||||||||||||||||
| 320 | - | |||||||||||||||||||||||||
| 321 | - | |||||||||||||||||||||||||
| 322 | - | |||||||||||||||||||||||||
| 323 | - | |||||||||||||||||||||||||
| 324 | socket->setReadBufferSize(64*1024); | - | ||||||||||||||||||||||||
| 325 | - | |||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||
| 327 | - | |||||||||||||||||||||||||
| 328 | - | |||||||||||||||||||||||||
| 329 | - | |||||||||||||||||||||||||
| 330 | - | |||||||||||||||||||||||||
| 331 | } executed 127 times by 3 tests: else {end of blockExecuted by:
| 127 | ||||||||||||||||||||||||
| 332 | - | |||||||||||||||||||||||||
| 333 | - | |||||||||||||||||||||||||
| 334 | if (connection->d_func()->networkProxy.type() == QNetworkProxy::NoProxy
| 95-700 | ||||||||||||||||||||||||
| 335 | && connection->cacheProxy().type() == QNetworkProxy::NoProxy
| 0-700 | ||||||||||||||||||||||||
| 336 | && connection->transparentProxy().type() == QNetworkProxy::NoProxy
| 86-614 | ||||||||||||||||||||||||
| 337 | - | |||||||||||||||||||||||||
| 338 | socket->connectToHost(connectHost, connectPort, QIODevice::ReadWrite | QIODevice::Unbuffered, networkLayerPreference); | - | ||||||||||||||||||||||||
| 339 | - | |||||||||||||||||||||||||
| 340 | socket->setReadBufferSize(1*1024); | - | ||||||||||||||||||||||||
| 341 | - | |||||||||||||||||||||||||
| 342 | } executed 614 times by 8 tests: else {end of blockExecuted by:
| 614 | ||||||||||||||||||||||||
| 343 | socket->connectToHost(connectHost, connectPort, QIODevice::ReadWrite, networkLayerPreference); | - | ||||||||||||||||||||||||
| 344 | - | |||||||||||||||||||||||||
| 345 | - | |||||||||||||||||||||||||
| 346 | - | |||||||||||||||||||||||||
| 347 | - | |||||||||||||||||||||||||
| 348 | socket->setReadBufferSize(64*1024); | - | ||||||||||||||||||||||||
| 349 | } executed 181 times by 2 tests: end of blockExecuted by:
| 181 | ||||||||||||||||||||||||
| 350 | - | |||||||||||||||||||||||||
| 351 | } | - | ||||||||||||||||||||||||
| 352 | return executed 922 times by 8 tests: false;return false;Executed by:
executed 922 times by 8 tests: return false;Executed by:
| 922 | ||||||||||||||||||||||||
| 353 | } | - | ||||||||||||||||||||||||
| 354 | - | |||||||||||||||||||||||||
| 355 | - | |||||||||||||||||||||||||
| 356 | if (pendingEncrypt
| 0-1429 | ||||||||||||||||||||||||
| 357 | - | |||||||||||||||||||||||||
| 358 | - | |||||||||||||||||||||||||
| 359 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 360 | } | - | ||||||||||||||||||||||||
| 361 | - | |||||||||||||||||||||||||
| 362 | return executed 1429 times by 8 tests: true;return true;Executed by:
executed 1429 times by 8 tests: return true;Executed by:
| 1429 | ||||||||||||||||||||||||
| 363 | } | - | ||||||||||||||||||||||||
| 364 | - | |||||||||||||||||||||||||
| 365 | void QHttpNetworkConnectionChannel::allDone() | - | ||||||||||||||||||||||||
| 366 | { | - | ||||||||||||||||||||||||
| 367 | ((!(reply)) ? qt_assert("reply",__FILE__,418) : qt_noop()); | - | ||||||||||||||||||||||||
| 368 | - | |||||||||||||||||||||||||
| 369 | if (!reply
| 0-1762 | ||||||||||||||||||||||||
| 370 | QMessageLogger(__FILE__, 421, __PRETTY_FUNCTION__).warning("QHttpNetworkConnectionChannel::allDone() called without reply. Please report at http://bugreports.qt.io/"); | - | ||||||||||||||||||||||||
| 371 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 372 | } | - | ||||||||||||||||||||||||
| 373 | - | |||||||||||||||||||||||||
| 374 | - | |||||||||||||||||||||||||
| 375 | bool emitFinished = reply->d_func()->shouldEmitSignals(); | - | ||||||||||||||||||||||||
| 376 | bool connectionCloseEnabled = reply->d_func()->isConnectionCloseEnabled(); | - | ||||||||||||||||||||||||
| 377 | detectPipeliningSupport(); | - | ||||||||||||||||||||||||
| 378 | - | |||||||||||||||||||||||||
| 379 | handleStatus(); | - | ||||||||||||||||||||||||
| 380 | - | |||||||||||||||||||||||||
| 381 | - | |||||||||||||||||||||||||
| 382 | - | |||||||||||||||||||||||||
| 383 | - | |||||||||||||||||||||||||
| 384 | - | |||||||||||||||||||||||||
| 385 | if (reply
| 2-1760 | ||||||||||||||||||||||||
| 386 | QMetaObject::invokeMethod(reply, "finished", Qt::QueuedConnection); executed 1405 times by 7 tests: QMetaObject::invokeMethod(reply, "finished", Qt::QueuedConnection);Executed by:
| 1405 | ||||||||||||||||||||||||
| 387 | - | |||||||||||||||||||||||||
| 388 | - | |||||||||||||||||||||||||
| 389 | - | |||||||||||||||||||||||||
| 390 | - | |||||||||||||||||||||||||
| 391 | reconnectAttempts = reconnectAttemptsDefault; | - | ||||||||||||||||||||||||
| 392 | - | |||||||||||||||||||||||||
| 393 | - | |||||||||||||||||||||||||
| 394 | if (state != QHttpNetworkConnectionChannel::ClosingState
| 0-1762 | ||||||||||||||||||||||||
| 395 | state = QHttpNetworkConnectionChannel::IdleState; executed 1762 times by 7 tests: state = QHttpNetworkConnectionChannel::IdleState;Executed by:
| 1762 | ||||||||||||||||||||||||
| 396 | - | |||||||||||||||||||||||||
| 397 | - | |||||||||||||||||||||||||
| 398 | - | |||||||||||||||||||||||||
| 399 | - | |||||||||||||||||||||||||
| 400 | - | |||||||||||||||||||||||||
| 401 | - | |||||||||||||||||||||||||
| 402 | if (!resendCurrent
| 325-1437 | ||||||||||||||||||||||||
| 403 | request = QHttpNetworkRequest(); | - | ||||||||||||||||||||||||
| 404 | reply = 0; | - | ||||||||||||||||||||||||
| 405 | protocolHandler->setReply(0); | - | ||||||||||||||||||||||||
| 406 | } executed 1437 times by 7 tests: end of blockExecuted by:
| 1437 | ||||||||||||||||||||||||
| 407 | - | |||||||||||||||||||||||||
| 408 | - | |||||||||||||||||||||||||
| 409 | if (!alreadyPipelinedRequests.isEmpty()
| 402-1360 | ||||||||||||||||||||||||
| 410 | if (resendCurrent
| 0-402 | ||||||||||||||||||||||||
| 411 | - | |||||||||||||||||||||||||
| 412 | requeueCurrentlyPipelinedRequests(); | - | ||||||||||||||||||||||||
| 413 | close(); | - | ||||||||||||||||||||||||
| 414 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 415 | - | |||||||||||||||||||||||||
| 416 | HttpMessagePair messagePair = alreadyPipelinedRequests.takeFirst(); | - | ||||||||||||||||||||||||
| 417 | - | |||||||||||||||||||||||||
| 418 | request = messagePair.first; | - | ||||||||||||||||||||||||
| 419 | reply = messagePair.second; | - | ||||||||||||||||||||||||
| 420 | protocolHandler->setReply(messagePair.second); | - | ||||||||||||||||||||||||
| 421 | state = QHttpNetworkConnectionChannel::ReadingState; | - | ||||||||||||||||||||||||
| 422 | resendCurrent = false; | - | ||||||||||||||||||||||||
| 423 | - | |||||||||||||||||||||||||
| 424 | written = 0; | - | ||||||||||||||||||||||||
| 425 | bytesTotal = 0; | - | ||||||||||||||||||||||||
| 426 | - | |||||||||||||||||||||||||
| 427 | - | |||||||||||||||||||||||||
| 428 | connection->d_func()->fillPipeline(socket); | - | ||||||||||||||||||||||||
| 429 | - | |||||||||||||||||||||||||
| 430 | - | |||||||||||||||||||||||||
| 431 | - | |||||||||||||||||||||||||
| 432 | - | |||||||||||||||||||||||||
| 433 | } executed 402 times by 2 tests: end of blockExecuted by:
| 402 | ||||||||||||||||||||||||
| 434 | } else if (alreadyPipelinedRequests.isEmpty()
| 0-1360 | ||||||||||||||||||||||||
| 435 | - | |||||||||||||||||||||||||
| 436 | close(); | - | ||||||||||||||||||||||||
| 437 | - | |||||||||||||||||||||||||
| 438 | QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); | - | ||||||||||||||||||||||||
| 439 | } never executed: else if (alreadyPipelinedRequests.isEmpty()end of block
| 0-1360 | ||||||||||||||||||||||||
| 440 | if (connectionCloseEnabled
| 185-1175 | ||||||||||||||||||||||||
| 441 | if (socket->state() != QAbstractSocket::UnconnectedState
| 60-125 | ||||||||||||||||||||||||
| 442 | close(); executed 125 times by 2 tests: close();Executed by:
| 125 | ||||||||||||||||||||||||
| 443 | if (qobject_cast<QHttpNetworkConnection*>(connection)
| 0-1360 | ||||||||||||||||||||||||
| 444 | QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); executed 1360 times by 7 tests: QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);Executed by:
| 1360 | ||||||||||||||||||||||||
| 445 | } executed 1360 times by 7 tests: end of blockExecuted by:
| 1360 | ||||||||||||||||||||||||
| 446 | } executed 1762 times by 7 tests: end of blockExecuted by:
| 1762 | ||||||||||||||||||||||||
| 447 | - | |||||||||||||||||||||||||
| 448 | void QHttpNetworkConnectionChannel::detectPipeliningSupport() | - | ||||||||||||||||||||||||
| 449 | { | - | ||||||||||||||||||||||||
| 450 | ((!(reply)) ? qt_assert("reply",__FILE__,501) : qt_noop()); | - | ||||||||||||||||||||||||
| 451 | - | |||||||||||||||||||||||||
| 452 | QByteArray serverHeaderField; | - | ||||||||||||||||||||||||
| 453 | if ( | - | ||||||||||||||||||||||||
| 454 | - | |||||||||||||||||||||||||
| 455 | (reply->d_func()->majorVersion == 1
| 0-1762 | ||||||||||||||||||||||||
| 456 | - | |||||||||||||||||||||||||
| 457 | && (
| 4-1517 | ||||||||||||||||||||||||
| 458 | - | |||||||||||||||||||||||||
| 459 | && (
| 10-1507 | ||||||||||||||||||||||||
| 460 | - | |||||||||||||||||||||||||
| 461 | - | |||||||||||||||||||||||||
| 462 | && (
| 0-1507 | ||||||||||||||||||||||||
| 463 | && (
| 0-1507 | ||||||||||||||||||||||||
| 464 | && (
| 0-1507 | ||||||||||||||||||||||||
| 465 | - | |||||||||||||||||||||||||
| 466 | && (
| 0-1507 | ||||||||||||||||||||||||
| 467 | && (
| 0-1507 | ||||||||||||||||||||||||
| 468 | ) { | - | ||||||||||||||||||||||||
| 469 | pipeliningSupported = QHttpNetworkConnectionChannel::PipeliningProbablySupported; | - | ||||||||||||||||||||||||
| 470 | } executed 1507 times by 7 tests: else {end of blockExecuted by:
| 1507 | ||||||||||||||||||||||||
| 471 | pipeliningSupported = QHttpNetworkConnectionChannel::PipeliningSupportUnknown; | - | ||||||||||||||||||||||||
| 472 | } executed 255 times by 2 tests: end of blockExecuted by:
| 255 | ||||||||||||||||||||||||
| 473 | } | - | ||||||||||||||||||||||||
| 474 | - | |||||||||||||||||||||||||
| 475 | - | |||||||||||||||||||||||||
| 476 | void QHttpNetworkConnectionChannel::requeueCurrentlyPipelinedRequests() | - | ||||||||||||||||||||||||
| 477 | { | - | ||||||||||||||||||||||||
| 478 | for (int i = 0; i < alreadyPipelinedRequests.length()
| 0-136 | ||||||||||||||||||||||||
| 479 | connection->d_func()->requeueRequest(alreadyPipelinedRequests.at(i)); never executed: connection->d_func()->requeueRequest(alreadyPipelinedRequests.at(i)); | 0 | ||||||||||||||||||||||||
| 480 | alreadyPipelinedRequests.clear(); | - | ||||||||||||||||||||||||
| 481 | - | |||||||||||||||||||||||||
| 482 | - | |||||||||||||||||||||||||
| 483 | - | |||||||||||||||||||||||||
| 484 | - | |||||||||||||||||||||||||
| 485 | if (qobject_cast<QHttpNetworkConnection*>(connection)
| 0-136 | ||||||||||||||||||||||||
| 486 | QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); executed 136 times by 3 tests: QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);Executed by:
| 136 | ||||||||||||||||||||||||
| 487 | } executed 136 times by 3 tests: end of blockExecuted by:
| 136 | ||||||||||||||||||||||||
| 488 | - | |||||||||||||||||||||||||
| 489 | void QHttpNetworkConnectionChannel::handleStatus() | - | ||||||||||||||||||||||||
| 490 | { | - | ||||||||||||||||||||||||
| 491 | ((!(socket)) ? qt_assert("socket",__FILE__,542) : qt_noop()); | - | ||||||||||||||||||||||||
| 492 | ((!(reply)) ? qt_assert("reply",__FILE__,543) : qt_noop()); | - | ||||||||||||||||||||||||
| 493 | - | |||||||||||||||||||||||||
| 494 | int statusCode = reply->statusCode(); | - | ||||||||||||||||||||||||
| 495 | bool resend = false; | - | ||||||||||||||||||||||||
| 496 | - | |||||||||||||||||||||||||
| 497 | switch (statusCode) { | - | ||||||||||||||||||||||||
| 498 | case executed 3 times by 1 test: 301:case 301:Executed by:
executed 3 times by 1 test: case 301:Executed by:
| 3 | ||||||||||||||||||||||||
| 499 | case never executed: 302:case 302:never executed: case 302: | 0 | ||||||||||||||||||||||||
| 500 | case never executed: 303:case 303:never executed: case 303: | 0 | ||||||||||||||||||||||||
| 501 | case never executed: 305:case 305:never executed: case 305: | 0 | ||||||||||||||||||||||||
| 502 | case executed 6 times by 1 test: 307:case 307:Executed by:
executed 6 times by 1 test: {case 307:Executed by:
| 6 | ||||||||||||||||||||||||
| 503 | - | |||||||||||||||||||||||||
| 504 | QUrl redirectUrl = connection->d_func()->parseRedirectResponse(socket, reply); | - | ||||||||||||||||||||||||
| 505 | if (redirectUrl.isValid()
| 4-5 | ||||||||||||||||||||||||
| 506 | reply->setRedirectUrl(redirectUrl); executed 5 times by 1 test: reply->setRedirectUrl(redirectUrl);Executed by:
| 5 | ||||||||||||||||||||||||
| 507 | - | |||||||||||||||||||||||||
| 508 | if (qobject_cast<QHttpNetworkConnection *>(connection)
| 0-9 | ||||||||||||||||||||||||
| 509 | QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); executed 9 times by 2 tests: QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);Executed by:
| 9 | ||||||||||||||||||||||||
| 510 | break; executed 9 times by 2 tests: break;Executed by:
| 9 | ||||||||||||||||||||||||
| 511 | } | - | ||||||||||||||||||||||||
| 512 | case executed 302 times by 2 tests: 401:case 401:Executed by:
executed 302 times by 2 tests: case 401:Executed by:
| 302 | ||||||||||||||||||||||||
| 513 | case executed 54 times by 1 test: 407:case 407:Executed by:
executed 54 times by 1 test: case 407:Executed by:
| 54 | ||||||||||||||||||||||||
| 514 | if (connection->d_func()->handleAuthenticateChallenge(socket, reply, (statusCode == 407), resend)
| 3-353 | ||||||||||||||||||||||||
| 515 | if (resend
| 38-315 | ||||||||||||||||||||||||
| 516 | if (!resetUploadData()
| 1-314 | ||||||||||||||||||||||||
| 517 | break; executed 1 time by 1 test: break;Executed by:
| 1 | ||||||||||||||||||||||||
| 518 | - | |||||||||||||||||||||||||
| 519 | reply->d_func()->eraseData(); | - | ||||||||||||||||||||||||
| 520 | - | |||||||||||||||||||||||||
| 521 | if (alreadyPipelinedRequests.isEmpty()
| 0-314 | ||||||||||||||||||||||||
| 522 | - | |||||||||||||||||||||||||
| 523 | resendCurrent = true; | - | ||||||||||||||||||||||||
| 524 | QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); | - | ||||||||||||||||||||||||
| 525 | } executed 314 times by 2 tests: else {end of blockExecuted by:
| 314 | ||||||||||||||||||||||||
| 526 | - | |||||||||||||||||||||||||
| 527 | closeAndResendCurrentRequest(); | - | ||||||||||||||||||||||||
| 528 | QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); | - | ||||||||||||||||||||||||
| 529 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 530 | } else { | - | ||||||||||||||||||||||||
| 531 | - | |||||||||||||||||||||||||
| 532 | close(); | - | ||||||||||||||||||||||||
| 533 | } executed 38 times by 2 tests: end of blockExecuted by:
| 38 | ||||||||||||||||||||||||
| 534 | } else { | - | ||||||||||||||||||||||||
| 535 | reply->headerChanged(); | - | ||||||||||||||||||||||||
| 536 | reply->readyRead(); | - | ||||||||||||||||||||||||
| 537 | QNetworkReply::NetworkError errorCode = (
| 1-2 | ||||||||||||||||||||||||
| 538 | ? QNetworkReply::ProxyAuthenticationRequiredError | - | ||||||||||||||||||||||||
| 539 | : QNetworkReply::AuthenticationRequiredError; | - | ||||||||||||||||||||||||
| 540 | reply->d_func()->errorString = connection->d_func()->errorDetail(errorCode, socket); | - | ||||||||||||||||||||||||
| 541 | reply->finishedWithError(errorCode, reply->d_func()->errorString); | - | ||||||||||||||||||||||||
| 542 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||||||||||||||
| 543 | break; executed 355 times by 2 tests: break;Executed by:
| 355 | ||||||||||||||||||||||||
| 544 | default executed 1397 times by 6 tests: :default:Executed by:
executed 1397 times by 6 tests: default:Executed by:
| 1397 | ||||||||||||||||||||||||
| 545 | if (qobject_cast<QHttpNetworkConnection*>(connection)
| 0-1397 | ||||||||||||||||||||||||
| 546 | QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); executed 1397 times by 6 tests: QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);Executed by:
| 1397 | ||||||||||||||||||||||||
| 547 | } executed 1397 times by 6 tests: end of blockExecuted by:
| 1397 | ||||||||||||||||||||||||
| 548 | } | - | ||||||||||||||||||||||||
| 549 | - | |||||||||||||||||||||||||
| 550 | bool QHttpNetworkConnectionChannel::resetUploadData() | - | ||||||||||||||||||||||||
| 551 | { | - | ||||||||||||||||||||||||
| 552 | if (!reply
| 9-547 | ||||||||||||||||||||||||
| 553 | - | |||||||||||||||||||||||||
| 554 | return executed 9 times by 2 tests: false;return false;Executed by:
executed 9 times by 2 tests: return false;Executed by:
| 9 | ||||||||||||||||||||||||
| 555 | } | - | ||||||||||||||||||||||||
| 556 | QNonContiguousByteDevice* uploadByteDevice = request.uploadByteDevice(); | - | ||||||||||||||||||||||||
| 557 | if (!uploadByteDevice
| 127-420 | ||||||||||||||||||||||||
| 558 | return executed 420 times by 2 tests: true;return true;Executed by:
executed 420 times by 2 tests: return true;Executed by:
| 420 | ||||||||||||||||||||||||
| 559 | - | |||||||||||||||||||||||||
| 560 | if (uploadByteDevice->reset()
| 1-126 | ||||||||||||||||||||||||
| 561 | written = 0; | - | ||||||||||||||||||||||||
| 562 | return executed 126 times by 1 test: true;return true;Executed by:
executed 126 times by 1 test: return true;Executed by:
| 126 | ||||||||||||||||||||||||
| 563 | } else { | - | ||||||||||||||||||||||||
| 564 | connection->d_func()->emitReplyError(socket, reply, QNetworkReply::ContentReSendError); | - | ||||||||||||||||||||||||
| 565 | return executed 1 time by 1 test: false;return false;Executed by:
executed 1 time by 1 test: return false;Executed by:
| 1 | ||||||||||||||||||||||||
| 566 | } | - | ||||||||||||||||||||||||
| 567 | } | - | ||||||||||||||||||||||||
| 568 | - | |||||||||||||||||||||||||
| 569 | - | |||||||||||||||||||||||||
| 570 | - | |||||||||||||||||||||||||
| 571 | void QHttpNetworkConnectionChannel::setProxy(const QNetworkProxy &networkProxy) | - | ||||||||||||||||||||||||
| 572 | { | - | ||||||||||||||||||||||||
| 573 | if (socket
| 0-3251 | ||||||||||||||||||||||||
| 574 | socket->setProxy(networkProxy); never executed: socket->setProxy(networkProxy); | 0 | ||||||||||||||||||||||||
| 575 | - | |||||||||||||||||||||||||
| 576 | proxy = networkProxy; | - | ||||||||||||||||||||||||
| 577 | } executed 3251 times by 8 tests: end of blockExecuted by:
| 3251 | ||||||||||||||||||||||||
| 578 | - | |||||||||||||||||||||||||
| 579 | - | |||||||||||||||||||||||||
| 580 | - | |||||||||||||||||||||||||
| 581 | - | |||||||||||||||||||||||||
| 582 | - | |||||||||||||||||||||||||
| 583 | void QHttpNetworkConnectionChannel::ignoreSslErrors() | - | ||||||||||||||||||||||||
| 584 | { | - | ||||||||||||||||||||||||
| 585 | if (socket
| 33-141 | ||||||||||||||||||||||||
| 586 | static_cast< executed 33 times by 3 tests: QSslSocket *>(socket)->ignoreSslErrors();static_cast<QSslSocket *>(socket)->ignoreSslErrors();Executed by:
executed 33 times by 3 tests: static_cast<QSslSocket *>(socket)->ignoreSslErrors();Executed by:
| 33 | ||||||||||||||||||||||||
| 587 | - | |||||||||||||||||||||||||
| 588 | ignoreAllSslErrors = true; | - | ||||||||||||||||||||||||
| 589 | } executed 174 times by 3 tests: end of blockExecuted by:
| 174 | ||||||||||||||||||||||||
| 590 | - | |||||||||||||||||||||||||
| 591 | - | |||||||||||||||||||||||||
| 592 | void QHttpNetworkConnectionChannel::ignoreSslErrors(const QList<QSslError> &errors) | - | ||||||||||||||||||||||||
| 593 | { | - | ||||||||||||||||||||||||
| 594 | if (socket
| 6-30 | ||||||||||||||||||||||||
| 595 | static_cast< executed 6 times by 1 test: QSslSocket *>(socket)->ignoreSslErrors(errors);static_cast<QSslSocket *>(socket)->ignoreSslErrors(errors);Executed by:
executed 6 times by 1 test: static_cast<QSslSocket *>(socket)->ignoreSslErrors(errors);Executed by:
| 6 | ||||||||||||||||||||||||
| 596 | - | |||||||||||||||||||||||||
| 597 | ignoreSslErrorsList = errors; | - | ||||||||||||||||||||||||
| 598 | } executed 36 times by 1 test: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||
| 599 | - | |||||||||||||||||||||||||
| 600 | void QHttpNetworkConnectionChannel::setSslConfiguration(const QSslConfiguration &config) | - | ||||||||||||||||||||||||
| 601 | { | - | ||||||||||||||||||||||||
| 602 | if (socket
| 0-287 | ||||||||||||||||||||||||
| 603 | static_cast< never executed: QSslSocket *>(socket)->setSslConfiguration(config);static_cast<QSslSocket *>(socket)->setSslConfiguration(config);never executed: static_cast<QSslSocket *>(socket)->setSslConfiguration(config); | 0 | ||||||||||||||||||||||||
| 604 | - | |||||||||||||||||||||||||
| 605 | sslConfiguration = config; | - | ||||||||||||||||||||||||
| 606 | } executed 287 times by 2 tests: end of blockExecuted by:
| 287 | ||||||||||||||||||||||||
| 607 | - | |||||||||||||||||||||||||
| 608 | - | |||||||||||||||||||||||||
| 609 | - | |||||||||||||||||||||||||
| 610 | void QHttpNetworkConnectionChannel::pipelineInto(HttpMessagePair &pair) | - | ||||||||||||||||||||||||
| 611 | { | - | ||||||||||||||||||||||||
| 612 | - | |||||||||||||||||||||||||
| 613 | - | |||||||||||||||||||||||||
| 614 | QHttpNetworkRequest &request = pair.first; | - | ||||||||||||||||||||||||
| 615 | QHttpNetworkReply *reply = pair.second; | - | ||||||||||||||||||||||||
| 616 | reply->d_func()->clear(); | - | ||||||||||||||||||||||||
| 617 | reply->d_func()->connection = connection; | - | ||||||||||||||||||||||||
| 618 | reply->d_func()->connectionChannel = this; | - | ||||||||||||||||||||||||
| 619 | reply->d_func()->autoDecompress = request.d->autoDecompress; | - | ||||||||||||||||||||||||
| 620 | reply->d_func()->pipeliningUsed = true; | - | ||||||||||||||||||||||||
| 621 | - | |||||||||||||||||||||||||
| 622 | - | |||||||||||||||||||||||||
| 623 | pipeline.append(QHttpNetworkRequestPrivate::header(request, | - | ||||||||||||||||||||||||
| 624 | (connection->d_func()->networkProxy.type() != QNetworkProxy::NoProxy))); | - | ||||||||||||||||||||||||
| 625 | - | |||||||||||||||||||||||||
| 626 | - | |||||||||||||||||||||||||
| 627 | - | |||||||||||||||||||||||||
| 628 | - | |||||||||||||||||||||||||
| 629 | alreadyPipelinedRequests.append(pair); | - | ||||||||||||||||||||||||
| 630 | - | |||||||||||||||||||||||||
| 631 | - | |||||||||||||||||||||||||
| 632 | } executed 402 times by 2 tests: end of blockExecuted by:
| 402 | ||||||||||||||||||||||||
| 633 | - | |||||||||||||||||||||||||
| 634 | void QHttpNetworkConnectionChannel::pipelineFlush() | - | ||||||||||||||||||||||||
| 635 | { | - | ||||||||||||||||||||||||
| 636 | if (pipeline.isEmpty()
| 11-195 | ||||||||||||||||||||||||
| 637 | return; executed 11 times by 1 test: return;Executed by:
| 11 | ||||||||||||||||||||||||
| 638 | - | |||||||||||||||||||||||||
| 639 | - | |||||||||||||||||||||||||
| 640 | - | |||||||||||||||||||||||||
| 641 | - | |||||||||||||||||||||||||
| 642 | - | |||||||||||||||||||||||||
| 643 | - | |||||||||||||||||||||||||
| 644 | socket->write(pipeline); | - | ||||||||||||||||||||||||
| 645 | pipeline.clear(); | - | ||||||||||||||||||||||||
| 646 | } executed 195 times by 2 tests: end of blockExecuted by:
| 195 | ||||||||||||||||||||||||
| 647 | - | |||||||||||||||||||||||||
| 648 | - | |||||||||||||||||||||||||
| 649 | void QHttpNetworkConnectionChannel::closeAndResendCurrentRequest() | - | ||||||||||||||||||||||||
| 650 | { | - | ||||||||||||||||||||||||
| 651 | requeueCurrentlyPipelinedRequests(); | - | ||||||||||||||||||||||||
| 652 | close(); | - | ||||||||||||||||||||||||
| 653 | if (reply
| 0-65 | ||||||||||||||||||||||||
| 654 | resendCurrent = true; executed 65 times by 2 tests: resendCurrent = true;Executed by:
| 65 | ||||||||||||||||||||||||
| 655 | if (qobject_cast<QHttpNetworkConnection*>(connection)
| 0-65 | ||||||||||||||||||||||||
| 656 | QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); executed 65 times by 2 tests: QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);Executed by:
| 65 | ||||||||||||||||||||||||
| 657 | } executed 65 times by 2 tests: end of blockExecuted by:
| 65 | ||||||||||||||||||||||||
| 658 | - | |||||||||||||||||||||||||
| 659 | void QHttpNetworkConnectionChannel::resendCurrentRequest() | - | ||||||||||||||||||||||||
| 660 | { | - | ||||||||||||||||||||||||
| 661 | requeueCurrentlyPipelinedRequests(); | - | ||||||||||||||||||||||||
| 662 | if (reply
| 6-27 | ||||||||||||||||||||||||
| 663 | resendCurrent = true; executed 27 times by 2 tests: resendCurrent = true;Executed by:
| 27 | ||||||||||||||||||||||||
| 664 | if (qobject_cast<QHttpNetworkConnection*>(connection)
| 0-33 | ||||||||||||||||||||||||
| 665 | QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); executed 33 times by 2 tests: QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);Executed by:
| 33 | ||||||||||||||||||||||||
| 666 | } executed 33 times by 2 tests: end of blockExecuted by:
| 33 | ||||||||||||||||||||||||
| 667 | - | |||||||||||||||||||||||||
| 668 | bool QHttpNetworkConnectionChannel::isSocketBusy() const | - | ||||||||||||||||||||||||
| 669 | { | - | ||||||||||||||||||||||||
| 670 | return executed 5417 times by 6 tests: (state & QHttpNetworkConnectionChannel::BusyState);return (state & QHttpNetworkConnectionChannel::BusyState);Executed by:
executed 5417 times by 6 tests: return (state & QHttpNetworkConnectionChannel::BusyState);Executed by:
| 5417 | ||||||||||||||||||||||||
| 671 | } | - | ||||||||||||||||||||||||
| 672 | - | |||||||||||||||||||||||||
| 673 | bool QHttpNetworkConnectionChannel::isSocketWriting() const | - | ||||||||||||||||||||||||
| 674 | { | - | ||||||||||||||||||||||||
| 675 | return executed 3024 times by 3 tests: (state & QHttpNetworkConnectionChannel::WritingState);return (state & QHttpNetworkConnectionChannel::WritingState);Executed by:
executed 3024 times by 3 tests: return (state & QHttpNetworkConnectionChannel::WritingState);Executed by:
| 3024 | ||||||||||||||||||||||||
| 676 | } | - | ||||||||||||||||||||||||
| 677 | - | |||||||||||||||||||||||||
| 678 | bool QHttpNetworkConnectionChannel::isSocketWaiting() const | - | ||||||||||||||||||||||||
| 679 | { | - | ||||||||||||||||||||||||
| 680 | return executed 9678 times by 6 tests: (state & QHttpNetworkConnectionChannel::WaitingState);return (state & QHttpNetworkConnectionChannel::WaitingState);Executed by:
executed 9678 times by 6 tests: return (state & QHttpNetworkConnectionChannel::WaitingState);Executed by:
| 9678 | ||||||||||||||||||||||||
| 681 | } | - | ||||||||||||||||||||||||
| 682 | - | |||||||||||||||||||||||||
| 683 | bool QHttpNetworkConnectionChannel::isSocketReading() const | - | ||||||||||||||||||||||||
| 684 | { | - | ||||||||||||||||||||||||
| 685 | return executed 8520 times by 5 tests: (state & QHttpNetworkConnectionChannel::ReadingState);return (state & QHttpNetworkConnectionChannel::ReadingState);Executed by:
executed 8520 times by 5 tests: return (state & QHttpNetworkConnectionChannel::ReadingState);Executed by:
| 8520 | ||||||||||||||||||||||||
| 686 | } | - | ||||||||||||||||||||||||
| 687 | - | |||||||||||||||||||||||||
| 688 | void QHttpNetworkConnectionChannel::_q_bytesWritten(qint64 bytes) | - | ||||||||||||||||||||||||
| 689 | { | - | ||||||||||||||||||||||||
| 690 | (void)bytes;; | - | ||||||||||||||||||||||||
| 691 | if (ssl
| 946-1901 | ||||||||||||||||||||||||
| 692 | - | |||||||||||||||||||||||||
| 693 | - | |||||||||||||||||||||||||
| 694 | return; executed 1901 times by 3 tests: return;Executed by:
| 1901 | ||||||||||||||||||||||||
| 695 | } | - | ||||||||||||||||||||||||
| 696 | - | |||||||||||||||||||||||||
| 697 | - | |||||||||||||||||||||||||
| 698 | if (isSocketWriting()
| 233-713 | ||||||||||||||||||||||||
| 699 | sendRequest(); executed 233 times by 1 test: sendRequest();Executed by:
| 233 | ||||||||||||||||||||||||
| 700 | - | |||||||||||||||||||||||||
| 701 | } executed 946 times by 2 tests: end of blockExecuted by:
| 946 | ||||||||||||||||||||||||
| 702 | - | |||||||||||||||||||||||||
| 703 | void QHttpNetworkConnectionChannel::_q_disconnected() | - | ||||||||||||||||||||||||
| 704 | { | - | ||||||||||||||||||||||||
| 705 | if (state == QHttpNetworkConnectionChannel::ClosingState
| 6-243 | ||||||||||||||||||||||||
| 706 | state = QHttpNetworkConnectionChannel::IdleState; | - | ||||||||||||||||||||||||
| 707 | QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); | - | ||||||||||||||||||||||||
| 708 | return; executed 243 times by 4 tests: return;Executed by:
| 243 | ||||||||||||||||||||||||
| 709 | } | - | ||||||||||||||||||||||||
| 710 | - | |||||||||||||||||||||||||
| 711 | - | |||||||||||||||||||||||||
| 712 | if ((isSocketWaiting()
| 0-6 | ||||||||||||||||||||||||
| 713 | if (reply
| 0 | ||||||||||||||||||||||||
| 714 | state = QHttpNetworkConnectionChannel::ReadingState; | - | ||||||||||||||||||||||||
| 715 | _q_receiveReply(); | - | ||||||||||||||||||||||||
| 716 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 717 | } never executed: else if (state == QHttpNetworkConnectionChannel::IdleStateend of block
| 0-6 | ||||||||||||||||||||||||
| 718 | - | |||||||||||||||||||||||||
| 719 | QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); | - | ||||||||||||||||||||||||
| 720 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 721 | state = QHttpNetworkConnectionChannel::IdleState; | - | ||||||||||||||||||||||||
| 722 | - | |||||||||||||||||||||||||
| 723 | requeueCurrentlyPipelinedRequests(); | - | ||||||||||||||||||||||||
| 724 | - | |||||||||||||||||||||||||
| 725 | pendingEncrypt = false; | - | ||||||||||||||||||||||||
| 726 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 727 | - | |||||||||||||||||||||||||
| 728 | - | |||||||||||||||||||||||||
| 729 | void QHttpNetworkConnectionChannel::_q_connected() | - | ||||||||||||||||||||||||
| 730 | { | - | ||||||||||||||||||||||||
| 731 | - | |||||||||||||||||||||||||
| 732 | if (connection->d_func()->networkLayerState == QHttpNetworkConnectionPrivate::HostLookupPending
| 0-781 | ||||||||||||||||||||||||
| 733 | if (connection->d_func()->delayedConnectionTimer.isActive()
| 4-120 | ||||||||||||||||||||||||
| 734 | connection->d_func()->delayedConnectionTimer.stop(); executed 4 times by 2 tests: connection->d_func()->delayedConnectionTimer.stop();Executed by:
| 4 | ||||||||||||||||||||||||
| 735 | if (networkLayerPreference == QAbstractSocket::IPv4Protocol
| 0-124 | ||||||||||||||||||||||||
| 736 | connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv4; executed 124 times by 2 tests: connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv4;Executed by:
| 124 | ||||||||||||||||||||||||
| 737 | else if (networkLayerPreference == QAbstractSocket::IPv6Protocol
| 0 | ||||||||||||||||||||||||
| 738 | connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv6; never executed: connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv6; | 0 | ||||||||||||||||||||||||
| 739 | else { | - | ||||||||||||||||||||||||
| 740 | if (socket->peerAddress().protocol() == QAbstractSocket::IPv4Protocol
| 0 | ||||||||||||||||||||||||
| 741 | connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv4; never executed: connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv4; | 0 | ||||||||||||||||||||||||
| 742 | else | - | ||||||||||||||||||||||||
| 743 | connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv6; never executed: connection->d_func()->networkLayerState = QHttpNetworkConnectionPrivate::IPv6; | 0 | ||||||||||||||||||||||||
| 744 | } | - | ||||||||||||||||||||||||
| 745 | connection->d_func()->networkLayerDetected(networkLayerPreference); | - | ||||||||||||||||||||||||
| 746 | } executed 124 times by 2 tests: else {end of blockExecuted by:
| 124 | ||||||||||||||||||||||||
| 747 | if (((
| 0-656 | ||||||||||||||||||||||||
| 748 | || ((
| 0-656 | ||||||||||||||||||||||||
| 749 | close(); | - | ||||||||||||||||||||||||
| 750 | - | |||||||||||||||||||||||||
| 751 | QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); | - | ||||||||||||||||||||||||
| 752 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 753 | } | - | ||||||||||||||||||||||||
| 754 | - | |||||||||||||||||||||||||
| 755 | } executed 657 times by 7 tests: end of blockExecuted by:
| 657 | ||||||||||||||||||||||||
| 756 | socket->setSocketOption(QAbstractSocket::KeepAliveOption, 1); | - | ||||||||||||||||||||||||
| 757 | - | |||||||||||||||||||||||||
| 758 | pipeliningSupported = QHttpNetworkConnectionChannel::PipeliningSupportUnknown; | - | ||||||||||||||||||||||||
| 759 | - | |||||||||||||||||||||||||
| 760 | - | |||||||||||||||||||||||||
| 761 | - | |||||||||||||||||||||||||
| 762 | if (ssl
| 0-660 | ||||||||||||||||||||||||
| 763 | - | |||||||||||||||||||||||||
| 764 | if (connection->sslContext().isNull()
| 26-95 | ||||||||||||||||||||||||
| 765 | - | |||||||||||||||||||||||||
| 766 | - | |||||||||||||||||||||||||
| 767 | QSharedPointer<QSslContext> socketSslContext = QSslSocketPrivate::sslContext(static_cast<QSslSocket*>(socket)); | - | ||||||||||||||||||||||||
| 768 | if (!socketSslContext.isNull()
| 0-95 | ||||||||||||||||||||||||
| 769 | connection->setSslContext(socketSslContext); executed 95 times by 3 tests: connection->setSslContext(socketSslContext);Executed by:
| 95 | ||||||||||||||||||||||||
| 770 | } executed 95 times by 3 tests: end of blockExecuted by:
| 95 | ||||||||||||||||||||||||
| 771 | - | |||||||||||||||||||||||||
| 772 | } executed 121 times by 3 tests: else {end of blockExecuted by:
| 121 | ||||||||||||||||||||||||
| 773 | state = QHttpNetworkConnectionChannel::IdleState; | - | ||||||||||||||||||||||||
| 774 | if (!reply
| 136-524 | ||||||||||||||||||||||||
| 775 | connection->d_func()->dequeueRequest(socket); executed 524 times by 8 tests: connection->d_func()->dequeueRequest(socket);Executed by:
| 524 | ||||||||||||||||||||||||
| 776 | if (reply
| 2-658 | ||||||||||||||||||||||||
| 777 | sendRequest(); executed 658 times by 8 tests: sendRequest();Executed by:
| 658 | ||||||||||||||||||||||||
| 778 | } executed 660 times by 8 tests: end of blockExecuted by:
| 660 | ||||||||||||||||||||||||
| 779 | } | - | ||||||||||||||||||||||||
| 780 | - | |||||||||||||||||||||||||
| 781 | - | |||||||||||||||||||||||||
| 782 | void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socketError) | - | ||||||||||||||||||||||||
| 783 | { | - | ||||||||||||||||||||||||
| 784 | if (!socket
| 0-199 | ||||||||||||||||||||||||
| 785 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 786 | QNetworkReply::NetworkError errorCode = QNetworkReply::UnknownNetworkError; | - | ||||||||||||||||||||||||
| 787 | - | |||||||||||||||||||||||||
| 788 | switch (socketError) { | - | ||||||||||||||||||||||||
| 789 | case executed 2 times by 1 test: QAbstractSocket::HostNotFoundError:case QAbstractSocket::HostNotFoundError:Executed by:
executed 2 times by 1 test: case QAbstractSocket::HostNotFoundError:Executed by:
| 2 | ||||||||||||||||||||||||
| 790 | errorCode = QNetworkReply::HostNotFoundError; | - | ||||||||||||||||||||||||
| 791 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||
| 792 | case executed 124 times by 2 tests: QAbstractSocket::ConnectionRefusedError:case QAbstractSocket::ConnectionRefusedError:Executed by:
executed 124 times by 2 tests: case QAbstractSocket::ConnectionRefusedError:Executed by:
| 124 | ||||||||||||||||||||||||
| 793 | errorCode = QNetworkReply::ConnectionRefusedError; | - | ||||||||||||||||||||||||
| 794 | break; executed 124 times by 2 tests: break;Executed by:
| 124 | ||||||||||||||||||||||||
| 795 | case executed 53 times by 3 tests: QAbstractSocket::RemoteHostClosedError:case QAbstractSocket::RemoteHostClosedError:Executed by:
executed 53 times by 3 tests: case QAbstractSocket::RemoteHostClosedError:Executed by:
| 53 | ||||||||||||||||||||||||
| 796 | - | |||||||||||||||||||||||||
| 797 | - | |||||||||||||||||||||||||
| 798 | - | |||||||||||||||||||||||||
| 799 | if (!reply
| 8-36 | ||||||||||||||||||||||||
| 800 | - | |||||||||||||||||||||||||
| 801 | - | |||||||||||||||||||||||||
| 802 | - | |||||||||||||||||||||||||
| 803 | return; executed 9 times by 2 tests: return;Executed by:
| 9 | ||||||||||||||||||||||||
| 804 | } else if (state != QHttpNetworkConnectionChannel::IdleState
| 0-44 | ||||||||||||||||||||||||
| 805 | - | |||||||||||||||||||||||||
| 806 | - | |||||||||||||||||||||||||
| 807 | if (reconnectAttempts-- > 0
| 6-33 | ||||||||||||||||||||||||
| 808 | resendCurrentRequest(); | - | ||||||||||||||||||||||||
| 809 | return; executed 33 times by 2 tests: return;Executed by:
| 33 | ||||||||||||||||||||||||
| 810 | } else { | - | ||||||||||||||||||||||||
| 811 | errorCode = QNetworkReply::RemoteHostClosedError; | - | ||||||||||||||||||||||||
| 812 | } executed 6 times by 2 tests: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 813 | } else if (state == QHttpNetworkConnectionChannel::ReadingState
| 0-5 | ||||||||||||||||||||||||
| 814 | if (!reply
| 0-5 | ||||||||||||||||||||||||
| 815 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 816 | - | |||||||||||||||||||||||||
| 817 | if (!reply->d_func()->expectContent()
| 0-5 | ||||||||||||||||||||||||
| 818 | - | |||||||||||||||||||||||||
| 819 | - | |||||||||||||||||||||||||
| 820 | QMetaObject::invokeMethod(this, "_q_receiveReply", Qt::QueuedConnection); | - | ||||||||||||||||||||||||
| 821 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 822 | } | - | ||||||||||||||||||||||||
| 823 | if (reply->contentLength() == -1
| 0-5 | ||||||||||||||||||||||||
| 824 | - | |||||||||||||||||||||||||
| 825 | - | |||||||||||||||||||||||||
| 826 | - | |||||||||||||||||||||||||
| 827 | QMetaObject::invokeMethod(this, "_q_receiveReply", Qt::QueuedConnection); | - | ||||||||||||||||||||||||
| 828 | return; executed 5 times by 1 test: return;Executed by:
| 5 | ||||||||||||||||||||||||
| 829 | } | - | ||||||||||||||||||||||||
| 830 | - | |||||||||||||||||||||||||
| 831 | - | |||||||||||||||||||||||||
| 832 | if (socket->bytesAvailable()
| 0 | ||||||||||||||||||||||||
| 833 | - | |||||||||||||||||||||||||
| 834 | - | |||||||||||||||||||||||||
| 835 | - | |||||||||||||||||||||||||
| 836 | reply->setReadBufferSize(0); | - | ||||||||||||||||||||||||
| 837 | reply->setDownstreamLimited(false); | - | ||||||||||||||||||||||||
| 838 | _q_receiveReply(); | - | ||||||||||||||||||||||||
| 839 | if (!reply
| 0 | ||||||||||||||||||||||||
| 840 | - | |||||||||||||||||||||||||
| 841 | requeueCurrentlyPipelinedRequests(); | - | ||||||||||||||||||||||||
| 842 | state = QHttpNetworkConnectionChannel::IdleState; | - | ||||||||||||||||||||||||
| 843 | QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); | - | ||||||||||||||||||||||||
| 844 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 845 | } | - | ||||||||||||||||||||||||
| 846 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 847 | - | |||||||||||||||||||||||||
| 848 | errorCode = QNetworkReply::RemoteHostClosedError; | - | ||||||||||||||||||||||||
| 849 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 850 | errorCode = QNetworkReply::RemoteHostClosedError; | - | ||||||||||||||||||||||||
| 851 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 852 | break; executed 6 times by 2 tests: break;Executed by:
| 6 | ||||||||||||||||||||||||
| 853 | case never executed: QAbstractSocket::SocketTimeoutError:case QAbstractSocket::SocketTimeoutError:never executed: case QAbstractSocket::SocketTimeoutError: | 0 | ||||||||||||||||||||||||
| 854 | - | |||||||||||||||||||||||||
| 855 | if (state == QHttpNetworkConnectionChannel::WritingState
| 0 | ||||||||||||||||||||||||
| 856 | resendCurrentRequest(); | - | ||||||||||||||||||||||||
| 857 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 858 | } | - | ||||||||||||||||||||||||
| 859 | errorCode = QNetworkReply::TimeoutError; | - | ||||||||||||||||||||||||
| 860 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 861 | case executed 5 times by 2 tests: QAbstractSocket::ProxyAuthenticationRequiredError:case QAbstractSocket::ProxyAuthenticationRequiredError:Executed by:
executed 5 times by 2 tests: case QAbstractSocket::ProxyAuthenticationRequiredError:Executed by:
| 5 | ||||||||||||||||||||||||
| 862 | errorCode = QNetworkReply::ProxyAuthenticationRequiredError; | - | ||||||||||||||||||||||||
| 863 | break; executed 5 times by 2 tests: break;Executed by:
| 5 | ||||||||||||||||||||||||
| 864 | case executed 12 times by 3 tests: QAbstractSocket::SslHandshakeFailedError:case QAbstractSocket::SslHandshakeFailedError:Executed by:
executed 12 times by 3 tests: case QAbstractSocket::SslHandshakeFailedError:Executed by:
| 12 | ||||||||||||||||||||||||
| 865 | errorCode = QNetworkReply::SslHandshakeFailedError; | - | ||||||||||||||||||||||||
| 866 | break; executed 12 times by 3 tests: break;Executed by:
| 12 | ||||||||||||||||||||||||
| 867 | case never executed: QAbstractSocket::ProxyConnectionClosedError:case QAbstractSocket::ProxyConnectionClosedError:never executed: case QAbstractSocket::ProxyConnectionClosedError: | 0 | ||||||||||||||||||||||||
| 868 | - | |||||||||||||||||||||||||
| 869 | if (reconnectAttempts-- > 0
| 0 | ||||||||||||||||||||||||
| 870 | resendCurrentRequest(); | - | ||||||||||||||||||||||||
| 871 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 872 | } | - | ||||||||||||||||||||||||
| 873 | errorCode = QNetworkReply::ProxyConnectionClosedError; | - | ||||||||||||||||||||||||
| 874 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 875 | case never executed: QAbstractSocket::ProxyConnectionTimeoutError:case QAbstractSocket::ProxyConnectionTimeoutError:never executed: case QAbstractSocket::ProxyConnectionTimeoutError: | 0 | ||||||||||||||||||||||||
| 876 | - | |||||||||||||||||||||||||
| 877 | if (reconnectAttempts-- > 0
| 0 | ||||||||||||||||||||||||
| 878 | resendCurrentRequest(); | - | ||||||||||||||||||||||||
| 879 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 880 | } | - | ||||||||||||||||||||||||
| 881 | errorCode = QNetworkReply::ProxyTimeoutError; | - | ||||||||||||||||||||||||
| 882 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 883 | default executed 3 times by 2 tests: :default:Executed by:
executed 3 times by 2 tests: default:Executed by:
| 3 | ||||||||||||||||||||||||
| 884 | - | |||||||||||||||||||||||||
| 885 | errorCode = QNetworkReply::UnknownNetworkError; | - | ||||||||||||||||||||||||
| 886 | break; executed 3 times by 2 tests: break;Executed by:
| 3 | ||||||||||||||||||||||||
| 887 | } | - | ||||||||||||||||||||||||
| 888 | QPointer<QHttpNetworkConnection> that = connection; | - | ||||||||||||||||||||||||
| 889 | QString errorString = connection->d_func()->errorDetail(errorCode, socket, socket->errorString()); | - | ||||||||||||||||||||||||
| 890 | - | |||||||||||||||||||||||||
| 891 | - | |||||||||||||||||||||||||
| 892 | - | |||||||||||||||||||||||||
| 893 | if (!connection->d_func()->shouldEmitChannelError(socket)
| 30-122 | ||||||||||||||||||||||||
| 894 | return; executed 122 times by 2 tests: return;Executed by:
| 122 | ||||||||||||||||||||||||
| 895 | - | |||||||||||||||||||||||||
| 896 | - | |||||||||||||||||||||||||
| 897 | do { | - | ||||||||||||||||||||||||
| 898 | - | |||||||||||||||||||||||||
| 899 | if (!reply
| 12-20 | ||||||||||||||||||||||||
| 900 | connection->d_func()->dequeueRequest(socket); executed 12 times by 3 tests: connection->d_func()->dequeueRequest(socket);Executed by:
| 12 | ||||||||||||||||||||||||
| 901 | - | |||||||||||||||||||||||||
| 902 | if (reply
| 3-29 | ||||||||||||||||||||||||
| 903 | reply->d_func()->errorString = errorString; | - | ||||||||||||||||||||||||
| 904 | reply->finishedWithError(errorCode, errorString); | - | ||||||||||||||||||||||||
| 905 | reply = 0; | - | ||||||||||||||||||||||||
| 906 | if (protocolHandler
| 12-17 | ||||||||||||||||||||||||
| 907 | protocolHandler->setReply(0); executed 12 times by 3 tests: protocolHandler->setReply(0);Executed by:
| 12 | ||||||||||||||||||||||||
| 908 | } executed 29 times by 3 tests: end of blockExecuted by:
| 29 | ||||||||||||||||||||||||
| 909 | } executed 32 times by 4 tests: while (!connection->d_func()->highPriorityQueue.isEmpty()end of blockExecuted by:
| 0-32 | ||||||||||||||||||||||||
| 910 | || !connection->d_func()->lowPriorityQueue.isEmpty()
| 2-30 | ||||||||||||||||||||||||
| 911 | - | |||||||||||||||||||||||||
| 912 | if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY
| 3-27 | ||||||||||||||||||||||||
| 913 | QList<HttpMessagePair> spdyPairs = spdyRequestsToSend.values(); | - | ||||||||||||||||||||||||
| 914 | for (int a = 0; a < spdyPairs.count()
| 3 | ||||||||||||||||||||||||
| 915 | - | |||||||||||||||||||||||||
| 916 | QHttpNetworkReply *currentReply = spdyPairs.at(a).second; | - | ||||||||||||||||||||||||
| 917 | ((!(currentReply)) ? qt_assert("currentReply",__FILE__,979) : qt_noop()); | - | ||||||||||||||||||||||||
| 918 | currentReply->finishedWithError(errorCode, errorString); | - | ||||||||||||||||||||||||
| 919 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||||||||||||||
| 920 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||||||||||||||
| 921 | - | |||||||||||||||||||||||||
| 922 | - | |||||||||||||||||||||||||
| 923 | - | |||||||||||||||||||||||||
| 924 | QMetaObject::invokeMethod(that, "_q_startNextRequest", Qt::QueuedConnection); | - | ||||||||||||||||||||||||
| 925 | - | |||||||||||||||||||||||||
| 926 | if (that
| 0-30 | ||||||||||||||||||||||||
| 927 | - | |||||||||||||||||||||||||
| 928 | if (!socket
| 0-30 | ||||||||||||||||||||||||
| 929 | state = QHttpNetworkConnectionChannel::IdleState; never executed: state = QHttpNetworkConnectionChannel::IdleState; | 0 | ||||||||||||||||||||||||
| 930 | else if (socket->state() == QAbstractSocket::UnconnectedState
| 13-17 | ||||||||||||||||||||||||
| 931 | state = QHttpNetworkConnectionChannel::IdleState; executed 17 times by 4 tests: state = QHttpNetworkConnectionChannel::IdleState;Executed by:
| 17 | ||||||||||||||||||||||||
| 932 | else | - | ||||||||||||||||||||||||
| 933 | state = QHttpNetworkConnectionChannel::ClosingState; executed 13 times by 2 tests: state = QHttpNetworkConnectionChannel::ClosingState;Executed by:
| 13 | ||||||||||||||||||||||||
| 934 | - | |||||||||||||||||||||||||
| 935 | - | |||||||||||||||||||||||||
| 936 | pendingEncrypt = false; | - | ||||||||||||||||||||||||
| 937 | } executed 30 times by 4 tests: end of blockExecuted by:
| 30 | ||||||||||||||||||||||||
| 938 | } executed 30 times by 4 tests: end of blockExecuted by:
| 30 | ||||||||||||||||||||||||
| 939 | - | |||||||||||||||||||||||||
| 940 | - | |||||||||||||||||||||||||
| 941 | void QHttpNetworkConnectionChannel::_q_proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator* auth) | - | ||||||||||||||||||||||||
| 942 | { | - | ||||||||||||||||||||||||
| 943 | - | |||||||||||||||||||||||||
| 944 | if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY
| 3-39 | ||||||||||||||||||||||||
| 945 | connection->d_func()->emitProxyAuthenticationRequired(this, proxy, auth); | - | ||||||||||||||||||||||||
| 946 | } executed 3 times by 1 test: else {end of blockExecuted by:
| 3 | ||||||||||||||||||||||||
| 947 | - | |||||||||||||||||||||||||
| 948 | - | |||||||||||||||||||||||||
| 949 | if (!reply
| 2-37 | ||||||||||||||||||||||||
| 950 | connection->d_func()->dequeueRequest(socket); executed 37 times by 1 test: connection->d_func()->dequeueRequest(socket);Executed by:
| 37 | ||||||||||||||||||||||||
| 951 | if (reply
| 0-39 | ||||||||||||||||||||||||
| 952 | connection->d_func()->emitProxyAuthenticationRequired(this, proxy, auth); executed 39 times by 1 test: connection->d_func()->emitProxyAuthenticationRequired(this, proxy, auth);Executed by:
| 39 | ||||||||||||||||||||||||
| 953 | - | |||||||||||||||||||||||||
| 954 | } executed 39 times by 1 test: end of blockExecuted by:
| 39 | ||||||||||||||||||||||||
| 955 | - | |||||||||||||||||||||||||
| 956 | } | - | ||||||||||||||||||||||||
| 957 | - | |||||||||||||||||||||||||
| 958 | - | |||||||||||||||||||||||||
| 959 | void QHttpNetworkConnectionChannel::_q_uploadDataReadyRead() | - | ||||||||||||||||||||||||
| 960 | { | - | ||||||||||||||||||||||||
| 961 | if (reply
| 0-1964 | ||||||||||||||||||||||||
| 962 | sendRequest(); executed 1964 times by 2 tests: sendRequest();Executed by:
| 1964 | ||||||||||||||||||||||||
| 963 | } executed 1964 times by 2 tests: end of blockExecuted by:
| 1964 | ||||||||||||||||||||||||
| 964 | - | |||||||||||||||||||||||||
| 965 | - | |||||||||||||||||||||||||
| 966 | void QHttpNetworkConnectionChannel::_q_encrypted() | - | ||||||||||||||||||||||||
| 967 | { | - | ||||||||||||||||||||||||
| 968 | QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket); | - | ||||||||||||||||||||||||
| 969 | ((!(sslSocket)) ? qt_assert("sslSocket",__FILE__,1031) : qt_noop()); | - | ||||||||||||||||||||||||
| 970 | - | |||||||||||||||||||||||||
| 971 | if (!protocolHandler
| 10-91 | ||||||||||||||||||||||||
| 972 | switch (sslSocket->sslConfiguration().nextProtocolNegotiationStatus()) { | - | ||||||||||||||||||||||||
| 973 | case executed 6 times by 1 test: QSslConfiguration::NextProtocolNegotiationNegotiated:case QSslConfiguration::NextProtocolNegotiationNegotiated:Executed by:
executed 6 times by 1 test: case QSslConfiguration::NextProtocolNegotiationNegotiated:Executed by:
| 6 | ||||||||||||||||||||||||
| 974 | case never executed: QSslConfiguration::NextProtocolNegotiationUnsupported:case QSslConfiguration::NextProtocolNegotiationUnsupported:never executed: {case QSslConfiguration::NextProtocolNegotiationUnsupported: | 0 | ||||||||||||||||||||||||
| 975 | QByteArray nextProtocol = sslSocket->sslConfiguration().nextNegotiatedProtocol(); | - | ||||||||||||||||||||||||
| 976 | if (nextProtocol == QSslConfiguration::NextProtocolHttp1_1
| 0-6 | ||||||||||||||||||||||||
| 977 | - | |||||||||||||||||||||||||
| 978 | } never executed: else if (nextProtocol == QSslConfiguration::NextProtocolSpdy3_0end of block
| 0-6 | ||||||||||||||||||||||||
| 979 | protocolHandler.reset(new QSpdyProtocolHandler(this)); | - | ||||||||||||||||||||||||
| 980 | connection->setConnectionType(QHttpNetworkConnection::ConnectionTypeSPDY); | - | ||||||||||||||||||||||||
| 981 | - | |||||||||||||||||||||||||
| 982 | - | |||||||||||||||||||||||||
| 983 | break; executed 6 times by 1 test: break;Executed by:
| 6 | ||||||||||||||||||||||||
| 984 | } else { | - | ||||||||||||||||||||||||
| 985 | emitFinishedWithError(QNetworkReply::SslHandshakeFailedError, | - | ||||||||||||||||||||||||
| 986 | "detected unknown Next Protocol Negotiation protocol"); | - | ||||||||||||||||||||||||
| 987 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 988 | } | - | ||||||||||||||||||||||||
| 989 | } | - | ||||||||||||||||||||||||
| 990 | case executed 85 times by 3 tests: case QSslConfiguration::NextProtocolNegotiationNone:Executed by:
code before this statement never executed: case QSslConfiguration::NextProtocolNegotiationNone:executed 85 times by 3 tests: QSslConfiguration::NextProtocolNegotiationNone:case QSslConfiguration::NextProtocolNegotiationNone:Executed by:
code before this statement never executed: case QSslConfiguration::NextProtocolNegotiationNone:executed 85 times by 3 tests: case QSslConfiguration::NextProtocolNegotiationNone:Executed by:
| 0-85 | ||||||||||||||||||||||||
| 991 | protocolHandler.reset(new QHttpProtocolHandler(this)); | - | ||||||||||||||||||||||||
| 992 | connection->setConnectionType(QHttpNetworkConnection::ConnectionTypeHTTP); | - | ||||||||||||||||||||||||
| 993 | - | |||||||||||||||||||||||||
| 994 | requeueSpdyRequests(); | - | ||||||||||||||||||||||||
| 995 | break; executed 85 times by 3 tests: break;Executed by:
| 85 | ||||||||||||||||||||||||
| 996 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 997 | emitFinishedWithError(QNetworkReply::SslHandshakeFailedError, | - | ||||||||||||||||||||||||
| 998 | "detected unknown Next Protocol Negotiation protocol"); | - | ||||||||||||||||||||||||
| 999 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1000 | } | - | ||||||||||||||||||||||||
| 1001 | - | |||||||||||||||||||||||||
| 1002 | if (!socket
| 0-101 | ||||||||||||||||||||||||
| 1003 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1004 | state = QHttpNetworkConnectionChannel::IdleState; | - | ||||||||||||||||||||||||
| 1005 | pendingEncrypt = false; | - | ||||||||||||||||||||||||
| 1006 | - | |||||||||||||||||||||||||
| 1007 | if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY
| 6-95 | ||||||||||||||||||||||||
| 1008 | - | |||||||||||||||||||||||||
| 1009 | if (spdyRequestsToSend.count() > 0
| 0-6 | ||||||||||||||||||||||||
| 1010 | - | |||||||||||||||||||||||||
| 1011 | QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); executed 6 times by 1 test: QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);Executed by:
| 6 | ||||||||||||||||||||||||
| 1012 | } executed 6 times by 1 test: else {end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 1013 | if (!reply
| 39-56 | ||||||||||||||||||||||||
| 1014 | connection->d_func()->dequeueRequest(socket); executed 56 times by 1 test: connection->d_func()->dequeueRequest(socket);Executed by:
| 56 | ||||||||||||||||||||||||
| 1015 | if (reply
| 3-92 | ||||||||||||||||||||||||
| 1016 | reply->setSpdyWasUsed(false); | - | ||||||||||||||||||||||||
| 1017 | ((!(reply->d_func()->connectionChannel == this)) ? qt_assert("reply->d_func()->connectionChannel == this",__FILE__,1079) : qt_noop()); | - | ||||||||||||||||||||||||
| 1018 | reply->encrypted(); | - | ||||||||||||||||||||||||
| 1019 | } executed 92 times by 3 tests: end of blockExecuted by:
| 92 | ||||||||||||||||||||||||
| 1020 | if (reply
| 3-92 | ||||||||||||||||||||||||
| 1021 | sendRequest(); executed 92 times by 3 tests: sendRequest();Executed by:
| 92 | ||||||||||||||||||||||||
| 1022 | } executed 95 times by 3 tests: end of blockExecuted by:
| 95 | ||||||||||||||||||||||||
| 1023 | } | - | ||||||||||||||||||||||||
| 1024 | - | |||||||||||||||||||||||||
| 1025 | void QHttpNetworkConnectionChannel::requeueSpdyRequests() | - | ||||||||||||||||||||||||
| 1026 | { | - | ||||||||||||||||||||||||
| 1027 | QList<HttpMessagePair> spdyPairs = spdyRequestsToSend.values(); | - | ||||||||||||||||||||||||
| 1028 | for (int a = 0; a < spdyPairs.count()
| 0-85 | ||||||||||||||||||||||||
| 1029 | connection->d_func()->requeueRequest(spdyPairs.at(a)); | - | ||||||||||||||||||||||||
| 1030 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1031 | spdyRequestsToSend.clear(); | - | ||||||||||||||||||||||||
| 1032 | } executed 85 times by 3 tests: end of blockExecuted by:
| 85 | ||||||||||||||||||||||||
| 1033 | - | |||||||||||||||||||||||||
| 1034 | void QHttpNetworkConnectionChannel::emitFinishedWithError(QNetworkReply::NetworkError error, | - | ||||||||||||||||||||||||
| 1035 | const char *message) | - | ||||||||||||||||||||||||
| 1036 | { | - | ||||||||||||||||||||||||
| 1037 | if (reply
| 0 | ||||||||||||||||||||||||
| 1038 | reply->finishedWithError(error, QHttpNetworkConnectionChannel::tr(message)); never executed: reply->finishedWithError(error, QHttpNetworkConnectionChannel::tr(message)); | 0 | ||||||||||||||||||||||||
| 1039 | QList<HttpMessagePair> spdyPairs = spdyRequestsToSend.values(); | - | ||||||||||||||||||||||||
| 1040 | for (int a = 0; a < spdyPairs.count()
| 0 | ||||||||||||||||||||||||
| 1041 | QHttpNetworkReply *currentReply = spdyPairs.at(a).second; | - | ||||||||||||||||||||||||
| 1042 | ((!(currentReply)) ? qt_assert("currentReply",__FILE__,1104) : qt_noop()); | - | ||||||||||||||||||||||||
| 1043 | currentReply->finishedWithError(error, QHttpNetworkConnectionChannel::tr(message)); | - | ||||||||||||||||||||||||
| 1044 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1045 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1046 | - | |||||||||||||||||||||||||
| 1047 | void QHttpNetworkConnectionChannel::_q_sslErrors(const QList<QSslError> &errors) | - | ||||||||||||||||||||||||
| 1048 | { | - | ||||||||||||||||||||||||
| 1049 | if (!socket
| 0-54 | ||||||||||||||||||||||||
| 1050 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1051 | - | |||||||||||||||||||||||||
| 1052 | - | |||||||||||||||||||||||||
| 1053 | - | |||||||||||||||||||||||||
| 1054 | connection->d_func()->pauseConnection(); | - | ||||||||||||||||||||||||
| 1055 | if (pendingEncrypt
| 0-54 | ||||||||||||||||||||||||
| 1056 | connection->d_func()->dequeueRequest(socket); executed 48 times by 3 tests: connection->d_func()->dequeueRequest(socket);Executed by:
| 48 | ||||||||||||||||||||||||
| 1057 | if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP
| 7-47 | ||||||||||||||||||||||||
| 1058 | if (reply
| 2-45 | ||||||||||||||||||||||||
| 1059 | reply->sslErrors(errors); executed 45 times by 3 tests: reply->sslErrors(errors);Executed by:
| 45 | ||||||||||||||||||||||||
| 1060 | } executed 47 times by 3 tests: end of blockExecuted by:
| 47 | ||||||||||||||||||||||||
| 1061 | - | |||||||||||||||||||||||||
| 1062 | else { | - | ||||||||||||||||||||||||
| 1063 | QList<HttpMessagePair> spdyPairs = spdyRequestsToSend.values(); | - | ||||||||||||||||||||||||
| 1064 | for (int a = 0; a < spdyPairs.count()
| 7 | ||||||||||||||||||||||||
| 1065 | - | |||||||||||||||||||||||||
| 1066 | QHttpNetworkReply *currentReply = spdyPairs.at(a).second; | - | ||||||||||||||||||||||||
| 1067 | ((!(currentReply)) ? qt_assert("currentReply",__FILE__,1129) : qt_noop()); | - | ||||||||||||||||||||||||
| 1068 | currentReply->sslErrors(errors); | - | ||||||||||||||||||||||||
| 1069 | } executed 7 times by 1 test: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||
| 1070 | } executed 7 times by 1 test: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||
| 1071 | - | |||||||||||||||||||||||||
| 1072 | connection->d_func()->resumeConnection(); | - | ||||||||||||||||||||||||
| 1073 | } executed 54 times by 3 tests: end of blockExecuted by:
| 54 | ||||||||||||||||||||||||
| 1074 | - | |||||||||||||||||||||||||
| 1075 | void QHttpNetworkConnectionChannel::_q_preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator) | - | ||||||||||||||||||||||||
| 1076 | { | - | ||||||||||||||||||||||||
| 1077 | connection->d_func()->pauseConnection(); | - | ||||||||||||||||||||||||
| 1078 | - | |||||||||||||||||||||||||
| 1079 | if (pendingEncrypt
| 0 | ||||||||||||||||||||||||
| 1080 | connection->d_func()->dequeueRequest(socket); never executed: connection->d_func()->dequeueRequest(socket); | 0 | ||||||||||||||||||||||||
| 1081 | - | |||||||||||||||||||||||||
| 1082 | if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP
| 0 | ||||||||||||||||||||||||
| 1083 | if (reply
| 0 | ||||||||||||||||||||||||
| 1084 | reply->preSharedKeyAuthenticationRequired(authenticator); never executed: reply->preSharedKeyAuthenticationRequired(authenticator); | 0 | ||||||||||||||||||||||||
| 1085 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1086 | QList<HttpMessagePair> spdyPairs = spdyRequestsToSend.values(); | - | ||||||||||||||||||||||||
| 1087 | for (int a = 0; a < spdyPairs.count()
| 0 | ||||||||||||||||||||||||
| 1088 | - | |||||||||||||||||||||||||
| 1089 | QHttpNetworkReply *currentReply = spdyPairs.at(a).second; | - | ||||||||||||||||||||||||
| 1090 | ((!(currentReply)) ? qt_assert("currentReply",__FILE__,1152) : qt_noop()); | - | ||||||||||||||||||||||||
| 1091 | currentReply->preSharedKeyAuthenticationRequired(authenticator); | - | ||||||||||||||||||||||||
| 1092 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1093 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1094 | - | |||||||||||||||||||||||||
| 1095 | connection->d_func()->resumeConnection(); | - | ||||||||||||||||||||||||
| 1096 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1097 | - | |||||||||||||||||||||||||
| 1098 | void QHttpNetworkConnectionChannel::_q_encryptedBytesWritten(qint64 bytes) | - | ||||||||||||||||||||||||
| 1099 | { | - | ||||||||||||||||||||||||
| 1100 | (void)bytes;; | - | ||||||||||||||||||||||||
| 1101 | - | |||||||||||||||||||||||||
| 1102 | if (isSocketWriting()
| 896-1182 | ||||||||||||||||||||||||
| 1103 | sendRequest(); executed 896 times by 1 test: sendRequest();Executed by:
| 896 | ||||||||||||||||||||||||
| 1104 | - | |||||||||||||||||||||||||
| 1105 | } executed 2078 times by 3 tests: end of blockExecuted by:
| 2078 | ||||||||||||||||||||||||
| 1106 | - | |||||||||||||||||||||||||
| 1107 | - | |||||||||||||||||||||||||
| 1108 | - | |||||||||||||||||||||||||
| 1109 | void QHttpNetworkConnectionChannel::setConnection(QHttpNetworkConnection *c) | - | ||||||||||||||||||||||||
| 1110 | { | - | ||||||||||||||||||||||||
| 1111 | - | |||||||||||||||||||||||||
| 1112 | - | |||||||||||||||||||||||||
| 1113 | connection = c; | - | ||||||||||||||||||||||||
| 1114 | } executed 3416 times by 8 tests: end of blockExecuted by:
| 3416 | ||||||||||||||||||||||||
| 1115 | - | |||||||||||||||||||||||||
| 1116 | - | |||||||||||||||||||||||||
| 1117 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |