summaryrefslogtreecommitdiffstats
path: root/tests/auto/network
Commit message (Collapse)AuthorAgeFilesLines
* QUrl effective TLDs: update tableKai Koehne2016-10-211-7/+7
| | | | | | | | | | There are more than 1000 new entries since the table has been generated the last time. The autotest needs to be tweaked because the rules for the .mz domains have changed; use the .ck domain instead. Change-Id: Ife692afd46ac41a66604e966e5e8cb57c7aa649c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix some typos and minor sentence structure issues in docsFrederik Schwarzer2016-10-051-1/+1
| | | | | Change-Id: Ibede1aeb046e2df6723e3041152bfae22a9fde32 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSslSocket: respect read buffer's max size (SecureTransport)Timur Pocheptsov2016-09-271-0/+63
| | | | | | | | | | | | | | | | | 1. QSslSocketBackendPrivate::transmit was ignoring 'readBufferMaxSize'; as a result, we can have a user trying to set read buffer's size to a small value (and more important - reading slowly in a small chunks from this socket), but SSL itself socket reading 'too fast', potentially growing its internal buffer to a huge size. This also results in auto-tests failing - whenever we're trying to limit read rate in some test. 2. Update qsslsocket auto-test. Task-number: QTBUG-43388 Task-number: QTBUG-55170 Change-Id: Iedece26df0ac5b3b7cad62cc8c98aedc28e7ca5b Reviewed-by: Richard J. Moore <rich@kde.org>
* tst_QSslSocket::setLocalCertificateChain(): fix resource leak when test failMarc Mutz2016-08-111-3/+2
| | | | | | | | | The deleteLater() call wasn't reliably reached when tests fail, so use a QScopedPointer with QScopedPointerDeleteLater deleter. Change-Id: Ica73bc73c2a0ac1e9b77e4804f2aedcad9b662a0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* QNativeSocketEngine::option(): return a correct value on invalid callAlex Trotsenko2016-08-051-0/+1
| | | | | | | | Instead of 'true', it should be '-1'. Change-Id: I5e8f99153da68d34b37477ef4cedbc447fba347f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QLocalSocket/Tcp: open device before making a connectionAlex Trotsenko2016-08-041-0/+1
| | | | | | | | | | | | According to QLocalSocket's documentation, connectToServer() must initiate a connection attempt after opening the device. Otherwise, if a connection succeeds immediately, connected() signal will be emitted on closed device. So, this patch ensures that TCP-based implementation behaves correctly. Change-Id: I4cc9474815e091a1491a429a6dc17f9cf0154f58 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix tst_QNetworkReply::qtbug45581WrongReplyStatusCode() on WindowsFriedemann Kleint2016-06-301-1/+5
| | | | | | | | The file is read using CRLF line convention on Windows. Task-number: QTBUG-24226 Change-Id: Ie08fa603e29c80a42de4bfbfd1f4237f53c22b98 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* 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>
* QSslSocket (OpenSSL) - handle abort/close on sslErrors emittedTimur Pocheptsov2016-06-141-0/+27
| | | | | | | | | | | | If a user's code, attached to sslErrors signal, calls abort/close or disconnectFromHost but our SSL socket was configured not to verify a peer, no need to continue handshake after calling checkSslErrors (and finally crashing on invalid 'ssl' pointer). Task-number: QTBUG-53906 Change-Id: I7f185511d278f9d6f16e7d6c5ba424707141459c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* tst_QTcpSocket: Replace insignification on Windows by BLACKLIST.Friedemann Kleint2016-06-102-2/+13
| | | | | | | | | | Partially reverts f3939d943ed132eaf3daead797d961c3ffbc31a5. Task-number: QTBUG-52714 Task-number: QTBUG-49332 Task-number: QTBUG-49333 Change-Id: I1f1b3278134b1e6156c0cb7006d396154c776a46 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* tst_QNetworkReply: Un-blacklist recently fixed test.Edward Welbourne2016-05-251-4/+1
| | | | | | | | | | A recent fix now makes authenticationCacheAfterCancel(http+socksauth) work again, so un-blacklist it. Added a helpful comment while I was at it. Change-Id: I2d7eae8d80c12957d22659a82e5072301735c41f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* 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>
* Fixed crash in QAuthenticator::operator==Jesus Fernandez2016-05-131-0/+16
| | | | | | | | | | [ChangeLog][QtNetwork][QAuthenticator] Fixed crash when comparing a initialized QAuthenticator with an uninitialized QAuthenticator. Task-number: QTBUG-53338 Change-Id: Ib8b732b9c65c02ee542885e5d6fe9bd1589a6b1a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* 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>
* tst_QTcpSocket, tst_QUdpSocket: Improve diagnostics.Friedemann Kleint2016-05-023-30/+46
| | | | | | | | | | 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>
* QWindowsPipeWriter: ensure validity of the write bufferAlex Trotsenko2016-04-301-0/+108
| | | | | | | | | | | | | | | QWindowsPipeWriter uses asynchronous API to perform writing. Once a cycle has been started, the write buffer must remain valid until the write operation is completed. To avoid data corruption and possibly undefined behavior, this patch makes QWindowsPipeWriter::write() take a QByteArray, which it keeps alive for the duration of the write cycle. Autotest-by: Thomas Hartmann Task-number: QTBUG-52401 Change-Id: Ia35faee735c4e684267daa1f6bd689512b670cd2 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Windows/tst_QTcpServer: Suppress crash notification of crashingServer.Friedemann Kleint2016-04-231-0/+7
| | | | | | | | Suppress message dialog of the test helper as does QTestlib. Task-number: QTBUG-52714 Change-Id: I5efd7d72f77c7689500ecaccf46f1f9dfb312140 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* tst_QNetworkReply: Commentary fixes on test server workarounds.Edward Welbourne2016-04-121-3/+3
| | | | | | | | | | Follow-up to commit 6fd205d5: document which version of danted shall make one work-around redundant, document that another work-around is still needed even with that v1.1.19; and remove a comment that referred back to an XFAIL that commit 6fd205d5 removed. Change-Id: I270b662528127c82184bff20b3cecea4f0c41b41 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* tst_QNetworkReply: fix mis-guided use of QSKIP().Edward Welbourne2016-04-121-3/+3
| | | | | | | | | QSKIP() causes the whole test to be skipped, where this work-around for a known quirk of the test server only requires skipping a single Q_COMPARE(); the rest of the test passes fine without it. Change-Id: Ie4612bd428f4cb4b342fad908cc2784fbadf069c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Fix finding a helper executable in tst_QLocalSocketJoerg Bornemann2016-04-111-1/+2
| | | | | | | | | Use QFINDTESTDATA to find the socketprocess helper executable. Now tst_QLocalSocket::processConnection() passes when started from Qt Creator without adjusting the working directory. Change-Id: I97ca3334a381b3cd646647487529bcd90b969528 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Autotest: confirm that QHostAddress obeys RFC 5952 recommendationsThiago Macieira2016-04-091-4/+13
| | | | | | Change-Id: I0c94a5c2846b48c8aea7ffff1435b8a7ccbd4d9e Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
* QFtp: Use UTF-8 encoding.Friedemann Kleint2016-04-071-2/+3
| | | | | | | | | | According to RFC 2640, FTP uses UTF-8 encoding. Fix the conversions accordingly. Task-number: QTBUG-52303 Change-Id: I615199b3d074fc3861f25df113dda672525766b6 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* Update comment in tst_QLocalSocket::readBufferOverflowJoerg Bornemann2016-03-241-1/+1
| | | | | | | | QWindowsPipeWriter doesn't write in a separate thread anymore. Change-Id: Id978bfdfa2531be91cce94476ab9b0dff237bd61 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Add a write buffer to QLocalSocket/WinJoerg Bornemann2016-03-241-3/+17
| | | | | | | | | | | | | | | | | Commit 0307c008 removed the buffering of data-to-be-written from QWindowsPipeWriter, because it was assumed that users of this class (QProcess and QLocalSocket) already buffer data internally. This assumption was wrong for QLocalSocket. The following sequence localSocket->write(someData); localSocket->write(someMoreData); would not write anything on the second write. Add a write buffer to the Windows implementation of QLocalSocket. Task-number: QTBUG-52073 Change-Id: I6d0f03a722ec48138cbde3e2f69aae7dafe790d3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QLocalServer/Win: Fix race condition in listen().Joerg Bornemann2016-03-101-2/+0
| | | | | | | | | | | | | | Suppose a client connects while the QLocalServer is still in the loop that calls addListener. The connection would SetEvent(eventHandle), but every call to ConnectNamedPipe would ResetEvent(eventHandle). Thus, the connection is never detected by the notifier on eventHandle. Callers of addListener must check the connection state of every listener to make sure that no client connected while setting up listeners. Task-number: QTBUG-49254 Change-Id: Ia961927ea76973708e6e3f73510695eb5d6a0e4c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Fix glitch in tst_QLocalSocket::sendDataJoerg Bornemann2016-03-101-3/+6
| | | | | | | | | In one code path the test checked for the emission of a readyRead() signal without waiting for it. This code path was never hit, neither on Windows nor on Unix platforms. Change-Id: Ifbe464400a2a1ba8eab49bd60315289040e6bbde Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Accept LFCRLF to mark end of HTTP HeadersDyami Caliri2016-03-091-0/+67
| | | | | | | | | | Some embedded servers use LF to mark the end of an individual header, but use CRLF to mark the end of all the headers. The GoPro WiFi interface does this, as an example. Change-Id: I227ab73622c84f439a6cf8703d020393c4d8bf69 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* Blacklist tst_qnetworkreply tests that fail in RHEL 7.1Tony Sarajärvi2016-03-031-0/+4
| | | | | | Task-number: QTBUG-51545 Change-Id: I0f5fdef315f87401ca5e638bce5dd2dbe85bcb83 Reviewed-by: Akseli Salovaara <akseli.salovaara@theqtcompany.com>
* Speed up tst_QLocalSocket::sendDataJoerg Bornemann2016-03-031-1/+5
| | | | | | | | | | | The data function for this test re-used listenAndConnect_data that has an additional column "connections" which was never used in sendData. Thus sendData executed three times the same code which is just uselessly burned CI time. Copied the actually needed code of listenAndConnect_data to sendData_data. Change-Id: I6cdb1c1b72cb4ce7be7c13e90eea30ac09a14914 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Autotest: remove the check that broadcast = ip | ~netmaskThiago Macieira2016-01-211-7/+0
| | | | | | | | | | | | | It's possible to configure an interface so that it isn't the case. I have no idea if this is a valid scenario, but the unit test shouldn't enforce that. ip addr can report: inet 192.168.1.1/32 brd 192.168.1.255 scope global vlan0 valid_lft forever preferred_lft forever Change-Id: I8de47ed6c7be4847b99bffff141c337575760bd9 Reviewed-by: Richard J. Moore <rich@kde.org>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2016-01-191-0/+21
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/common/atomic64/atomic64.cpp configure src/3rdparty/forkfd/forkfd.c src/corelib/io/forkfd_qt.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tools/configure/configureapp.cpp Change-Id: Ic6168d82e51a0ef1862c3a63bee6722e8f138414
| * QAbstractSocket: do not enable read notifications on TCP in bind()Alex Trotsenko2015-12-241-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In bind+connect scenario, rejected connection can trigger a read notification while the socket is opened. But unlike UDP, reading from the socket engine or emitting a readyRead() signal is not allowed for the TCP socket in bound or connecting state. To make a bind+connect scenario work properly, disable the read notifications until a connection is established. Task-number: QTBUG-50124 Change-Id: I7b3d015b0f6021fb9ff9f83560478aa5545f41f5 Reviewed-by: Richard J. Moore <rich@kde.org>
| * Don't let closed http sockets pass as valid connectionsUlf Hermann2015-11-051-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A QAbstractSocket can be close()'d at any time, independently of its current connection state. being closed means that we cannot use it to read or write data, but internally it might still have some data to send or receive, for example to an http server. We can even get a connected() signal after close()'ing the socket. We need to catch this condition and mark any pending data not yet written to the socket for resending. (cherry picked from commit 0df5d079290b4c3b13e58e9397fabdc1dfdba96b) Task-number: QTBUG-48326 Change-Id: I67d9ad36f7288c9c6bef51aa6253d7b187737601 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* | QHttpSocketEngine: ensure pending EOF triggers a notificationAlex Trotsenko2016-01-181-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | When the remote peer closed the connection, a read notification needs to always be emitted, otherwise the higher layer does not get the disconnected signal. From the other side, underlying QAbstractSocket object could temporarily disable notifications from the engine at any time. To avoid possible blocking of the socket, take a pending EOF into account when the read notifications are re-enabled. Change-Id: Iac9d4e2f790530be3500baf5a2000f1f63df5cc2 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* | winrt: Use winsock2 API for hostname resolution on WinRT/WinPhoneOliver Wolff2016-01-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That API has been available for WinRT and Windows Phone for some time now. By using it to get the machine name and for hostname resolution we can get rid of some winrt-only code and use qhostinfo_win.cpp on WinRT and Windows phone as well. Additionally the required capability was added to tst_qhostinfo so that this auto test can be run without any manual editing. Change-Id: I63fa5521bf8cdb0c919bd5a0100ea977c865622a Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* | Fix compilation for WinRTMaurice Kalinowski2015-12-145-4/+8
| | | | | | | | | | | | | | | | TEST_HELPER_INSTALLS cannot be used on platforms with no QProcess support. Change-Id: I2a6a283d94ca4487fc628449c53fc37140dd291d Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | QNetworkInterface: fix support for address labels on Linux interfacesThiago Macieira2015-12-081-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 64a1448d87727878d9789906b2f4f5b9e3d74e38 (Qt 5.2) caused QNetworkInterface to report address labels (a.k.a. interface aliases) as separate interfaces. This is caused by the fact that glibc, uClibc and MUSL copy the address label (netlink address attribute IFA_LABEL) to the ifa_name field, which made QNetworkInterfaceManager think that it was an interface it hadn't yet seen. Address labels are the old way to add more than one IP address to an interface on Linux, for example: ifconfig eth0:1 192.0.2.2 Those do not create a new interface, so the "eth0:1" label maps to the same interface index as the parent interface. This has been deprecated for 10 years, but there are still tools out there that add addresses in this manner. This commit restores behavior compatibility with Qt 4.2-5.1. The Qt 5.2-5.5 behavior is incorrect because it reports more than one interface with the same index. On systems configured like the above, the tst_QNetworkInterface::interfaceFromXXX test was failing. Change-Id: I8de47ed6c7be4847b99bffff141c2d9de8cf7329 Reviewed-by: Richard J. Moore <rich@kde.org>
* | tst_QLocalSocket::threadedConnection(): Add failure message.Friedemann Kleint2015-12-031-1/+4
| | | | | | | | | | | | | | | | Introduce QVERIFY2() to get some information when exactly it fails. Change-Id: Icaddf2ecae434d0bafc90c18458c5ee067dfd506 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | tst_QNetworkReply: Fix repetitive invocation of cleanup().Friedemann Kleint2015-11-241-8/+6
| | | | | | | | | | | | | | | | Move the code from cleanup() into a separate cleanupTestData() and call this from initTestData() and cleanup(). Remove slot init(). Change-Id: I4e7b5b89197ed0aa50f46f730e9c1d9c59749614 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | tests: blacklist the data row which uses internet in tst_qftp.cppLiang Qi2015-11-171-0/+3
| | | | | | | | | | | | Task-number: QTBUG-49485 Change-Id: I2e4af34cd148e7aa888bf93cafa012515c5cd504 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-041-0/+29
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstorageinfo_unix.cpp src/plugins/platforms/windows/qwindowsmousehandler.cpp src/widgets/styles/qwindowsvistastyle.cpp Change-Id: Ie1725933815891cc8c86258d4c0e8ed0ab386edf
| * QWindowsPipeReader: fix occasional "Unknown error 995"Joerg Bornemann2015-11-021-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | After canceling the asynchronous read operation, the notified() slot receives ERROR_OPERATION_ABORTED. We must not handle this situation as an error. This amends commit 5ce567c5. Task-number: QTBUG-48336 Change-Id: Iff948ceb3ad1f805a9de8c188fbc39ed4c76ba82 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | 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>
* | Disable tst_QSslCertificate::subjectAndIssuerAttributes completelyFrederik Gladhorn2015-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | As a follow-up for 5c1b9bbdf14a9537bd66aedbfd1c72bde0c899e0 disable the test on all platforms, since it fails on newer openssl. This was now also happening on Windows, so until a fix is there, skip the test. Change-Id: I6c8822c0ac5411b1114e9cd426219574ab1c9b54 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> 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>
* | Don't let closed http sockets pass as valid connectionsUlf Hermann2015-10-131-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A QAbstractSocket can be close()'d at any time, independently of its current connection state. being closed means that we cannot use it to read or write data, but internally it might still have some data to send or receive, for example to an http server. We can even get a connected() signal after close()'ing the socket. We need to catch this condition and mark any pending data not yet written to the socket for resending. Task-number: QTBUG-48326 Change-Id: I6f61c35f2c567f2a138f8cfe9ade7fd1ec039be6 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-022-14/+71
|\| | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Make sure networkAccessibilityChanged is emittedLorn Potter2015-09-261-14/+17
| | | | | | | | | | | | | | Task-number: QTBUG-46323 Change-Id: I8297072b62763136f457ca6ae15282d1c22244f4 Reviewed-by: Timo Jyrinki <timo.jyrinki@canonical.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * 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>