summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/socket/qudpsocket
Commit message (Collapse)AuthorAgeFilesLines
* Add cmdline feature to qmakeJoerg Bornemann2019-02-182-5/+2
| | | | | | | | | [ChangeLog][qmake] A new feature "cmdline" was added that implies "CONFIG += console" and "CONFIG -= app_bundle". Task-number: QTBUG-27079 Change-Id: I6e52b07c9341c904bb1424fc717057432f9360e1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* tst_QUdpSocket: Fix Clang warning about unused expressionFriedemann Kleint2018-05-021-2/+4
| | | | | | | | | tst_qudpsocket.cpp(965,9): warning: expression result unused [-Wunused-value] if (!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData()) Task-number: QTBUG-63512 Change-Id: I51959432c6ff166c188842e34c3033ab1319c079 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Widen the blacklists for flaky udp testsVille Voutilainen2018-02-271-2/+2
| | | | | | | | Task-number: QTBUG-66216 Change-Id: I52688bf41ef12b2ec67887b1a5d26f89d4556d5b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-072-3/+19
|\ | | | | | | | | | | | | Conflicts: tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp Change-Id: Ib6dd965a7eb6f59103e276b3407739147ecd37b2
| * tst_QUdpSocket - unblacklist tests on Ubuntu 16.04Timur Pocheptsov2018-01-052-4/+19
| | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Lars Knoll2017-12-302-3/+22
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Blacklist tst_QUdpSocket on Ubuntu 16.04Joni Jantti2017-12-271-0/+5
| | | | | | | | | | | | | | | | | | 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>
| * tst_QUdpSocket: fix linkLocalIPv4 testThiago Macieira2017-12-051-3/+2
| | | | | | | | | | | | | | | | | | | | | | I broke it in commit 4da2dda2aa1f710177157dc1cf841e0bf0b9d829. 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>
| * tst_QUdpSocket: Don't test for .bytesAvailable on untrusted platformsThiago Macieira2017-12-051-0/+15
| | | | | | | | | | | | | | | | | | 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>
* | tst_QUdpSocket: add some tests for link-local IPv6 multicastingThiago Macieira2017-12-291-1/+28
| | | | | | | | | | | | | | | | | | | | | | 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>
* | tst_QUdpSocket: always use an interface when binding to IPv6Thiago Macieira2017-12-292-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | tst_QUdpSocket: Don't use interface-local IPv6 multicastThiago Macieira2017-12-241-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | tst_QUdpSocket: stop trying to bind to multicast addressesThiago Macieira2017-12-242-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | tst_QUdpSocket: remove Bearer portions of the testThiago Macieira2017-12-051-122/+0
|/ | | | | | | | | | | | | | | | | | | | 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>
* qudpsocket.pro - fix dependenciesTimur Pocheptsov2017-11-071-2/+1
| | | | | | | | | | | 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>
* QNativeSocketEngine/Win: fix getting the datagram destinationThiago Macieira2017-11-042-46/+126
| | | | | | | | | | | | | | | | | 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>
* Convert features.socks5 to QT_[REQUIRE_]CONFIGStephan Binner2017-09-061-3/+3
| | | | | | | | The sources were already added conditionally in the project file since 179fe5981fa. Change-Id: I0baaec2e772f3e596d311c1973b9745aa2b80423 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Fix bytesAvailable() on UDP under WindowsAlex Trotsenko2017-07-301-1/+0
| | | | | | | | | | | | | | When ::WSAIoctl() reports 1 byte available for reading, we are trying to peek an incoming datagram to ensure that the data is actually delivered. But, according to MSDN docs, we are not allowed to pass NULL as 'lpNumberOfBytesRecvd' parameter to ::WSARecvFrom() call, if 'lpOverlapped' parameter is also NULL. The case with an empty datagram is fixed accordingly. Change-Id: Id13038245332d3fb4bc18038d44a7cfd7ce04775 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QSharedPointer::create() moreMarc Mutz2017-07-191-1/+1
| | | | | | | | | | | | | | | This is the result of running the (experimental) clang-tidy check qt-modernize-qsharedpointer-create Discarded changes: - tst_qsharedpointer.cpp: not sure we want these replacements there (→ separate change) - tst_collations.cpp: hit in a template specialization that is instantiated with both QSharedPointer and QSharedDataPointer. Change-Id: I203c2646e91d026735d923473af3d151d19e3820 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Ignore test failures of linkLocalIPv6 on RHEL 6.6 in the CISimon Hausmann2017-06-121-1/+2
| | | | | | | | | | | | | | The test fails as sendmsg() on the socket trying to deliver a packet to the IPv6 link-local fe80 address returns with -ENETDOWN. I cannot figure out why this happens when RHEL 6.6 is run under qemu/kvm but not under vmware. More details are in the task, but meanwhile the result of this test is ignored. This affects only RHEL 6.6, it passes on RHEL 7.2. Change-Id: I4ade5cd249dd0d1901368ab571dad324e0fd10c2 Task-number: QTQAINFRA-1042 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Continue to blacklist the utun interfaces on macOSThiago Macieira2017-06-061-0/+7
| | | | | | | | | | There were two more places that blacklisted certain interface types that commit e579c822c5bedf5e626e4eb72db3b49a4a4015dc didn't catch. This commit adds those two. Task-number: QTBUG-61263 Change-Id: Ia58d0480a9169f0f121aec03bf2e8900a58939cd Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* 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>
* 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>
* Properly use the "process" featureUlf Hermann2017-02-271-2/+2
| | | | | | | | | | | | 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>
* Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/devLiang Qi2016-06-212-5/+23
|\
| * Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-212-5/+23
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qsysinfo.h src/corelib/kernel/qcoreapplication_win.cpp src/gui/text/qdistancefield.cpp src/gui/text/qdistancefield_p.h src/plugins/platforms/windows/qwindowsglcontext.cpp src/plugins/platforms/windows/qwindowsglcontext.h Change-Id: Ib3500acc2b28553bde06758cd9a2e19eb7fe2978
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-202-5/+23
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And blacklisted a few tests in tst_QUdpSocket. Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtNative.java src/corelib/global/qglobal.cpp src/corelib/global/qsystemdetection.h src/corelib/io/qfileselector.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp tests/auto/network/socket/qudpsocket/BLACKLIST Task-number: QTBUG-54205 Change-Id: I11dd1c90186eb1b847d45be87a26041f61d89ef6
| | | * tst_QUdpSocket - remove insignificanceTimur Pocheptsov2016-06-142-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the second attempt to remove 'insignificant' from UDP socket test to: - make changes ending up in regressions more difficult (hopefully impossible) to merge - switch to BLACKLIST if needed - make flaky tests more visible. For now this 'back to significant' will be accompanied by extended BLACKLIST. New in BLACKLIST: * OS X - datagram size-related problems (fixed in 5.7) * OS X - multicastLeaveAfterClose - will probably stay BLACKLISTED, seems to be a Darwin's quirk, can be fixed in OS X >= 10.10. * windows ... tst_QUdpSocket::echo seems to fail randomly on OS X/linux and it looks like it fails at the same time on different machines, should be something server-related (a guess only). Change-Id: Ib344348ffab03fab1b9309b80449a04d8ce247c6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | | * Revert "tst_qudpsocket - remove insignificant"Timur Pocheptsov2016-05-132-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 11ad50074b57df7559d39a0620a1e1b35d0ac061. Unfortunately, udpsocket strikes back this time on OS X < 10.10 - never seens these test failing before. Since this prevents 5.6->5.7 merge, I have to revert it until the problem investigated/fixed on OS X. Alas :( Change-Id: I52f6512d88c25d2e3071cb845e91faefbd455e27 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | | * tst_qudpsocket - remove insignificantTimur Pocheptsov2016-05-062-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BLACKLIST should make it, recent regression in QUdpSocket went unnoticed (first) because of 'insignificant'. We'd like to avoid such regressions in future (again, using BLACKLIST if needed and fixig the real problem then). NB: BLACKLIST in this patch was extended to deal with previously unnoticed failures on Windows and OS X. 'multicast' and related family of of functions on OS X will probably stay like this (seems to be a Darwin's quirk), datagram size related tests - fixed in dev or 5.7 (change is in nativesocket engine, 'bytesAvailable'). Task-number: QTBUG-52714 Change-Id: I039b05935a02983ce1648de449907dfa765f7db7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | | Long live QNetworkDatagram!Thiago Macieira2016-06-201-33/+73
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a new class called QNetworkDatagram that encapsulates the IP packet header and UDP/IP stack metadata along with the actual payload data. It can be used for both receiving as well as sending data. It's called QNetworkDatagram so it can be used by QSctpSocket too, when that lands. [ChangeLog][QtNetwork] Added QNetworkDatagram class, along with new function receiveDatagram in QUdpSocket that returns it and an overload to writeDatagram that can accept it. Change-Id: Iee8cbc07c4434ce9b560ffff13ca467f425ddc3d Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-122-26/+40
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure src/corelib/io/qprocess_wince.cpp src/plugins/platforms/windows/qwindowstheme.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp tests/auto/corelib/tools/qtimezone/BLACKLIST tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: I26644d1cb3b78412c8ff285e2a55bea1bd641c01
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-062-28/+42
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/qtestlib/tutorial5/containers.cpp examples/widgets/tools/tools.pro src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/network/kernel/qdnslookup_unix.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp tools/configure/configureapp.cpp Change-Id: I838ae7f082535a67a4a53aa13a21ba5580758be8
| | * tst_QTcpSocket, tst_QUdpSocket: Improve diagnostics.Friedemann Kleint2016-05-022-28/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add more error messages on failures. Task-number: QTBUG-25367 Task-number: QTBUG-25368 Change-Id: I064143a058b7b98d9d5eecab8b5da49f5307e1eb Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* | | QtNetwork: Remove Windows CE.Friedemann Kleint2016-03-292-19/+2
|/ / | | | | | | | | | | | | | | | | Remove #ifdef sections for Q_OS_WINCE and wince .pro file clauses in library, examples and tests. Task-number: QTBUG-51673 Change-Id: I3706336395620522ceda414d7437295d9ec64f16 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-213-52/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Tests: Remove empty init/cleanup slots, constructors and destructors.Friedemann Kleint2015-12-101-15/+1
| | | | | | | | | | | | | | | | Move some code (like registrations of meta types) from init() to initTestCase() in the process. Change-Id: I57db5156647cfadab554fbed853b2e68b2815f3b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-11-041-0/+8
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/ptrsize.test configure src/corelib/global/qnamespace.h src/network/socket/qabstractsocket.cpp tests/auto/other/networkselftest/networkselftest.pro Change-Id: Ic78abb4a34f9068567cea876861d4220f5a07672
| * tst_qudpsocket::multicast - blacklist several combinationsTimur Pocheptsov2015-10-301-0/+8
| | | | | | | | | | | | | | | | | | Different multicast tests fail on different platforms for different reasons. Blacklist them to get rid of insignificant and later fix/un-blacklist. Change-Id: I91548366c7666478ea1cc446bbf337becfdefd49 Task-number: QTBUG-46612 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
* | tests/auto/network: Remove some placeholder formatting.Friedemann Kleint2015-10-191-16/+17
|/ | | | | | | | Use QByteArray/QString addition instead in loops and for test row names. Change-Id: I7974ace5b34f2da43e7511044e80de1e733245ac Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-131-0/+13
|\ | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qabstractsocket.cpp src/plugins/platforms/winrt/qwinrtscreen.cpp src/sql/drivers/mysql/qsql_mysql.cpp Change-Id: Ifb73623d09f53340ee5e10283f1f86b580998902
| * QAbstractSocket: fix writing to socket in HostLookup stateAlex Trotsenko2015-10-131-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | After calling connectToHost(), the socket enters HostLookup state. At this stage, the socket engine was not created yet, and writing to the socket should result in either data buffering or an error. So, add a check for d->socketEngine to prevent a crash on unbuffered sockets. Task-number: QTBUG-48356 Change-Id: I15ea9ce7de97ce6d7e13e358eca5350745b556bb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-021-0/+54
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/tools/qstring.h src/gui/image/qimagereader.cpp src/network/access/qnetworkaccessmanager.cpp src/tools/qdoc/doc/examples/examples.qdoc src/widgets/accessible/qaccessiblewidgetfactory_p.h src/widgets/doc/qtwidgets.qdocconf Change-Id: I8fae62283aebefe24e5ca4b4abd97386560c0fcb
| * QUdpSocket: avoid infinite read notifier blockingAlex Trotsenko2015-09-101-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a small amount of time between the last readDatagram() call and disabling a read notifier in case the socket had a pending datagram. If a new datagram arrived in this period, this qualified as absence of a datagram reader. Do not change the read notifier state because it is disabled on canReadNotification() entry and always enabled by the datagram reader. Thanks to Peter Seiderer, who investigated the same: "Querying hasPendingDatagrams() for enabling/disabling setReadNotificationEnabled() is racy (a new datagram could arrive after readDatagam() is called and before hasPendingDatagrams() is checked). But for unbuffered sockets the ReadNotification is already disabled before the readReady signal is emitted and should be re-enabled when calling read() or readDatagram() from the user." However, this patch does not completely solve the problem under Windows, as the socket notifier may emit spurious notifications. Task-number: QTBUG-46552 Change-Id: If7295d53ae2c788c39e86303502f38135c4d6180 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Declare QNetworkAddressEntry and QNetworkInterface as metatypesThiago Macieira2015-09-131-1/+0
| | | | | | | | | | Change-Id: I7de033f80b0e4431b7f1ffff13f98c092ea3ba3e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-08-261-2/+32
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/snippets/code/doc_src_qmake-manual.pro qmake/doc/src/qmake-manual.qdoc src/corelib/io/qstorageinfo_unix.cpp src/corelib/tools/qbytearray.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/corelib/io/qprocess/tst_qprocess.cpp tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp tests/auto/network/access/qnetworkreply/BLACKLIST Change-Id: I9efcd7e1cce1c394eed425c43aa6fce7d2edf31c
| * WinRT: Skip unsupported multicast UDP socket testsOliver Wolff2015-08-171-0/+18
| | | | | | | | | | Change-Id: I69f756ad829569060ae9931748b940842d23a6ea Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
| * tst_qudpsocket: Do not crash if no testserver address could be foundOliver Wolff2015-08-171-2/+14
| | | | | | | | | | Change-Id: Ica61974b20b848997c8ab101abde4b536814ba83 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* | Merge remote-tracking branch 'origin/5.5' into devFrederik Gladhorn2015-08-061-4/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/global/qt-cpp-defines.qdocconf src/3rdparty/forkfd/forkfd.c src/corelib/codecs/qtextcodec.cpp src/corelib/kernel/qmetatype.cpp src/corelib/tools/qset.qdoc src/gui/accessible/qaccessible.cpp src/gui/image/qpixmapcache.cpp src/opengl/qgl.cpp src/tools/qdoc/generator.cpp src/widgets/kernel/qwidget.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I4fbe1fa756a54c6843aa75f4ef70a1069ba7b085
| * tst_QUdpSocket: send two bytes in a datagramThiago Macieira2015-07-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm getting an error with WSARecvFrom in nativeBytesAvailable() and I don't know why. The number of bytes obtained is correct and the test works for 2 bytes, so let's use that. The Windows nativeBytesAvailable() function has a comment saying that WSAIoctl sometimes indicates 1 byte available when there's a pending error notification, so that function proceeds to do a WSARecvFrom to peek the number of bytes. Somehow that function in this test is getting a SOCKET_ERROR I can't explain. Change-Id: Ic5b19e556e572a72a9df9a405b1fee3b7efb8b24 Reviewed-by: Richard J. Moore <rich@kde.org>