From d9c0af92bd893e1f6a0b4c627300ea96a73aba55 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Wed, 14 Jul 2021 19:58:48 +0300 Subject: QLocalSocket/Unix: fix aborting the socket According to the documentation, calling abort() should immediately reset the socket to its initial state. This includes: - closing the file descriptor; - closing the QLocalSocket as an I/O device; - canceling a pending outgoing connection, if it exist; - reseting 'serverName' string. So, adding a call to close() resets the state entirely. Pick-to: 6.1 6.2 Change-Id: I9c604b5187c6300b437d7aa4c2d06db03edacf21 Reviewed-by: Oswald Buddenhagen Reviewed-by: Edward Welbourne Reviewed-by: Timur Pocheptsov --- src/network/socket/qlocalsocket_unix.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/network/socket/qlocalsocket_unix.cpp') diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp index 4dc542f2e3..2156644255 100644 --- a/src/network/socket/qlocalsocket_unix.cpp +++ b/src/network/socket/qlocalsocket_unix.cpp @@ -508,6 +508,7 @@ void QLocalSocket::abort() { Q_D(QLocalSocket); d->unixSocket.abort(); + close(); } qint64 QLocalSocket::bytesAvailable() const -- cgit v1.2.3