Commit Graph

871 Commits

Author SHA1 Message Date
Liang Qi
9bee6712fc Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I840849c072075a69819eb185b20bc42c3de0f825
2018-01-09 21:27:30 +01:00
Ryan Chu
a5ad605dfe QFtp: only use fall-back password for anonymous access
The code used to fall back to anonymous login independently for username
and password; however, it should only use a fall-back password if the
username is missing or (case-insensitive) "anonymous".  When a
non-anonymous username is given without password, we should simply skip
he PASS message to FTP.

If the FTP server requests a password, in the latter case, QFtp will
signal authenticationRequired; in all cases, if the server rejects the
given credentials, QFtp signals authenticationFailed.  Either way, the
client code can then query the user for credentials as usual.

Task-number: QTBUG-25033
Change-Id: I2a4a3b2725819ab19c8a7e4baa431af539edcd8d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-09 13:31:55 +00:00
Liang Qi
24fba6744c Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp

Change-Id: Ib6dd965a7eb6f59103e276b3407739147ecd37b2
2018-01-07 14:47:19 +01:00
Timur Pocheptsov
4a11243d3c tst_QUdpSocket - unblacklist tests on Ubuntu 16.04
We use QSKIP instead for kernel versions [4.6, 4.13).

Task-number: QTBUG-65440
Change-Id: Ie764b5a4eb8a67dc2a43d4dc67b5d6eb772f6b2a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joni Jäntti <joni.jantti@qt.io>
2018-01-05 03:59:13 +00:00
Lars Knoll
db92f2f3aa Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	.qmake.conf
	mkspecs/win32-g++/qmake.conf
	src/corelib/global/qglobal_p.h
	src/corelib/global/qoperatingsystemversion_p.h
	src/corelib/io/qfilesystemengine_win.cpp
	src/network/bearer/qbearerengine.cpp
	src/platformsupport/input/libinput/qlibinputpointer.cpp
	src/sql/doc/snippets/code/doc_src_sql-driver.cpp
	src/widgets/kernel/qwidget_p.h
	src/widgets/kernel/qwidgetwindow.cpp
	src/widgets/styles/qfusionstyle.cpp
	tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp

Change-Id: I80e2722f481b12fff5d967c28f89208c0e9a1dd8
2017-12-30 12:09:53 +01:00
Thiago Macieira
dd61a1d98e tst_QUdpSocket: add some tests for link-local IPv6 multicasting
Unlike higher scopes (like scope 4, admin-local, which the last commit
used), scopes 1 and 2 require a scope in order to bind, even if some
operating systems are lenient. So test that we are able to bind to them
and do bind properly.

Change-Id: Ifb5969bf206e4cd7b14efffd14fba153eab965b9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-12-29 00:11:00 +00:00
Thiago Macieira
198c59dbce tst_QUdpSocket: always use an interface when binding to IPv6
Binding without an interface and expecting the OS to select something is
not supported in all OSes. On FreeBSD, I keep getting EADDRNOTAVAIL. So
modify our test to only join, leave and send to multicast groups with an
interface selection.

With this, all tests either pass or are skipped for me on Linux,
FreeBSD, and macOS. On Windows, this revealed an inconsistency in
behavior, which this commit adds a workaround for.

Change-Id: Ifb5969bf206e4cd7b14efffd14fb6815456494d2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-12-29 00:10:54 +00:00
Joni Jantti
e548406d28 Blacklist tst_QUdpSocket on Ubuntu 16.04
tst_QUdpSocket::broadcasting and tst_QUdpSocket::pendingDatagramSize
fail on the new Ubuntu 16.04 clean template.

Task-number: QTBUG-65440
Change-Id: I0e973b9c90b7c5827406bac8138370b61992a115
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2017-12-27 14:41:26 +00:00
Thiago Macieira
c4f397ee11 tst_QUdpSocket: Don't use interface-local IPv6 multicast
The FreeBSD kernel treats them specially, just like link-local (that's
probably why it calls them "interface-local" instead of "node-local").

So instead let's use a random address, which will avoid multiple
tst_qudpsocket, when run on the same network at the same time,
receiving each other's datagrams. It could happen, considering this test
has an 800-second timeout limit.

Change-Id: Ifb5969bf206e4cd7b14efffd14fb592a3166547e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2017-12-24 17:14:19 +00:00
Thiago Macieira
bbcd453388 tst_QUdpSocket: stop trying to bind to multicast addresses
This is not an official feature of the networking stacks and does not
work portably across operating systems. So just stop trying to do that.

This was failing reliably (not flaky!) with IPv6 on FreeBSD and
Windows. For IPv4, Windows apparently accepts 239.255.0.0/16 but not
other addresses, so remove IPv4 too.

