From 7590cfcea9d40e59af8edd7cdd3d11ffbc5aaa04 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Mon, 27 Jun 2011 20:59:36 +0200 Subject: Push the data together with the error in the synchronous case. As it turns out some test cases in QtWebKit rely on this. Task-number: QTBUG-19556 Reviewed-by: mgoetz --- src/network/access/qnetworkaccesshttpbackend.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index 64a22aa..7d49648 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -653,6 +653,7 @@ void QNetworkAccessHttpBackend::postRequest() delegate->isPipeliningUsed, QSharedPointer(), delegate->incomingContentLength); + replyDownloadData(delegate->synchronousDownloadData); httpError(delegate->incomingErrorCode, delegate->incomingErrorDetail); } else { replyDownloadMetaData -- cgit v0.12 From be3bd368485d373e63b3e4ff5c7db2da1d119feb Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 28 Jun 2011 11:21:00 +0200 Subject: Fix invalid read in QUrl::removeAllEncodedQueryItems The remove will detach the string making the query pointer invalid. Note: the "test3" case is commented out because it does not remove the & at the end, and i do not want to enforce this behaviour in the test Task-number: QTBUG-20065 Change-Id: I195c5c3b468f46c797c7c4f8075303f2b1f4724c Reviewed-on: http://codereview.qt.nokia.com/822 Reviewed-by: Qt Sanity Bot Reviewed-by: Peter Hartmann (cherry picked from commit 2dd90a27a82289a5088b929c3bd27c1fd05967f6) Conflicts: tests/auto/qurl/tst_qurl.cpp --- src/corelib/io/qurl.cpp | 1 + tests/auto/qurl/tst_qurl.cpp | 28 +++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 8813656..d551009 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -5466,6 +5466,7 @@ void QUrl::removeAllEncodedQueryItems(const QByteArray &key) if (end < d->query.size()) ++end; // remove additional '%' d->query.remove(pos, end - pos); + query = d->query.constData(); //required if remove detach; } else { pos = end + 1; } diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp index b78679b..2fa193a 100644 --- a/tests/auto/qurl/tst_qurl.cpp +++ b/tests/auto/qurl/tst_qurl.cpp @@ -201,10 +201,9 @@ private slots: void task_240612(); void taskQTBUG_6962(); void taskQTBUG_8701(); + void removeAllEncodedQueryItems_data(); + void removeAllEncodedQueryItems(); -#ifdef QT3_SUPPORT - void dirPath(); -#endif }; // Testing get/set functions @@ -4031,5 +4030,28 @@ void tst_QUrl::effectiveTLDs() QCOMPARE(domain.topLevelDomain(), TLD); } +void tst_QUrl::removeAllEncodedQueryItems_data() +{ + QTest::addColumn("url"); + QTest::addColumn("key"); + QTest::addColumn("result"); + + QTest::newRow("test1") << QUrl::fromEncoded("http://qt.nokia.com/foo?aaa=a&bbb=b&ccc=c") << QByteArray("bbb") << QUrl::fromEncoded("http://qt.nokia.com/foo?aaa=a&ccc=c"); + QTest::newRow("test2") << QUrl::fromEncoded("http://qt.nokia.com/foo?aaa=a&bbb=b&ccc=c") << QByteArray("aaa") << QUrl::fromEncoded("http://qt.nokia.com/foo?bbb=b&ccc=c"); +// QTest::newRow("test3") << QUrl::fromEncoded("http://qt.nokia.com/foo?aaa=a&bbb=b&ccc=c") << QByteArray("ccc") << QUrl::fromEncoded("http://qt.nokia.com/foo?aaa=a&bbb=b"); + QTest::newRow("test4") << QUrl::fromEncoded("http://qt.nokia.com/foo?aaa=a&bbb=b&ccc=c") << QByteArray("b%62b") << QUrl::fromEncoded("http://qt.nokia.com/foo?aaa=a&bbb=b&ccc=c"); + QTest::newRow("test5") << QUrl::fromEncoded("http://qt.nokia.com/foo?aaa=a&b%62b=b&ccc=c") << QByteArray("b%62b") << QUrl::fromEncoded("http://qt.nokia.com/foo?aaa=a&ccc=c"); + QTest::newRow("test6") << QUrl::fromEncoded("http://qt.nokia.com/foo?aaa=a&b%62b=b&ccc=c") << QByteArray("bbb") << QUrl::fromEncoded("http://qt.nokia.com/foo?aaa=a&b%62b=b&ccc=c"); +} + +void tst_QUrl::removeAllEncodedQueryItems() +{ + QFETCH(QUrl, url); + QFETCH(QByteArray, key); + QFETCH(QUrl, result); + url.removeAllEncodedQueryItems(key); + QCOMPARE(url, result); +} + QTEST_MAIN(tst_QUrl) #include "tst_qurl.moc" -- cgit v0.12 From 255c648cf291fa23f64be2c7a74ffdbeb94e84e0 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 30 Jun 2011 14:15:28 +0100 Subject: Symbian: tune network autotest heap size so they can run on emulator Heap sizes were increased during development due to OOM failures, but the tests cannot be launched on emulator because of the address space problem (symbian emulator known issue) As the OOM failures were caused by unlimited buffering in the proxy socket engines (fixed by c4727a85eed57a4db698326a1bed4aa75b6e5284) the tests work on both emulator and hardware with the new buffer size. Task-number: QTBUG-18221 Reviewed-by: Markus Goetz --- tests/auto/qnetworkreply/test/test.pro | 2 +- tests/auto/qtcpsocket/test/test.pro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qnetworkreply/test/test.pro b/tests/auto/qnetworkreply/test/test.pro index d1f6707..5c9bbdd 100644 --- a/tests/auto/qnetworkreply/test/test.pro +++ b/tests/auto/qnetworkreply/test/test.pro @@ -31,6 +31,6 @@ symbian:{ # Symbian toolchain does not support correct include semantics INCLUDEPATH+=..\\..\\..\\..\\include\\QtNetwork\\private # bigfile test case requires more heap - TARGET.EPOCHEAPSIZE="0x100 0x10000000" + TARGET.EPOCHEAPSIZE="0x100 0x1000000" TARGET.CAPABILITY="ALL -TCB" } diff --git a/tests/auto/qtcpsocket/test/test.pro b/tests/auto/qtcpsocket/test/test.pro index 7bf5ba0..404d5c0 100644 --- a/tests/auto/qtcpsocket/test/test.pro +++ b/tests/auto/qtcpsocket/test/test.pro @@ -12,7 +12,7 @@ QT += network vxworks:QT -= gui symbian: { - TARGET.EPOCHEAPSIZE="0x100 0x3000000" + TARGET.EPOCHEAPSIZE="0x100 0x1000000" TARGET.CAPABILITY = NetworkServices ReadUserData } -- cgit v0.12 From acfa2ac5ff4cae931e873c8bdc41277bf99f2c1b Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 30 Jun 2011 14:52:57 +0100 Subject: Symbian socket engine: remove remaining todo comments The writes >16k blocking in the emulator only applies to the winsock connectivity used in S60 SDKs. It doesn't affect the ethernet connectivity used by platform environments. Restarting notifier after error seems like the correct thing to do, and isn't causing any problems. The duplicated code for setting error strings is unfortunate, but a consequence of our decision not to derive from the native socket engine. If symbian ever gets a Qt5 port, we should revisit it there. Task-number: QTBUG-18371 Reviewed-by: Markus Goetz --- src/network/socket/qsymbiansocketengine.cpp | 6 +++--- src/network/socket/qsymbiansocketengine_p.h | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/network/socket/qsymbiansocketengine.cpp b/src/network/socket/qsymbiansocketengine.cpp index edd5d6e..0aa5a5a 100644 --- a/src/network/socket/qsymbiansocketengine.cpp +++ b/src/network/socket/qsymbiansocketengine.cpp @@ -1037,7 +1037,7 @@ qint64 QSymbianSocketEngine::write(const char *data, qint64 len) TSockXfrLength sentBytes = 0; TRequestStatus status; d->nativeSocket.Send(buffer, 0, status, sentBytes); - User::WaitForRequest(status); //TODO: on emulator this blocks for write >16kB (non blocking IO not implemented properly?) + User::WaitForRequest(status); TInt err = status.Int(); if (err) { @@ -1204,7 +1204,7 @@ int QSymbianSocketEnginePrivate::nativeSelect(int timeout, bool checkRead, bool const_cast(this)->setError(err); //restart asynchronous notifier (only one IOCTL allowed at a time) if (asyncSelect) - asyncSelect->IssueRequest(); //TODO: in error case should we restart or not? + asyncSelect->IssueRequest(); return err; } if (checkRead && (selectFlags() & KSockSelectRead)) { @@ -1324,7 +1324,7 @@ bool QSymbianSocketEnginePrivate::checkProxy(const QHostAddress &address) return true; } -// FIXME this is also in QNativeSocketEngine, unify it +// ### this is also in QNativeSocketEngine, unify it /*! \internal Sets the error and error string if not set already. The only diff --git a/src/network/socket/qsymbiansocketengine_p.h b/src/network/socket/qsymbiansocketengine_p.h index 3b39096..aad6228 100644 --- a/src/network/socket/qsymbiansocketengine_p.h +++ b/src/network/socket/qsymbiansocketengine_p.h @@ -195,7 +195,6 @@ public: mutable QByteArray receivedDataBuffer; mutable bool hasReceivedBufferedDatagram; - // FIXME this is duplicated from qnativesocketengine_p.h enum ErrorString { NonBlockingInitFailedErrorString, BroadcastingInitFailedErrorString, -- cgit v0.12 From d795e50a2bf89209b124ec29fe7dd883208224ea Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 30 Jun 2011 17:18:33 +0100 Subject: Update 4.8.0 changes file --- dist/changes-4.8.0 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.8.0 b/dist/changes-4.8.0 index da3a00a..be67901 100644 --- a/dist/changes-4.8.0 +++ b/dist/changes-4.8.0 @@ -54,6 +54,8 @@ QtCore - qSwap now uses std::swap, specialized std::swap for our container to work better with stl algoritms - QVariant: deprecated global function qVariantSetValue, qVariantValue, qVariantCanConvert, qVariantFromValue - QUrl: add method for retrieving effective top level domain [QTBUG-13601] (MR-1205) + - optimised performance of QFileInfo, QDir, QDirIterator, these classes now share metadata and access the filesystem less + - QFile: new open() overloads allow control over whether QFile should close an adopted file handle or not QtGui ----- @@ -77,7 +79,7 @@ QtNetwork - HTTP API: add support for HTTP multipart messages [QTBUG-6222] - HTTP cache: do not load resources from cache that must be revalidated [QTBUG-18983] - HTTP cache: change file organization (MR-2505) - + - SOCKS5: write errors are propagated to the outer socket [QTBUG-18713] QtOpenGL -------- @@ -118,6 +120,18 @@ Qt for Embedded Linux - Added support for QNX 6.5 with multi-process support, and much improved mouse, keyboard and screen drivers. +Qt for Symbian +-------------- + - File APIs now have backends using native API rather than unix. + This improves performance and stability. + - Socket APIs now have a backend using native API rather than unix. [QTBUG-7274] + This improves stability and enables IPv6. + - IPv6 connectivity is now supported. + - Multiple instances of QNetworkAccessManager in the same process with a + different QNetworkConfiguration now work. This allows http requests to + be made via a specific network. For example to mobile operator websites + only accessible via the cellular network, or to websites inside a firewall + - System proxy settings now work correctly when using service networks [QTBUG-18618] Qt for Windows CE ----------------- -- cgit v0.12