diff options
author | Alex Trotsenko <alex1973tr@gmail.com> | 2020-07-31 18:04:53 +0300 |
---|---|---|
committer | Alex Trotsenko <alex1973tr@gmail.com> | 2020-08-19 20:01:45 +0300 |
commit | cced8c900561684609203667c303884fef0ea758 (patch) | |
tree | 5dfc6c09d8b5f931cc676560ae6b5b2f16dd7b27 /src/network/socket | |
parent | 12e4b63d2861945c4860fbf7f9751199a1a1bd2e (diff) |
Make QAbstractSocket::abort() behavior unambiguous
After calling this function, the user expects that the connection is
terminated, I/O device is closed and the socket is ready for a new
attempt. But, if the socket was disconnected before the call, close()
is not called and I/O device remains opened.
Because QAbstractSocket::close() and QIODevice::close() can handle
reentering, we can call close() unconditionally, which makes
the behavior obvious.
Change-Id: I90a9cbb1a1fe8f866b55ef0bd68d286b34e853f5
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/network/socket')
-rw-r--r-- | src/network/socket/qabstractsocket.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 1850265141..21f1f742f7 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -2406,8 +2406,6 @@ void QAbstractSocket::abort() qDebug("QAbstractSocket::abort()"); #endif d->setWriteChannelCount(0); - if (d->state == UnconnectedState) - return; #ifndef QT_NO_SSL if (QSslSocket *socket = qobject_cast<QSslSocket *>(this)) { socket->abort(); |