Change-Id: Ifb5969bf206e4cd7b14efffd14fb682c2839e95d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2017-12-24 02:04:44 +00:00
Thiago Macieira
1853aeb50a tst_QUdpSocket: remove Bearer portions of the test
Test fails to start on FreeBSD:

FAIL!  : tst_QUdpSocket::initTestCase() 'networkSession->waitForOpened(30000)' returned FALSE. ()
   Loc: [/usr/home/tjmaciei/src/qt/qt5/qtbase/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp(234)]

This commit is basically a revert of the Qt 4.8 commit
a951fb79139498774d021759d0466b4b2ff50e68. FORCE_SESSION was only used by
manual testing, as the commit message said

> 8. For manual testing, added the FORCE_SESSION macro to test behaviour
>   of UDP sockets when they have an explicit network session associated

So I doubt it has been tested recently.

Change-Id: Ifb5969bf206e4cd7b14efffd14fb569ebf53497b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-12-05 21:59:35 +00:00
Thiago Macieira
81a88639ac tst_QUdpSocket: fix linkLocalIPv4 test
I broke it in commit 4da2dda2aa. It wasn't
flaky or anything: it was plain broken and would never pass. That
indicates no node in the CI has an IPv4 link-local address (and
apparently neither did I at the time).

Change-Id: Ifb5969bf206e4cd7b14efffd14fb62176546916e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2017-12-05 15:33:12 +00:00
Thiago Macieira
637e8ebcc3 tst_QUdpSocket: Don't test for .bytesAvailable on untrusted platforms
FreeBSD, for example, does not have SO_NREAD and its FIONREAD returns
the full socket buffer size, including IP and UDP headers.

Change-Id: Ifb5969bf206e4cd7b14efffd14fb5d8ca778d16a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2017-12-05 15:32:29 +00:00
Liang Qi
53b141dceb Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/plugins/platforms/ios/quiview.mm

Change-Id: I88384c70047391c75d9ff166c8d9881ff6751dbf
2017-12-05 13:37:21 +01:00
Friedemann Kleint
bc9941db42 tst_QNetworkReply: Blacklist putToFtpWithInvalidCredentials for Windows
Task-number: QTBUG-62860
Change-Id: Ibf4d7de9eedc2236375ad10ca4bea08055c7ae00
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-11-29 13:55:35 +00:00
Liang Qi
1139be7b30 Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: Iede384644c3df5ee01b701806dfdb586dd6bb138
2017-11-28 11:23:35 +01:00
Thiago Macieira
5f66f87181 Stop depending on test.macieira.org
We have had test.qt-project.org for close to 3 years now.

Change-Id: I71488efd29b645f7b228fffd14fadf4627288243
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-11-27 21:48:20 +00:00
Mårten Nordheim
5a235da270 tst_QTcpSocket: fix disconnectWhileLookingUp
... and unblacklist it on Windows.

From what I can tell there is no particular reason why this test fails
other than that it is a little too slow sometimes (these things happen).

So, to fix the test I bumped the timeout, but to avoid the test running
for longer on every test-run it now also ends when the socket enters
the "Unconnected" state.

Previously it failed 171/500 times, and after this patch it failed
0/1000 times.

Change-Id: I4266bff6b91aaaf502ee66265d01c3a177706402
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2017-11-24 04:54:58 +00:00
Liang Qi
7c4b0aa970 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/corelib/io/qstandardpaths_win.cpp
	src/plugins/platforms/ios/qioswindow.mm
	src/plugins/platforms/ios/quiview.mm
	tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp

Change-Id: I5deb0a0176a454a9c566e924d074ba60ce04f0bc
2017-11-23 12:52:18 +01:00
Mårten Nordheim
c3a5c482ef Fix tst_QSslSocket::waitForConnectedEncryptedReadyRead
... and unblacklist it.

It was blacklisted some years ago because it was failing too often.
It was failing because the ssl socket had already received and decrypted
all the data it was going to get, meaning the waitForReadyRead call was
just going to block forever.

Change-Id: Ia540735177d4e1be8696f2d752f1d7813faecfe5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-11-22 13:50:09 +00:00
Timur Pocheptsov
0f3c9782e6 tst_QNetworkReply::ioHttpRedirectErrors - fix a flaky test
This test became a real pain recently. A close look at the test shows
several problems (strangely enough, the failure can never be
reproduced on real machines, only on VM - Ubuntu and RHEL 6.6).
There are several asserts that are firing from time to time here and
there. They show that the logic in test is broken/incorrect. QNAM can
open several connections to a host, our test then incorrectly resets
its 'client' data-member and bad things can later happen after
'bytesWrittenSlot' executed (and deleted a socket). For example,
I can reproduce this scenario in every second run:

