Remove Windows-specific handling of the write notifiers on sockets

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>
bb10
Alex Trotsenko 2015-11-14 15:06:34 +02:00
parent 0cd73f23f2
commit a9e1fc29ca
1 changed files with 2 additions and 14 deletions

View File

@ -799,25 +799,13 @@ void QAbstractSocketPrivate::canCloseNotification()
*/
bool QAbstractSocketPrivate::canWriteNotification()
{
#if defined (Q_OS_WIN)
if (socketEngine && socketEngine->isWriteNotificationEnabled())
socketEngine->setWriteNotificationEnabled(false);
#endif
#if defined (QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocketPrivate::canWriteNotification() flushing");
#endif
bool dataWasWritten = writeToSocket();
if (socketEngine) {
#if defined (Q_OS_WIN)
if (!writeBuffer.isEmpty())
socketEngine->setWriteNotificationEnabled(true);
#else
if (writeBuffer.isEmpty() && socketEngine->bytesToWrite() == 0)
socketEngine->setWriteNotificationEnabled(false);
#endif
}
if (socketEngine && writeBuffer.isEmpty() && socketEngine->bytesToWrite() == 0)
socketEngine->setWriteNotificationEnabled(false);
return dataWasWritten;
}