summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qabstractsocket.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Fix grammar issues in SCTP documentationAlex Trotsenko2016-08-021-2/+2
| | | | | | | | | | | | | | | | | | Change-Id: I11bfb20dc3d4db98dccfd3bc680fb1ffbd522508 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-08-011-10/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure 5.7 now supports clang on android; but dev re-worked configure src/gui/kernel/qevent.h One side renamed a parameter of a constructor; the other added an alternate constructor on the next line. Applied the rename to both for consistency. tests/auto/tools/moc/tst_moc.cpp Each side added a new test at the end. .qmake.conf Ignored 5.7's change to MODULE_VERSION. configure.json No conflict noticed by git; but changes in 5.7 were needed for the re-worked configure to accommodate 5.7's stricter handling of C++11. Change-Id: I9cda53836a32d7bf83828212c7ea00b1de3e09d2
| * | QAbstractSocket: ensure bind()+connect() works on delayed closeAlex Trotsenko2016-07-201-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While connecting, the socket goes through the HostLookupState. In this state, the socket engine is not yet created, unless the socket had previously been bound. When it has been bound, we should keep the socket engine even if the user initiates a delayed close by using the write()+close() sequence. Change-Id: Iefebcb33cd72cb49617acbac8e02af9d8209c869 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Introduce SCTP sockets supportAlex Trotsenko2016-07-271-23/+50
| | | | | | | | | | | | | | | | | | | | | Add protocol-specific code and the QSctpServer, QSctpSocket classes. Change-Id: Ie9a1d87bd1fda866a2405043d1c15c12ded5a96e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-121-3/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | QtNetwork: eradicate Q_FOREACH loops [rvalues]Marc Mutz2016-05-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. This is the simplest of the patch series: Q_FOREACH took a copy, so we do, too. Except we don't, since we're just catching the return value that comes out of the function (RVO). We can't feed the rvalues into range-for, because they are non-const and would thus detach. Change-Id: I42c9c44d948ab1512a69d42890187bc3cf2d7e58 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-271-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_win.cpp src/widgets/itemviews/qheaderview.cpp Change-Id: I0a59ade9cd6e91f770fdf298a7d72a41e79fd761
| | * QAbstractSocket:waitForReadyRead(): fix handling UDPAlex Trotsenko2016-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Allow sockets in bound state to wait for notifications. Task-number: QTBUG-52449 Change-Id: I5c02bd61db68abca652312d4d59023963b05b3c5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| * | QtNetwork: eradicate Q_FOREACH loops [needing qAsConst()]Marc Mutz2016-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. To avoid detaches of these mutable Qt containers, wrap the container in qAsConst(). Change-Id: I47c5308a6ad220b4c5495e55a3b0d38547bfa8d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Rework toggling the state of read notifier on unbuffered socketAlex Trotsenko2016-04-071-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid infinite loop on unbuffered socket, previous implementation always disabled the read notifications before emitting a readyRead() signal. So, it's very likely that the socket will toggle the state of notifier twice (on->off->on) in one notification cycle. This patch prevents this unnecessary toggling by deferring the notification disabling in canReadNotification() to the next notification cycle. Change-Id: Iebc5a7ad18a6f40ea1cf63e7f1b12f6c180cbf7a Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* | | QAbstractSocket: simplify connect timer handlingAlex Trotsenko2016-04-031-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove: - handling in abort(): timer will be stopped in resetSocketLayer(); - unneccesary checks in _q_testConnection(): if we have a valid timer we should stop it anyway; - code duplication in _q_testConnection(): do not try to stop the timer twice. Change-Id: I039ae583ae4e6c4a90dc102c7d93a30e46632374 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-03-221-21/+56
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/common/wince/qplatformdefs.h src/plugins/platforms/directfb/qdirectfbbackingstore.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp Change-Id: Ied4d31264a9afca9514b51a7eb1494c28712793c
| * | QAbstractSocket: do not fail writing on read buffer overflowAlex Trotsenko2016-03-181-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | canReadNotification() could return 'false' if either the socket has been closed, or the read buffer has reached the maximum size. Because of this duality, waitForBytesWritten() should not fail as a result of a canReadNotification() call. Change-Id: I9a15fa174a3b982a7ce404913caa38fc19f64622 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-111-4/+3
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change partially reverts 1bfc7f68 about QT_HAS_BUILTIN define and undef in src/corelib/tools/qsimd_p.h. This change is also squashed with "Fall back to c++11 standard compiler flag for host builds" which is done by Peter Seiderer. Conflicts: mkspecs/features/default_post.prf src/3rdparty/sqlite/0001-Fixing-the-SQLite3-build-for-WEC2013-again.patch src/3rdparty/sqlite/sqlite3.c src/corelib/tools/qsimd_p.h src/gui/kernel/qevent.cpp src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface_p.h src/plugins/bearer/blackberry/blackberry.pro src/plugins/platforms/cocoa/qcocoasystemsettings.mm src/plugins/platformthemes/gtk2/gtk2.pro src/plugins/styles/bb10style/bb10style.pro src/sql/drivers/sqlite2/qsql_sqlite2.cpp tools/configure/configureapp.cpp Task-number: QTBUG-51644 Done-with: Peter Seiderer <ps.report@gmx.net> Change-Id: I6100d6ace31b2e8d41a95f0b5d5ebf8f1fd88b44
| | * QAbstractSocket: fix a possible crash in waitForReadyRead()Alex Trotsenko2016-03-021-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | waitForConnected() could return 'true' even when the socket was disconnected. Change-Id: I99d9c9730f4e9b6c8a54696eb92c24c3ef36d261 Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
| * | Integrate network sockets into the multichannel infrastructureAlex Trotsenko2016-03-011-13/+48
| | | | | | | | | | | | | | | | | | | | | Change-Id: I96974a7460c29b46cae8a28aadb3e50cdcdb7beb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* | | Rework toggling the state of read notifier on buffered socketAlex Trotsenko2016-03-211-15/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Read notifications on a buffered socket are enabled all the time while the socket is connected unless the buffer size limit is reached. To enable the read notifier again, the user needs to read the data or enlarge the buffer with a setReadBufferSize() call. According to that scenario, it's very likely that the socket will toggle the state of notifier twice (on->off->on) in one notification cycle. Also, use of the readyRead() signal with a queued connection leads to the same problem. This patch prevents this unnecessary toggling by: - unconditionally setting the notifier's state in setReadBufferSize(); - deferring the notification disabling in canReadNotification() to the next notification cycle. Change-Id: I29df32f12c9c80a325373af86963e924817f2167 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | QAbstractSocket: do not try to disable write notifications twiceAlex Trotsenko2016-03-151-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When canWriteNotication() is called and the socket successfully writes a chunk of data, then condition for disabling the notifications will be checked both in writeToSocket() and canWriteNotification(). Moving the code which handles notifications' state from canWriteNotification() to another branch in writeToSocket() eliminates a duplication and forces writeToSocket() to handle disabling the notifications in all cases. Change-Id: I6c14db552afe77b0cf1c9f5c511bafa127a45fe5 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* | | QAbstractSocket: remove unnecessary checksAlex Trotsenko2016-03-091-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to check the 'enabled' states before calling set{Read|Write}NotificationEnabled() functions, because the socket event notifiers are fully optimized for this case. Change-Id: I0cd4fbc2298c9b9523420a60a46a65e0b305fa12 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | QAbstractSocket::flush(): remove manual polymorphismAlex Trotsenko2016-03-011-9/+1
|/ / | | | | | | | | | | | | | | ... by making a function in the private class virtual. Change-Id: I45c25c6c59511a8e8821ca96b0cf28cbf1b2f267 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* | Simplify QAbstractSocket::readData()Alex Trotsenko2016-02-031-22/+8
| | | | | | | | | | | | | | | | It needed refactoring after prior changes (bf6897edb0, 1ce203d05a, 48a4a67e8d). Change-Id: I06ee3f4f70db2a71acfc8e9c1da5b4ad7524179d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | QRingBuffer: add append(const char *, qint64) functionAlex Trotsenko2016-02-011-8/+2
| | | | | | | | | | | | | | This allows to remove a code duplication in several places. Change-Id: I49f56e951682dbd2968923654a12cba5199a2502 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | QAbstractSocket: do not use internal buffer for discarding the dataAlex Trotsenko2016-01-261-15/+28
| | | | | | | | | | | | | | | | | | | | Instead, allocate a temporary buffer on the stack. This prevents the internal read buffer from being allocated if the device is opened only for writing. Change-Id: Ib91c58299206e92006589807527e7b71a5555c8f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/devLiang Qi2016-01-261-1/+2
|\ \
| * | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-211-1/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice_p.h src/corelib/kernel/qvariant_p.h src/corelib/tools/qsimd.cpp src/gui/kernel/qguiapplication.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp Change-Id: I742a093cbb231b282b43e463ec67173e0d29f57a
| | * Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2016-01-191-1/+2
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Add Intel copyright to files that Intel has had non-trivial contributionThiago Macieira2016-01-211-0/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | I wrote a script to help find the files, but I reviewed the contributions manually to be sure I wasn't claiming copyright for search & replace, adding Q_DECL_NOTHROW or adding "We mean it" headers. Change-Id: I7a9e11d7b64a4cc78e24ffff142b506368fc8842 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | QAbstractSocket: remove redundant handling of recursive callsAlex Trotsenko2016-01-151-23/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recursion is alredy prevented by the emittedReadyRead member. Disabling the read notifications also occurs when: - a new chunk of data has arrived on an unbuffered socket; - the buffer size limit has been reached on a buffered socket; - pauseSocketNotifiers() has been called Subsequent calls to read() or resumeSocketNotifiers() should re-enable the notifications independently from possible nesting. Change-Id: I4587265b8d3ed137516e08fbe92dce2f5eab508c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* | | Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/devSimon Hausmann2016-01-131-2/+2
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.6' into devSimon Hausmann2016-01-121-2/+2
| |\| | | | | | | | | | | | | | Change-Id: I5839bded07e23af65ced9491c4f50242f964dd31
| | * | Fix documentation for ReuseAddressHint on Unix.David Faure2016-01-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code says (for Q_OS_UNIX) if ((mode & QAbstractSocket::ShareAddress) || (mode & QAbstractSocket::ReuseAddressHint)) socketEngine->setOption(QAbstractSocketEngine::AddressReusable, 1); so clearly ReuseAddressHint does the same as ShareAddress, which is: setting SO_REUSEADDR. Change-Id: Ic2ab4d139c3f58c3c63723fc609a9d4f71bac97a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | Compile-fix: add missing declaration in debug.Edward Welbourne2015-10-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QAbstractSocketPrivate::readFromSocket() had a qDebug() that references its q->... so it also needs its Q_Q() declaration. Only relevant when QABSTRACTSOCKET_DEBUG is enabled (which it normally isn't). Change-Id: Ib82fd032fb2c4143a0987b9162377d0d7e968e95 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Add debug message on writing to an unbuffered TCP socketAlex Trotsenko2016-01-121-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same message is already printed on UDP and buffered TCP. Change-Id: I533baf97fe7e1359a38db3c3eb31d0463fe158e5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | QAbstractSocket::writeData(): remove dead codeAlex Trotsenko2016-01-121-4/+1
|/ / / | | | | | | | | | | | | | | | | | | The code was checking the write buffer in a branch for unbuffered sockets. Change-Id: I4dc722e7f182562332c3d167e6ebbab7f53f51e7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QAbstractSocket: remove unused 'connectTimeElapsed' memberAlex Trotsenko2016-01-051-6/+0
| | | | | | | | | | | | | | | | | | Change-Id: If73198fb034b6a52b5081379a2bc69052d307454 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | | Remove Windows-specific handling of the write notifiers on socketsAlex Trotsenko2016-01-041-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need in special OS dependent code now, because the socket notifiers got the identical behavior on all platforms. Change-Id: I53ee51cd5eeff328e0b73f7325d2c9e883c5b213 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | | QAbstractSocket: simplify a check for data availabilityAlex Trotsenko2015-11-191-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We know that the QAbstractSocketPrivate::canReadNotification() slot is called by the engine's read notifier only when new data is available for reading, or when the socket has been closed. This allows us to remove additional checks for engine validity and data availability for unbuffered sockets. Change-Id: Ic278cf2214d418d8fe471ea24a765b8d5840b0a5 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-10-141-13/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/io/qprocess/tst_qprocess.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro Change-Id: Ia93ce500349d96a2fbf0b4a37b73f088cc505c6e
| * | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-131-2/+4
| |\| | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-9/+3
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Remove unnecessary null-pointer checkThiago Macieira2015-09-281-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was dereferenced 8 lines before and the pointer cannot have changed since. Found by Coverity, CID 11363. Change-Id: I42e7ef1a481840699a8dffff1407ecab4e4f5930 Reviewed-by: Richard J. Moore <rich@kde.org>
* | | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-09-251-56/+60
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/io.pri src/corelib/io/qdatastream.cpp src/corelib/io/qdatastream.h src/network/socket/qabstractsocket.cpp src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h src/widgets/styles/qgtkstyle.cpp tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/qmimedatabase-cache.pro tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/qmimedatabase-xml.pro tests/auto/dbus/qdbusconnection/qdbusconnection.pro tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp Change-Id: I347549a024eb5bfa986699e0a11f96cc55c797a7
| * | QAbstractSocket: Consolidate error reportingKai Koehne2015-09-141-56/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce the methods setError(), setErrorAndEmit() to consistently set the internal error state. Change-Id: I4ff951d100cf5e9f9a7e27135bb52188cde99853 Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | QAbstractSocket: Always set errorString right after socketErrorKai Koehne2015-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise errorString() might not match error() in a statusChanged handler. Change-Id: If1250b4552412eabe88457dee031e4ef3f533838 Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-08-261-1/+6
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Merge remote-tracking branch 'origin/5.4' into 5.5Oswald Buddenhagen2015-07-171-1/+6
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/global/manifest-meta.qdocconf src/corelib/global/qnamespace.qdoc src/corelib/io/qstorageinfo_unix.cpp src/corelib/tools/qtools_p.h src/sql/drivers/psql/qsql_psql.cpp Change-Id: I23a15ac84e03ad61d865e3df872b013eb0752949