1. incoming connection -> client = socket(descriptor), connect to
   client's readyRead (s1)
2. incoming connection -> client = socket(descriptor), connect to
   client's readyRead (s2)
QNAM sends a request on s1. We reply on s2 (which is already wrong)
and call client->deleteLater(), which resets client to nullptr.
If QNAM sends something else on s1, we hit assert(!client.isNull()).

To avoid this, whenever 'sender' in any slot is different from the
'client', we use the actual 'sender' to reply. Another problem is this
weird and rather cryptic waitForFinish which is not needed in this
particular test since we wait for reply error, not 'finished'.

As it happened before - it's not clear if these two problems
were the cause of guaranteed fails on CI - an integration failed
~10 times in a row in the same test (not happening anymore though).

Task-number: QTBUG-64569
Change-Id: Id9aa091290350c61fadf1c3c001e7c2e1b5ac8f4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2017-11-22 13:47:30 +00:00
Liang Qi
c4885b21d6 Merge remote-tracking branch 'origin/5.9' into 5.10
Also blacklist tst_QNetworkReply::ioHttpRedirectErrors(too-many-redirects)
on RHEL 6.6 in CI.

 Conflicts:
	tests/auto/network/access/qnetworkreply/BLACKLIST
	tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp

Task-number: QTBUG-64569
Change-Id: I7514fc0660c18fd3a3e1d0d0af3f15d879e3c6f4
2017-11-17 08:59:14 +01:00
Friedemann Kleint
f6c9f03128 tst_QNetworkReply: Blacklist putToFtp for Windows
Task-number: QTBUG-62860
Change-Id: I9cea1414ae3761284f5ac9fab9d0db03c239b65f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-11-15 21:39:54 +00:00
Mikkel Krautz
55f8d7dfe5 qsslsocket_mac: handle 'OrLater' SslProtocols in verifySessionProtocol()
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.

Backport from 5.10 to 5.9 (LTS).

Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 9c765522d1)
Change-Id: I58c53bdf43e0f19b4506f3696d793f657eb4dc6f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-11-15 21:06:49 +00:00
Liang Qi
ecc4754cab Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I2f8f6b1d196548087219739faa3ad1517626da1e
2017-11-15 09:08:46 +01:00
Timur Pocheptsov
66bace390b tst_qnetworkreply::getFromUnreachableIp - fix win64 also
Looking at the failures in grafana it appears this test is also failing
on Windows 64. The same fix applies then, and we use Q_OS_WIN now.

Change-Id: Iafcfd6d1e747f3c816878cad072fbfae3aee19ca
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-11-15 04:50:18 +00:00
Liang Qi
88cf044580 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/gui/kernel/qwindow.cpp
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
	tests/auto/widgets/kernel/qaction/tst_qaction.cpp

Change-Id: Ifa515dc0ece7eb1471b00c1214149629a7e6a233
2017-11-09 11:47:57 +01:00
Timur Pocheptsov
39355daa40 tst_QNetworkReply::getFromUnreachableIp - fix a failing test
This patch works around Windows X86 on QEMU antics.

It appears on this platform the test behaves in some unpredictable manner:
- WSAConnect with 255.255.255.255 does not always immediately fail with
  some error, so socket engine waits for a connection timeout (30 s.),
  but the test itself
- only waits for 5 seconds and then tests that a request has finished with
  error, which is not true (we are still connecting).

