summaryrefslogtreecommitdiffstats
path: root/tests/auto/network
Commit message (Collapse)AuthorAgeFilesLines
* QSSLSocket::readData return -1 when socket is not connectedAlbert Astals Cid2017-06-081-0/+7
| | | | | | | | | | As QAbstractSocket::readData does and as the documentation of QIODevice says "this function returns -1 in those cases (that is, reading on a closed socket..." Change-Id: I1e64673f6a6d792a640bd6cb28b2bb5a0f18dc36 Reviewed-by: Aleix Pol Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-071-0/+8
|\ | | | | | | | | | | | | Conflicts: src/widgets/widgets/qmenu.cpp Change-Id: I6d3baf56eb24501cddb129a3cb6b958ccc25a308
| * tst_qudpsocket: Blacklist "utun" interfaces on DarwinThiago Macieira2017-05-291-0/+8
| | | | | | | | | | | | | | | | | | | | Packets sent to to link-local addresses on it are never received. We don't know why this happens, as the tooling provided by Apple for development is close to useless. So we just ignore this interface. Task-number: QTBUG-61041 Change-Id: Ia608df1fff6bdee5238e107d8a50292a1f9e5c03 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* | Add QLocalServer::socketDescriptorJesus Fernandez2017-06-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Adds a function to return the native socket descriptor. It allows threaded or forked applications to reuse a previously created socket. [ChangeLog][QtNetwork][QLocalServer] Added a function to retrieve the socket descriptor. Task-number: QTBUG-55043 Change-Id: I556e97000d2c02ad2bdd636984de6c7564381c6a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add swap and move operator to QHostInfoJesus Fernandez2017-05-161-0/+25
| | | | | | | | | | | | | | | | | | | | Also mark as shared-come-qt6, [ChangeLog][QtNetwork][QHostInfo] Added swap() and move operator. Change-Id: I8f422868f0487a37aeba3bc74685dc4912e9b3a4 Coverity-Id: 168204 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-05-076-20/+87
|\| | | | | | | | | | | | | | | Conflicts: src/network/access/qnetworkreply.cpp tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp Change-Id: Iadf766269454087e69fb216fc3857d85b0ddfaad
| * QWindowsPipeReader: fix possible invalid invocation of ReadFileEx()Alex Trotsenko2017-05-021-0/+12
| | | | | | | | | | | | | | | | | | | | | | If the user calls QLocalSocket::setReadBufferSize() with a value less than the current size of the pipe buffer, startAsyncRead() would call ReadFileEx() with invalid parameters: ReadFileEx(handle, nullptr, some_big_value, ...); Change-Id: I3d153e3ec34f8038dc001c1c896aeceb666a8979 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Revert "Blacklist tst_QSslSocket::protocolServerSide on OS X 10.11"Timur Pocheptsov2017-04-271-2/+0
| | | | | | | | | | | | | | | | | | This reverts commit 96c27f0dfa72f7800c85af10c00e0dababdc3fbf. We now use a custom keychain that should fix the original problem with the test. Change-Id: I52e4105f34a46ad7080750d9a62480ebe3a56e68 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * Revert "tst_qsslsocket::protocolServeSide - fix for macOS 10.11"Timur Pocheptsov2017-04-261-16/+2
| | | | | | | | | | | | | | | | The fix is outdated - the tests it was fixing - pass on 10.11. Change-Id: I8b42c1d3d2f1279382b15c20587dcc93cf1b6b40 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * Fix tests that assume system files are owned by root for qemuSami Nurmenniemi2017-04-262-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If QEMU is provided sysroot with QEMU_LD_PREFIX, it opens files from there. If their owner is the current user, testing their access rights based on assumption that they are root fails. Skip the tests in that case similarly as is already done when the tests are run as root. This fixes following tests: - tst_QTemporaryDir::nonWritableCurrentDir - tst_QNetworkReply::getErrors(file-permissions) - tst_qstandardpaths::testCustomRuntimeDirectory Task-number: QTBUG-59966 Change-Id: I972ce37b4b5a7747cdd732a8e4a737ef09cbc6a5 Reviewed-by: Teemu Holappa <teemu.holappa@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Fix tst_QTcpServer for QEMUSami Nurmenniemi2017-04-201-0/+53
| | | | | | | | | | | | | | | | | | QEMU does not support all syscalls needed for tcp socket testing. Skipped tests that can't pass on QEMU. Task-number: QTBUG-59966 Change-Id: Ib6d12d0fc4c913a0222e13db57f0864b7fdf21ba Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-072-0/+5
|\| | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/linux-icc/qmake.conf mkspecs/macx-icc/qmake.conf mkspecs/win32-icc/qmake.conf src/gui/painting/qgrayraster.c Change-Id: Ib08c45ea3215be05f986ecb3e1f4b37d209aa775
| * Fix network tests on qemu/armSami Nurmenniemi2017-04-062-0/+5
| | | | | | | | | | | | | | | | Function if_indextoname fails on qemu because SIOCGIFNAME is not supported. Expect failure if emulation is detected. Change-Id: I53b41286d82458661e7fa723af385f323582ce7e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-044-3/+110
|\| | | | | | | | | | | | | | | Conflicts: src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h src/plugins/platforms/xcb/qxcbwindow.cpp Change-Id: Ic747c3c50e68c005b425e7a1ec2a90965527c8bd
| * tst_qsslsocket::protocolServeSide - fix for macOS 10.11Timur Pocheptsov2017-03-301-2/+16
| | | | | | | | | | | | | | | | | | | | Mixing different protocols on client-server sockets works differently on 10.11, making previously successful handshakes failing now. Failure is specific to 10.11 with SecureTransport. Change-Id: I35374b40fa3d167802775b526cf6465ae78749cf Task-number: QTBUG-48860 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * Blacklist tst_QSslSocket::protocolServerSide on OS X 10.11Tony Sarajärvi2017-03-301-0/+2
| | | | | | | | | | | | Task-number: QTBUG-48860 Change-Id: Ia352378f48b9ab404d06ac5ef9bf53afa8f192fd Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * Fix tst_QUdpSocket for QEMUSami Nurmenniemi2017-03-291-0/+84
| | | | | | | | | | | | | | | | QEMU does not support all syscalls needed for udp socket testing. Skipped tests that can't pass on QEMU. Change-Id: I40882207a47cfafbc3becb3dff8e7cead9676255 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Use HTTP2WasUsedAttribute for HTTP2Timur Pocheptsov2017-03-291-1/+8
| | | | | | | | | | | | | | | | | | | | | | Previously we were always setting SpdyWasUsedAttribute for SPDY/HTTP/2/HTTP/1.1 (true/false) which is confusing. Now if HTTP2AllowedAttribute was set to true on a request, we set HTTP2WasUsedAttribute. Otherwise, as we did before, we're setting SpdyWasUsedAttribute. Change-Id: I0c44cfb5469fef0c12719baa951197ee2accee4a Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-282-0/+37
|\| | | | | | | | | | | | | | | | | Conflicts: examples/examples.pro tests/auto/corelib/tools/qchar/tst_qchar.cpp tests/auto/other/qaccessibility/accessiblewidgets.h Change-Id: I426696c40ab57d14dc295b8103152cede79f244c
| * Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-272-0/+37
| |\ | | | | | | | | | Change-Id: Icdd71e9713725bda9c305e338f5c8b41a92ed8e8
| | * QSslSocket: fix connection to a international domain nameOlivier Goffart2017-03-232-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC6125 section 6.4.2 specify we need to convert the IDN to ascii before comparison. Note that we don't need to toLower anymore because toAce takes care of it. Section 7.2 recommands that we dod not attempt to check for wildcard character embedded within the A-labels or U-labels of an internationalized domain name. So we reject names that contiains a '*' but starts with 'xn--'. Change-Id: Ib0830520a1f82bbf9fd11818718277a479527ee3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-208-15/+18
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qfilesystemengine_win.cpp src/gui/text/qdistancefield.cpp src/plugins/platforms/xcb/qxcbconnection.h Change-Id: I1be4a6f440ccb7599991159e3cb9de60990e4b1e
| * | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-137-14/+17
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network.pro mkspecs/features/mac/default_post.prf src/corelib/io/qfilesystemengine_win.cpp src/corelib/io/qprocess.cpp src/corelib/io/qprocess.h src/corelib/io/qprocess_p.h src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/corelib/thread/qmutex.cpp src/platformsupport/fontdatabases/windows/windows.pri src/plugins/platforms/eglfs/eglfsdeviceintegration.pro tests/auto/corelib/io/io.pro Change-Id: I8a27e0e141454818bba9c433200a4e84a88d147e
| | * Use QT_CONFIG(library) instead of QT_NO_LIBRARYUlf Hermann2017-03-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the windows file system engine, we add an extra macro to use library loading if configured to do so, but avoid it on WinRT, as none of the symbols would be found. We also QT_REQUIRE_CONFIG(library) in the library headers and exclude the sources from the build if library loading is disabled. This, in turn, makes it necessary to clean up some header inclusions. Change-Id: I2b152cb5b47a2658996b6f4702b038536a5704ec Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | * Properly use the "process" featureUlf Hermann2017-02-276-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace all QT_NO_PROCESS with QT_CONFIG(process), define it in qconfig-bootstrapped.h, add QT_REQUIRE_CONFIG(process) to the qprocess headers, exclude the sources from compilation when switched off, guard header inclusions in places where compilation without QProcess seems supported, drop some unused includes, and fix some tests that were apparently designed to work with QT_NO_PROCESS but failed to. Change-Id: Ieceea2504dea6fdf43b81c7c6b65c547b01b9714 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * | Deprecate QString::nullMarc Mutz2017-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a Qt 3 compatibility vehicle, and as such inherits the now-alien property to distinguish empty and null strings. Particularly worrisome is the following asymmetry: QString("") == QString::null // false QString("") == QString(QString::null) // true Instead of fixing this behavior, recognize that people might use it as a weird way to call isNull(), albeit one that once was idiomatic, and simply deprecate everything that deals with QString::null. [ChangeLog][QtCore][QString] QString::null is now deprecated. When used to construct a QString, use QString() instead. When used to compare to a QString, replace with QString::isNull(). Change-Id: I9f7e84a92522c75666da15f49324c500ae93af42 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
* | | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-025-76/+54
|\| | | | | | | | | | | Change-Id: I84097f8e7b3b2128028bd7693c913d6968b82bfe
| * | Network: Use canonical license headersKai Koehne2017-02-283-35/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replace outdated LGPL21 with LGPL license header. Use GPL-EXCEPT for all autotests. Also use canonical contact url. Change-Id: I6e5cc8a4285569c4f862730a980f492b8a933a72 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
| * | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-241-6/+0
| |\| | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/moc.prf Change-Id: Ia71c8e3b3185f7c999bf226d0675051b10b8740b
| | * use regular configure mechanism for openssl library referencesOswald Buddenhagen2017-02-221-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | don't attempt to hand-craft a library export any more. instead, use the configure system's built-in mechanism, and refer to it via QMAKE_USE. this also allows us to rely on transitive dependencies in the autotest. as a side effect, this makes the openssl-linked feature imply the openssl one. Change-Id: I5dd209b63bc8fbbc62852f6ffc472d4452ea2e68 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | QNAM - rename Redirect*s*Nnn to RedirectNnnTimur Pocheptsov2017-02-231-35/+35
| | | | | | | | | | | | | | | | | | | | | As discussed in API code-review. Change-Id: Ib54cfd43d5bef8c7d99a7fb3b09a9d16dc1dc1dc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-02-171-1/+3
|\| | | | | | | | | | | | | | | | | | | | Conflicts: qmake/Makefile.unix Change-Id: Ia18e391198222eef34ffa2df6f683e052058d032
| * | Fix http2 auto-testTimur Pocheptsov2017-02-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After it started to fail (somehow it's only OpenSUSE 42.1) again and again and after a quick re-evaluation it appears the logic testing SETTINGS|ACK is incorrect. We (client side) start by sending the preface and then continue to send our request(s). The other side (server) starts from sending its SETTINGS frame. These settings must be ACKed, but apparently it can happen, that server receives a requests and sends a reply before it receives SETTINGS|ACK, resulting in replyFinished (replyFinishedWithError) signal and event loop stopping. As a result - QVERIFY(serverGotSettingsACK) fails. Task-number: QTBUG-58758 Change-Id: I8184cf459b2b88f70c646171e0115c184237fad1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | qsslsocket_mac: handle 'OrLater' SslProtocols in verifySessionProtocol()Mikkel Krautz2017-02-131-1/+45
|/ / | | | | | | | | | | | | | | | | | | | | | | The verifySessionProtocol() method in the SecureTransport backend did not properly handle TlsV1_0OrLater, TlsV1_1OrLater and TlsV1_2OrLater. This commit teaches verifySessionProtocol() about them. It also adds TlsV1_0OrLater, TlsV1_1OrLater and TlsV1_2OrLater to the protocolServerSide() test in tst_qsslsocket. Change-Id: I394766c75dbea4d89bf3d6b9c3f3c89530ac0749 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | QHostAddress: add missing op!=(SpecialAddress, QHostAddress)Marc Mutz2017-01-261-0/+1
| | | | | | | | | | | | | | | | | | The equality operator was supplied, but this one was missing. [ChangeLog][QtNetwork][QHostAddress] Added op!=(SpecialAddress, QHostAddress). Change-Id: Iad9c55fa0ee7a8e97d5e4ea4be0605b8b74649d1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge "Merge remote-tracking branch 'origin/5.8' into dev" into refs/staging/devLiang Qi2017-01-266-98/+98
|\ \
| * | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-256-98/+98
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/common/msvc-desktop.conf mkspecs/common/msvc-version.conf mkspecs/common/winrt_winphone/qmake.conf mkspecs/features/mac/default_post.prf mkspecs/features/mac/sdk.prf mkspecs/features/qt.prf mkspecs/features/uikit/default_post.prf mkspecs/features/winrt/default_pre.prf mkspecs/winphone-arm-msvc2013/qmake.conf mkspecs/winphone-x86-msvc2013/qmake.conf mkspecs/winrt-arm-msvc2013/qmake.conf mkspecs/winrt-x64-msvc2013/qmake.conf mkspecs/winrt-x86-msvc2013/qmake.conf qmake/generators/win32/msvc_vcproj.cpp src/gui/kernel/qwindowsysteminterface.cpp src/network/kernel/qhostaddress.cpp src/plugins/platforms/mirclient/qmirclientplugin.cpp src/plugins/platforms/mirclient/qmirclientplugin.h src/widgets/util/qsystemtrayicon.cpp tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp tools/configure/Makefile.mingw tools/configure/Makefile.win32 Done-with: Jake Petroules <jake.petroules@qt.io> Done-with: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Change-Id: I4be3262d3994e11929d3b1ded2c3379783797dbe
| | * tst_QSocks5SocketEngine: Refactor testsFriedemann Kleint2017-01-231-88/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite tcpSocketNonBlockingTest() and downloadBigFile() to use lambdas for the slots. This allows for removing the related member variables and slots of the test class and ensures no leaks of sockets or inconsistent values. Add an error handler printing the error message to the flaky downloadBigFile() test. Change-Id: Ieb64063c41e045a1a50a6d074bef01753ee319ef Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | * QSslDiffieHellmanParameters: simplify defaultParameters() constructionMikkel Krautz2017-01-181-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit simplifies defaultParameters() to simply construct an empty QSslDiffieHellmanParameters and assigning the DER-form of the DH parameters to QSslDiffieHellmanParametersPrivate's derData field. This creates a valid QSslDiffieHellmanParameters instance, but skips any potentially expensive verification steps. The previous implementation of defaultParameters() would use the public fromEncoded() method to construct an instance of the default parameters. This triggers a verification of the passed-in data, which can be expensive. To ensure our defaultParameters() QSslDiffieHellmanParameters instance does pass verification, this commit adds an autotest to verify that. Fixes QTBUG-57815. Change-Id: I6b1d9dbbfde526b232c319195ddbad42326be27c Task-number: QTBUG-57815 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | * QHostAddress: add missing docsMarc Mutz2017-01-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qHash(QHostAddress) was added in Qt 5.0 (at least the version with uint seed = 0). op==(QHostAddress::SpecialAddress, QHostAddress) was there since QHostAddress was added before public history. Since QHostAddress does not have a \since, the I did not supply one for op==, either. Since the equality operator did not have unit-tests, added one. Change-Id: I954a0df02464338f08a12ca58d4cc0ceb013e67a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Improve reliability of network bearer testsSimon Hausmann2017-01-023-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | May of the tests initiate a scan / update of the network configuration and expect the API to deliver exactly one update. This turns out to be a race condition as the update may be emitted multiple times, as QNetworkConfigurationManagerPrivate::updateConfigurations() is called via posted events (queued signal emissions) from the bearer thread, and so after creating the spy we may receive an update from _before_ and end up emitting the signal multiple times. Task-number: QTQAINFRA-1040 Change-Id: I931e2907f0cb86d48b4ab1a8795d75206035ea11 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add QHostInfo::lookupHost overload with modern connect syntaxJesus Fernandez2017-01-241-0/+72
|/ / | | | | | | | | | | Task-number: QTBUG-56424 Change-Id: I49053ac2859e6c6c07e4a704b8b5f0d6a2d0b8a4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Add HTTP strict tranport security support to QNAMTimur Pocheptsov2017-01-203-2/+328
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HTTP Strict Transport Security (HSTS) is a web security policy that allows a web server to declare that user agents should only interact with it using secure HTTPS connections. HSTS is described by RFC6797. This patch introduces a new API in Network Access Manager to enable this policy or disable it (default - STS is disabled). We also implement QHstsCache which caches known HTTS hosts, does host name lookup and domain name matching; QHstsHeaderParser to parse HSTS headers with HSTS policies. A new autotest added to test the caching, host name matching and headers parsing. [ChangeLog][QtNetwork] Added HTTP Strict Transport Security to QNAM Task-number: QTPM-238 Change-Id: Iabb5920344bf204a0d3036284f0d60675c29315c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Add a user-controlled auto-redirect policyTimur Pocheptsov2017-01-191-6/+59
| | | | | | | | | | | | | | | | | | | | | | | | With this new policy, after emitting 'redirected', QNetworkReplyHttpImpl waits for client code to decide if QNAM should follow this redirect or not. The client can either allow this redirect by emitting 'redirectAllowed' or abort the reply. Task-number: QTPM-236 Change-Id: Ia04619f6bd1f0caa477833ae859b24033027b2e1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Add redirects policy to QNetworkAccessManagerTimur Pocheptsov2017-01-171-0/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes it possible to enable/disable redirects on QNAM level (before it was per-request only). This policy would be applied to all subsequent requests* created by QNAM. The policies we support at the moment: a. Manual - that's what we always had - it's up to a user to handle redirects. b. NoLessSafeRedirectsPolicy - we allow http->http, http->https and https->https redirects, but no protocol 'downgrade' (no https->http redirects). c. SameOriginPolicy - we check that protocol/host/port are the same. Updated tst_qnetworkreply. *We previously were enabling redirect for each request, by setting FollowRedirectsAttribute on QNetworkRequest object. For backward compatibility this attribute has a higher priority (if set) than QNAM's policy (and it will work as NoLessSafeRedirectsPolicy). [ChangeLog][QtNetwork] Added redirects policy to QNAM Task-number: QTPM-239 Task-number: QTPM-237 Change-Id: I493d1728254b71b61b5504937e8e01dca5953527 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Introduce QNetworkAccessManager::clearConnectionCache()Sebastian Lösch2017-01-161-1/+2
| | | | | | | | | | | | | | | | | | Sometimes it is desirable to use a new connection but keep already entered user credentials for usability reasons. This is now possible by clearing the connection cache (but keeping the authentication cache). Change-Id: I2f5f64836ce19f81c8525701783a3da823dd468e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | HTTP/2 - fix handling of GOAWAY frameTimur Pocheptsov2017-01-113-12/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix the case when we erroneously handled stream ID == 0 in a GOAWAY frame as an invalid stream ID. - _q_receivedReply: convert do{}while() loop into to while(){} to prevent it from handling any frames after GOAWAY frame received and all active frame finished. - sendRequest - if we received GOAWAY, also clear spdyRequests in the connection channel, otherwise it keeps re-trying to send requests! - Http network connection channel never resets a protocolHandler in _q_encrypted/ _q_connected, which is BAD for HTTP/2, since HTTP/2 has unique per-connection compression context and must be reset - now we recreate the protocol handler in _q_encrypted or _q_connected (https/http). - Update autotest. Task-number: QTBUG-57600 Change-Id: Ib864ce52287bab23334ff43a83ba4b0b7cb52c60 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | tst_qnetworkreply - remove redundant semicolonTimur Pocheptsov2016-12-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | ... after a member-function declaration: this would be a compilation error anywhere outside of a class-definition, allowed as 'opt' inside a class-definition and essentially not needed at all (and is already different from other member-functions we have in the same code). Change-Id: Ia689a41bf2a1052cd19eb8fb4766ed9635c20c88 Reviewed-by: Jesus Fernandez <jesus.fernandez@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-161-25/+38
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure configure.pri examples/widgets/painting/fontsampler/mainwindow.cpp examples/widgets/painting/fontsampler/mainwindow.h mkspecs/features/moc.prf src/corelib/global/qglobal.h src/gui/text/qtextdocument.cpp Change-Id: Ica65512e00871695190a14ccea5c275b0165f787
| * Merge remote-tracking branch 'origin/5.8.0' into 5.8Liang Qi2016-12-161-25/+38
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/global/qt-cpp-defines.qdocconf src/plugins/platforms/android/qandroidplatformopenglcontext.h src/plugins/platforms/android/qandroidplatformtheme.h Change-Id: I13d51cc66f708138ff4d667ceea7d515992e58a4