diff options
author | Alex Trotsenko <alex1973tr@gmail.com> | 2015-02-11 20:02:07 +0200 |
---|---|---|
committer | Alex Trotsenko <alex1973tr@gmail.com> | 2015-09-10 12:50:58 +0000 |
commit | 378e26dd14df808a55471330400984841ef414d4 (patch) | |
tree | 2298a584f0472cb55fe96b280ed57ea12c25d5f3 /sync.profile | |
parent | d75505faccc9a86d9e76932ae022b660e01ad1a5 (diff) |
QUdpSocket: avoid infinite read notifier blocking
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>
Diffstat (limited to 'sync.profile')
0 files changed, 0 insertions, 0 deletions