To make it work - whenever we have bearermanager feature enabled, set
a connection timeout to something reasonable, not 30 s.
Since we try to connect to each address twice, make timeout 1.5 s
(so it's 3 s. in total and still is < 5 s.).

Task-number: QTBUG-64264
Change-Id: I1d40c140667fca8402ec9344e66d313b6df54256
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-11-08 13:28:51 +00:00
Thiago Macieira
19b0ce5daa Change almost all other uses of qrand() to QRandomGenerator
The vast majority is actually switched to QRandomGenerator::bounded(),
which gives a mostly uniform distribution over the [0, bound)
range. There are very few floating point cases left, as many of those
that did use floating point did not need to, after all. (I did leave
some that were too ugly for me to understand)

This commit also found a couple of calls to rand() instead of qrand().

This commit does not include changes to SSL code that continues to use
qrand() (job for someone else):
  src/network/ssl/qsslkey_qt.cpp
  src/network/ssl/qsslsocket_mac.cpp
  tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-11-08 09:14:03 +00:00
Friedemann Kleint
fad8f34033 Extend blacklisting in qnetworkreply
- Blacklist ioHttpRedirectPostPut for Windows
- Amend 84396a3f93:
  Keys need to be on subsequent lines

Task-number: QTBUG-62583
Change-Id: I6360ec7bd87de65a3294a0d22148f13579fcd292
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-11-07 19:45:18 +00:00
Timur Pocheptsov
d4b3ce9a28 qudpsocket.pro - fix dependencies
Similar to the problem found in QTcpSocket auto-test recently.
While the failure on CI looks differently (apparently, server process
starts but does not print anything), fixing the dependency does not
hurt and at least fixes the 'make check' scenario.

Change-Id: I8f29f3e492d22410533407a527f5fc8f664e7f5c
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2017-11-07 09:23:38 +00:00
Friedemann Kleint
c8fa698e99 tst_QNetworkReply: Blacklist ioHttpRedirectPolicy for Linux
Task-number: QTBUG-62583
Change-Id: I9723a465f1d36aec823ce3459fd03b9492a3b778
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-11-06 13:12:29 +00:00
Tony Sarajärvi
b5b1e1036f Extend blacklisting in qnetworkreply
While removing insignificant flag in commit
38a0909d4e and blacklisting
autotests that still failed, qtbase builds didn't
verify VS2017. That broke qt5 builds which do build VS2017.

Task-number: QTBUG-64264
Change-Id: I5fdfa5dac6192f449a05146a9a422e428a710c84
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-11-05 16:03:09 +00:00
Friedemann Kleint
84396a3f93 tst_QNetworkReply: Blacklist ioHttpRedirectPostPut for Linux
Change-Id: I7db143bbd2e178e944f4cfc6c184850238f3bc8c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-11-03 21:13:35 +00:00
Thiago Macieira
484a186f50 QNativeSocketEngine/Win: fix getting the datagram destination
Looks like I never even tested this. There were two problems:
 1) when we asked for the recvmsg and sendmsg functions, we used the
    wrong variable (socketDescriptor was still -1)
 2) we extracted the destination addresses, but never set them in the
    QIpPacketHeader object

The added tests confirm that this works on Windows, Linux, Darwin,
FreeBSD. There also seems to be a problem, obtaining the destination
address on an IPv4 socket with a dual-stack sender (I can reproduce that
on FreeBSD, macOS and Windows, plus an old version of Linux).

Task-number: QTBUG-63605
Change-Id: I638cf58bfa7b4e5fb386fffd14ea732bddbc0c42
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-11-04 19:12:18 +00:00
Timur Pocheptsov
b409cfa094 tst_QNetworkReply::ioHttpRedirectPolicy - blacklist for b2qt 64bit
This test fails often and seems to be flaky.

Task-number: QTBUG-62583
Change-Id: Id3af283c89e392634a7af6e11bd05775a4295798
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-10-30 11:12:05 +00:00
Timur Pocheptsov
1a64792652 tst_QTcpSocket::suddenRemoteDisconnect - fix flakyness
This test starts two processes - server and client - and requires
an external executable ('stressTest'). In .pro file we have SUBDIRS
containing both 'test' (test itself) and 'stressTest' (client/server app),
but there is no explicit dependency and as result we run the test before
we build 'stressTest' thus failing to start those processes. This patch makes
'test' dependent on 'stressTest'.

Task-number: QTBUG-36629
Change-Id: I286b08bcff86b9afc4bbee87a75e887527eaf5f2
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-10-30 11:10:10 +00:00
Liang Qi
17d5141113 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/plugins/platforms/windows/qwindowswindow.cpp
	tests/auto/widgets/kernel/qaction/tst_qaction.cpp

Change-Id: Ia017a825ed2ca2d53ac586f4ae48df6f65818d40
2017-10-30 08:54:05 +01:00
Friedemann Kleint
38a0909d4e tst_qnetworkreply: Replace insignificant_test with blacklisting
Neither the exit crash of QTBUG-21102 nor the Windows failure of
QTBUG-24226 appear to be reproduceable.

Add verbose error reporting to getErrors() and blacklist
getErrors:ftp-host which has been found to fail with timeouts
on Linux and ioHttpRedirectMultipartPost.

Task-number: QTBUG-21102
Task-number: QTBUG-24226
Task-number: QTBUG-62860
Change-Id: I6b29f6184e83de8ffebf6ff0d80606512dca6419
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-10-29 10:12:17 +00:00
Thiago Macieira
1552bb6f31 Remove failing QVERIFY on bearer management
It fails for me on Windows 10. Therefore, this is wrong.

 FAIL!  : tst_QHostInfo::initTestCase() 'networkSession->waitForOpened(30000)' returned FALSE. ()
 S:\qt\qt5-msvc2017-x64\qtbase\tests\auto\network\kernel\qhostinfo\tst_qhostinfo.cpp(194) : failure location

