qnetworkaccessftpbackend.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/access/qnetworkaccessftpbackend.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6enum {-
7 DefaultFtpPort = 21-
8};-
9-
10static QByteArray makeCacheKey(const QUrl &url)-
11{-
12 QUrl copy = url;-
13 copy.setPort(url.port(DefaultFtpPort));-
14 return
executed 98 times by 1 test: return "ftp-connection:" + copy.toEncoded(QUrl::RemovePassword | QUrl::RemovePath | QUrl::RemoveQuery | QUrl::RemoveFragment);
Executed by:
  • tst_QNetworkReply
"ftp-connection:" +
executed 98 times by 1 test: return "ftp-connection:" + copy.toEncoded(QUrl::RemovePassword | QUrl::RemovePath | QUrl::RemoveQuery | QUrl::RemoveFragment);
Executed by:
  • tst_QNetworkReply
98
15 copy.toEncoded(QUrl::RemovePassword | QUrl::RemovePath | QUrl::RemoveQuery |
executed 98 times by 1 test: return "ftp-connection:" + copy.toEncoded(QUrl::RemovePassword | QUrl::RemovePath | QUrl::RemoveQuery | QUrl::RemoveFragment);
Executed by:
  • tst_QNetworkReply
98
16 QUrl::RemoveFragment);
executed 98 times by 1 test: return "ftp-connection:" + copy.toEncoded(QUrl::RemovePassword | QUrl::RemovePath | QUrl::RemoveQuery | QUrl::RemoveFragment);
Executed by:
  • tst_QNetworkReply
98
17}-
18-
19QStringList QNetworkAccessFtpBackendFactory::supportedSchemes() const-
20{-
21 return
never executed: return QStringList(([]() -> QString { enum { Size = sizeof(u"" "ftp")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "ftp" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));
QStringList(([]() -> QString { enum { Size = sizeof(u"" "ftp")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "ftp" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}()));
never executed: return QStringList(([]() -> QString { enum { Size = sizeof(u"" "ftp")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "ftp" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));
0
22}-
23-
24QNetworkAccessBackend *-
25QNetworkAccessFtpBackendFactory::create(QNetworkAccessManager::Operation op,-
26 const QNetworkRequest &request) const-
27{-
28-
29 switch (op) {-
30 case
executed 49 times by 1 test: case QNetworkAccessManager::GetOperation:
Executed by:
  • tst_QNetworkReply
QNetworkAccessManager::GetOperation:
executed 49 times by 1 test: case QNetworkAccessManager::GetOperation:
Executed by:
  • tst_QNetworkReply
49
31 case
executed 59 times by 1 test: case QNetworkAccessManager::PutOperation:
Executed by:
  • tst_QNetworkReply
QNetworkAccessManager::PutOperation:
executed 59 times by 1 test: case QNetworkAccessManager::PutOperation:
Executed by:
  • tst_QNetworkReply
59
32 break;
executed 108 times by 1 test: break;
Executed by:
  • tst_QNetworkReply
108
33-
34 default
never executed: default:
:
never executed: default:
0
35-
36 return
never executed: return 0;
0;
never executed: return 0;
0
37 }-
38-
39 QUrl url = request.url();-
40 if (url.scheme().compare(QLatin1String("ftp"), Qt::CaseInsensitive) == 0
url.scheme().c...ensitive) == 0Description
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 54 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
54
41 return
executed 54 times by 1 test: return new QNetworkAccessFtpBackend;
Executed by:
  • tst_QNetworkReply
new QNetworkAccessFtpBackend;
executed 54 times by 1 test: return new QNetworkAccessFtpBackend;
Executed by:
  • tst_QNetworkReply
54
42 return
executed 54 times by 1 test: return 0;
Executed by:
  • tst_QNetworkReply
0;
executed 54 times by 1 test: return 0;
Executed by:
  • tst_QNetworkReply
54
43}-
44-
45class QNetworkAccessCachedFtpConnection: public QFtp, public QNetworkAccessCache::CacheableObject-
46{-
47-
48public:-
49 QNetworkAccessCachedFtpConnection()-
50 {-
51 setExpires(true);-
52 setShareable(false);-
53 }
executed 48 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
48
54-
55 void dispose() override-
56 {-
57 connect(this, qFlagLocation("2""done(bool)" "\0" __FILE__ ":" "101"), this, qFlagLocation("1""deleteLater()" "\0" __FILE__ ":" "101"));-
58 close();-
59 }
executed 48 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
48
60};-
61-
62QNetworkAccessFtpBackend::QNetworkAccessFtpBackend()-
63 : ftp(0), uploadDevice(0), totalBytes(0), helpId(-1), sizeId(-1), mdtmId(-1),-
64 supportsSize(false), supportsMdtm(false), state(Idle)-
65{-
66}
executed 54 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
54
67-
68QNetworkAccessFtpBackend::~QNetworkAccessFtpBackend()-
69{-
70-
71 if (ftp && state != Disconnecting
state != DisconnectingDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
)
1
72 ftp->abort();
executed 1 time by 1 test: ftp->abort();
Executed by:
  • tst_QNetworkReply
1
73 disconnectFromFtp();-
74}
executed 54 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
54
75-
76void QNetworkAccessFtpBackend::open()-
77{-
78-
79 QNetworkProxy proxy;-
80 const auto proxies = proxyList();-
81 for (const QNetworkProxy &p : proxies) {-
82-
83-
84 if (p.type() == QNetworkProxy::FtpCachingProxy
p.type() == QN...tpCachingProxyDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 53 times by 1 test
Evaluated by:
  • tst_QNetworkReply
2-53
85 || p.type() == QNetworkProxy::NoProxy
p.type() == QN...Proxy::NoProxyDescription
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
5-48
86 proxy = p;-
87 break;
executed 50 times by 1 test: break;
Executed by:
  • tst_QNetworkReply
50
88 }-
89 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
5
90-
91-
92 if (proxy.type() == QNetworkProxy::DefaultProxy
proxy.type() =...::DefaultProxyDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
3-50
93-
94 error(QNetworkReply::ProxyNotFoundError,-
95 tr("No suitable proxy found"));-
96 finished();-
97 return;
executed 3 times by 1 test: return;
Executed by:
  • tst_QNetworkReply
3
98 }-
99-
100-
101-
102 QUrl url = this->url();-
103 if (url.path().isEmpty()
url.path().isEmpty()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 49 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
1-49
104 url.setPath(QLatin1String("/"));-
105 setUrl(url);-
106 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QNetworkReply
1
107 if (url.path().endsWith(QLatin1Char('/'))
url.path().end...tin1Char('/'))Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 49 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
1-49
108 error(QNetworkReply::ContentOperationNotPermittedError,-
109 tr("Cannot open %1: is a directory").arg(url.toString()));-
110 finished();-
111 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_QNetworkReply
1
112 }-
113 state = LoggingIn;-
114-
115 QNetworkAccessCache* objectCache = QNetworkAccessManagerPrivate::getObjectCache(this);-
116 QByteArray cacheKey = makeCacheKey(url);-
117 if (!objectCache->requestEntry(cacheKey, this,
!objectCache->...__ ":" "162"))Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
1-48
118 qFlagLocation("1""ftpConnectionReady(QNetworkAccessCache::CacheableObject*)" "\0" __FILE__ ":" "162"))
!objectCache->...__ ":" "162"))Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
1-48
119 ftp = new QNetworkAccessCachedFtpConnection;-
120-
121-
122 ftp->setProperty("_q_networksession", property("_q_networksession"));-
123-
124-
125 if (proxy.type() == QNetworkProxy::FtpCachingProxy
proxy.type() =...tpCachingProxyDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 46 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
2-46
126 ftp->setProxy(proxy.hostName(), proxy.port());
executed 2 times by 1 test: ftp->setProxy(proxy.hostName(), proxy.port());
Executed by:
  • tst_QNetworkReply
2
127-
128 ftp->connectToHost(url.host(), url.port(DefaultFtpPort));-
129 ftp->login(url.userName(), url.password());-
130-
131 objectCache->addEntry(cacheKey, ftp);-
132 ftpConnectionReady(ftp);-
133 }
executed 48 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
48
134-
135-
136 if (operation() == QNetworkAccessManager::PutOperation
operation() ==...::PutOperationDescription
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
13-36
137 uploadDevice = QNonContiguousByteDeviceFactory::wrap(createUploadByteDevice());-
138 uploadDevice->setParent(this);-
139 }
executed 13 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
13
140}
executed 49 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
49
141-
142void QNetworkAccessFtpBackend::closeDownstreamChannel()-
143{-
144 state = Disconnecting;-
145 if (operation() == QNetworkAccessManager::GetOperation
operation() ==...::GetOperationDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
)
0-1
146 ftp->abort();
executed 1 time by 1 test: ftp->abort();
Executed by:
  • tst_QNetworkReply
1
147}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QNetworkReply
1
148-
149void QNetworkAccessFtpBackend::downstreamReadyWrite()-
150{-
151 if (state == Transferring
state == TransferringDescription
TRUEevaluated 447 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_QNetworkReply
&& ftp && ftp->bytesAvailable()
ftp->bytesAvailable()Description
TRUEnever evaluated
FALSEevaluated 447 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
0-447
152 ftpReadyRead();
never executed: ftpReadyRead();
0
153}
executed 485 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
485
154-
155void QNetworkAccessFtpBackend::ftpConnectionReady(QNetworkAccessCache::CacheableObject *o)-
156{-
157 ftp = static_cast<QNetworkAccessCachedFtpConnection *>(o);-
158 connect(ftp, qFlagLocation("2""done(bool)" "\0" __FILE__ ":" "202"), qFlagLocation("1""ftpDone()" "\0" __FILE__ ":" "202"));-
159 connect(ftp, qFlagLocation("2""rawCommandReply(int,QString)" "\0" __FILE__ ":" "203"), qFlagLocation("1""ftpRawCommandReply(int,QString)" "\0" __FILE__ ":" "203"));-
160 connect(ftp, qFlagLocation("2""readyRead()" "\0" __FILE__ ":" "204"), qFlagLocation("1""ftpReadyRead()" "\0" __FILE__ ":" "204"));-
161-
162-
163 if (ftp->state() == QFtp::LoggedIn
ftp->state() == QFtp::LoggedInDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
1-48
164 ftpDone();
executed 1 time by 1 test: ftpDone();
Executed by:
  • tst_QNetworkReply
1
165-
166-
167}
executed 49 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
49
168-
169void QNetworkAccessFtpBackend::disconnectFromFtp(CacheCleanupMode mode)-
170{-
171 state = Disconnecting;-
172-
173 if (ftp
ftpDescription
TRUEevaluated 49 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
49-52
174 disconnect(ftp, 0, this, 0);-
175-
176 QByteArray key = makeCacheKey(url());-
177 if (mode == RemoveCachedConnection
mode == RemoveCachedConnectionDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
9-40
178 QNetworkAccessManagerPrivate::getObjectCache(this)->removeEntry(key);-
179 ftp->dispose();-
180 }
executed 9 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else {
9
181 QNetworkAccessManagerPrivate::getObjectCache(this)->releaseEntry(key);-
182 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
40
183-
184 ftp = 0;-
185 }
executed 49 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
49
186}
executed 101 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
101
187-
188void QNetworkAccessFtpBackend::ftpDone()-
189{-
190-
191 if (state == LoggingIn
state == LoggingInDescription
TRUEevaluated 49 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 129 times by 1 test
Evaluated by:
  • tst_QNetworkReply
&& ftp->state() != QFtp::LoggedIn
ftp->state() != QFtp::LoggedInDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 45 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
4-129
192 if (ftp->state() == QFtp::Connected
ftp->state() =...Ftp::ConnectedDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
1-3
193-
194 QUrl newUrl = url();-
195 QString userInfo = newUrl.userInfo();-
196 newUrl.setUserInfo(QString());-
197 setUrl(newUrl);-
198-
199 QAuthenticator auth;-
200 authenticationRequired(&auth);-
201-
202 if (!auth.isNull()
!auth.isNull()Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
0-3
203-
204 newUrl.setUserName(auth.user());-
205 ftp->login(auth.user(), auth.password());-
206 return;
never executed: return;
0
207 }-
208-
209-
210 newUrl.setUserInfo(userInfo);-
211 setUrl(newUrl);-
212-
213 error(QNetworkReply::AuthenticationRequiredError,-
214 tr("Logging in to %1 failed: authentication required")-
215 .arg(url().host()));-
216 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else {
3
217-
218 QNetworkReply::NetworkError code;-
219 switch (ftp->error()) {-
220 case
executed 1 time by 1 test: case QFtp::HostNotFound:
Executed by:
  • tst_QNetworkReply
QFtp::HostNotFound:
executed 1 time by 1 test: case QFtp::HostNotFound:
Executed by:
  • tst_QNetworkReply
1
221 code = QNetworkReply::HostNotFoundError;-
222 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QNetworkReply
1
223-
224 case
never executed: case QFtp::ConnectionRefused:
QFtp::ConnectionRefused:
never executed: case QFtp::ConnectionRefused:
0
225 code = QNetworkReply::ConnectionRefusedError;-
226 break;
never executed: break;
0
227-
228 default
never executed: default:
:
never executed: default:
0
229 code = QNetworkReply::ProtocolFailure;-
230 break;
never executed: break;
0
231 }-
232-
233 error(code, ftp->errorString());-
234 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QNetworkReply
1
235-
236-
237 disconnectFromFtp(RemoveCachedConnection);-
238 finished();-
239 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_QNetworkReply
4
240 }-
241-
242-
243 if (ftp->error() != QFtp::NoError
ftp->error() != QFtp::NoErrorDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 169 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
5-169
244 QString msg;-
245 if (operation() == QNetworkAccessManager::GetOperation
operation() ==...::GetOperationDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
)
0-5
246 msg = tr("Error while downloading %1: %2");
executed 5 times by 1 test: msg = tr("Error while downloading %1: %2");
Executed by:
  • tst_QNetworkReply
5
247 else-
248 msg = tr("Error while uploading %1: %2");
never executed: msg = tr("Error while uploading %1: %2");
0
249 msg = msg.arg(url().toString(), ftp->errorString());-
250-
251 if (state == Statting
state == StattingDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
)
1-4
252-
253 error(QNetworkReply::ContentNotFoundError, msg);
executed 4 times by 1 test: error(QNetworkReply::ContentNotFoundError, msg);
Executed by:
  • tst_QNetworkReply
4
254 else-
255 error(QNetworkReply::ContentAccessDenied, msg);
executed 1 time by 1 test: error(QNetworkReply::ContentAccessDenied, msg);
Executed by:
  • tst_QNetworkReply
1
256-
257 disconnectFromFtp(RemoveCachedConnection);-
258 finished();-
259 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
5
260-
261 if (state == LoggingIn
state == LoggingInDescription
TRUEevaluated 45 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 129 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
45-129
262 state = CheckingFeatures;-
263 if (operation() == QNetworkAccessManager::GetOperation
operation() ==...::GetOperationDescription
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
11-34
264-
265 helpId = ftp->rawCommand(QLatin1String("HELP"));-
266 }
executed 34 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else {
34
267 ftpDone();-
268 }
executed 11 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
11
269 } else if (state == CheckingFeatures
state == CheckingFeaturesDescription
TRUEevaluated 45 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 84 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
45-84
270 state = Statting;-
271 if (operation() == QNetworkAccessManager::GetOperation
operation() ==...::GetOperationDescription
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
11-34
272-
273 const QString path = url().path();-
274 if (supportsSize
supportsSizeDescription
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-34
275 ftp->rawCommand(QLatin1String("TYPE I"));-
276 sizeId = ftp->rawCommand(QLatin1String("SIZE ") + path);-
277 }
executed 34 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
34
278 if (supportsMdtm
supportsMdtmDescription
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
)
0-34
279 mdtmId = ftp->rawCommand(QLatin1String("MDTM ") + path);
executed 34 times by 1 test: mdtmId = ftp->rawCommand(QLatin1String("MDTM ") + path);
Executed by:
  • tst_QNetworkReply
34
280 if (!supportsSize
!supportsSizeDescription
TRUEnever evaluated
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_QNetworkReply
&& !supportsMdtm
!supportsMdtmDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-34
281 ftpDone();
never executed: ftpDone();
0
282 }
executed 34 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else {
34
283 ftpDone();-
284 }
executed 11 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
11
285 } else if (state == Statting
state == StattingDescription
TRUEevaluated 41 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 43 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
41-43
286-
287 metaDataChanged();-
288 state = Transferring;-
289-
290 QFtp::TransferType type = QFtp::Binary;-
291 if (operation() == QNetworkAccessManager::GetOperation
operation() ==...::GetOperationDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
11-30
292 setCachingEnabled(true);-
293 ftp->get(url().path(), 0, type);-
294 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else {
30
295 ftp->put(uploadDevice, url().path(), type);-
296 }
executed 11 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
11
297-
298 } else if (state == Transferring
state == TransferringDescription
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
5-38
299-
300 disconnectFromFtp();-
301 finished();-
302 }
executed 38 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
38
303}
executed 174 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
174
304-
305void QNetworkAccessFtpBackend::ftpReadyRead()-
306{-
307 QByteArray data = ftp->readAll();-
308 QByteDataBuffer list;-
309 list.append(data);-
310 data.clear();-
311 writeDownstreamData(list);-
312}
executed 454 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
454
313-
314void QNetworkAccessFtpBackend::ftpRawCommandReply(int code, const QString &text)-
315{-
316-
317 int id = ftp->currentId();-
318-
319 if ((
(id == helpId)Description
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 98 times by 1 test
Evaluated by:
  • tst_QNetworkReply
id == helpId)
(id == helpId)Description
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 98 times by 1 test
Evaluated by:
  • tst_QNetworkReply
&& ((
(code == 200)Description
TRUEnever evaluated
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_QNetworkReply
code == 200)
(code == 200)Description
TRUEnever evaluated
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_QNetworkReply
|| (
(code == 214)Description
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
code == 214)
(code == 214)Description
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
)) {
0-98
320-
321-
322-
323 if (text.contains(QLatin1String("SIZE"), Qt::CaseSensitive)
text.contains(...CaseSensitive)Description
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
)
0-34
324 supportsSize = true;
executed 34 times by 1 test: supportsSize = true;
Executed by:
  • tst_QNetworkReply
34
325 if (text.contains(QLatin1String("MDTM"), Qt::CaseSensitive)
text.contains(...CaseSensitive)Description
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
)
0-34
326 supportsMdtm = true;
executed 34 times by 1 test: supportsMdtm = true;
Executed by:
  • tst_QNetworkReply
34
327 }
executed 34 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else if (code == 213
code == 213Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
34-60
328 if (id == sizeId
id == sizeIdDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
30
329-
330 setHeader(QNetworkRequest::ContentLengthHeader, text.toLongLong());-
331-
332 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else if (id == mdtmId
id == mdtmIdDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-30
333 QDateTime dt = QDateTime::fromString(text, QLatin1String("yyyyMMddHHmmss"));-
334 setHeader(QNetworkRequest::LastModifiedHeader, dt);-
335-
336 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
30
337 }
executed 60 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
60
338}
executed 132 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
132
339-
340-
Switch to Source codePreprocessed file

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