From aa67255608d7b752fcdd6fcbabf518dbdbf4f98e Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Mon, 28 Mar 2011 16:02:10 +0100 Subject: Symbian workaround for networkselftest The frox ftp proxy closes connections using TCP RST instead of a normal TCP FIN. On symbian, this causes the received but unacknowledged preceding packet to be discarded (the "221 Goodbye" ftp response). As QNAM and QFTP don't care about this, the network self test won't either. (only for symbian, as windows and unix TCP/IP stacks retain the unacknowledged packet in the receive queue) Reviewed-by: Markus Goetz --- tests/auto/networkselftest/tst_networkselftest.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/auto/networkselftest/tst_networkselftest.cpp b/tests/auto/networkselftest/tst_networkselftest.cpp index ed070d7..f40ea3e 100644 --- a/tests/auto/networkselftest/tst_networkselftest.cpp +++ b/tests/auto/networkselftest/tst_networkselftest.cpp @@ -495,7 +495,8 @@ void tst_NetworkSelfTest::fileLineEndingTest() static QList ftpChat(const QByteArray &userSuffix = QByteArray()) { - return QList() << Chat::expect("220") + QList rv; + rv << Chat::expect("220") << Chat::discardUntil("\r\n") << Chat::send("USER anonymous" + userSuffix + "\r\n") << Chat::expect("331") @@ -530,10 +531,15 @@ static QList ftpChat(const QByteArray &userSuffix = QByteArray()) // << Chat::send("SIZE nonASCII/german_\344\366\374\304\326\334\337\r\n") // << Chat::expect("213 40\r\n") - << Chat::send("QUIT\r\n") - << Chat::expect("221") - << Chat::discardUntil("\r\n") - << Chat::RemoteDisconnect; + << Chat::send("QUIT\r\n"); +#ifdef Q_OS_SYMBIAN + if (userSuffix.length() == 0) // received but unacknowledged packets are discarded by TCP RST, so this doesn't work with frox proxy +#endif + rv << Chat::expect("221") + << Chat::discardUntil("\r\n"); + + rv << Chat::RemoteDisconnect; + return rv; } void tst_NetworkSelfTest::ftpServer() -- cgit v0.12