Change-Id: Ib17dde1a1dbb49a7bba8fffd14ed5691472a4760
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-28 06:08:46 +00:00
Timur Pocheptsov
76a6b32942 HTTP/2 - make protocol settings configurable
1. Recently we have updated our receive window size to a larger value.
Unfortunately, this also results in auto-test pumping through
more data, which probably takes more time on CI.
At the moment we do not have any public API on QNAM's level to
customize HTTP/2 parameters (aka 5.10/FF and so on). So we use the fact
that QNAM is QObject and we can set a property on it. This property
is our Http2::ProtocolParameters object that allows us to configure:
- HPACK parameters (in 5.10 - noop)
- session receive window size
- different SETTINGS as described by RFC 7540, 6.5.2.

2. Undocumented environment variable to set ENABLE_PUSH is not needed
anymore.
3. In 5.11 Http2::ProtocolParameter will become a public API
and we'll introduce a new setter in QNAM.

Change-Id: If08fd5e09e7c0b61cf9700b426b60b5837b6b2e6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-26 04:13:40 +00:00
Mårten Nordheim
18f0a45964 Fix redirecting all the other methods for HTTP 307 and 308
c4cf90b1f7 made POST requests be
redirected properly, but this wasn't enough and should have included
every method/verb.

Change-Id: I37b12dc9fdffcbf2aadbd2360d4fc2584c024939
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-10-24 16:43:35 +00:00
Liang Qi
32f50225c4 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/plugins/platforms/direct2d/direct2d.pro
	src/plugins/platforms/ios/qiosclipboard.mm
	src/plugins/platforms/windows/windows.pro

Change-Id: Idffa03b3990bd642784f528821c5446b2e1008ef
2017-10-23 09:40:54 +02:00
Mårten Nordheim
fc98878658 Fix cookie path matching for empty url path
The path wouldn't match if the cookie's path was root ('/') and the
URLs path was empty.

Change-Id: I6dcd10f1fdf4f48f14e50f1b169cbdfda7005849
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-19 12:51:38 +00:00
Orgad Shaneh
d57a7c4171 MinGW: Globally define WINVER and _WIN32_WINNT to enable Windows 7 API
Change-Id: I637b33ba6d05f40486d8da927ae5cc5148299348
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-10-19 10:58:59 +00:00
Thiago Macieira
3fe74b76fd QHostInfo: Make getaddrinfo() mandatory
All systems must implement it by now. If there's any system still
without it, that means it has no IPv6 support, so they can disable
QtNetwork entirely.

[ChangeLog][Deprecation Notice] Starting with Qt 5.10, IPv6 support is
mandatory for all platforms. Systems without proper IPv6 support, such
as the getaddrinfo() function or the proper socket address structures,
will not be able to build QtNetwork anymore.

Change-Id: I3868166e5efc45538544fffd14d8c28046f9191b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-18 09:26:43 +00:00
Mårten Nordheim
c4cf90b1f7 Fix redirecting POST for HTTP 307 and 308
All POST requests that were redirected would previously turn into GET
requests. This does not follow the standard for HTTP codes 307 and 308.

Task-number: QTBUG-63142
Change-Id: Ibd25a9566066e589670a9bc34e5dc5111f8139d5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-17 18:50:14 +00:00
Liang Qi
7e4571b7e7 Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2017-10-17 18:29:37 +00:00
Mårten Nordheim
8a39384e90 Open a session during redirects when needed
In some cases when a session isn't needed (i.e. for localhost), the
session is not opened at all. If a program (e.g. our tests) redirects
from localhost to a different system (e.g. the qt network test
servers, or the internet) it will wait for a session forever. So, we
need to check if a session is needed for the redirect-target and then
open one. It is usually opened in
QNetworkReplyHttpImplPrivate::_q_startOperation

Change-Id: Id3b78182a3fb3f63f0235ecb1fb665df8bd0c4ca
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-10-17 14:22:22 +00:00
Timur Pocheptsov
db333d6dba QNAM (redirects) - clear 'raw' headers before sending the next request
We already cleared 'cookedHeaders', which is a QHash for 'known headers'
(enumerators as keys instead of strings), now do the same for 'rawHeaders'-
not to end up with some weird mix of headers from all possible redirect
responses and the final response.

Task-number: QTBUG-61300
Change-Id: Ifd6655c4167840bb00d29446d36ce65ba2d5491a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-17 13:58:16 +00:00