summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2020-10-15 19:13:25 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-10-15 21:52:51 +0000
commit1b26e9f17cb0179b88a83310fae889d5232dcd47 (patch)
tree38d77d5720c8dd68f9154384b8f9355c6c3827d4 /tests/auto
parent52a7f472b06916e4f4d4f00a9ed0aede9a3e6816 (diff)
QLocalSocket/Win: prevent writing to broken pipe
When a peer closes the connection, the device remains opened for reading purposes. However, we should disable writing on disconnected socket. Otherwise, if the user issues a write() call, a new pipe writer object will be created and the write call occurs with invalid handle value. Change-Id: Id136798c7663df1fce7ed0aa4e3c6f5c65218a11 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit 53b4556332e95820622742e9be16281a77f9d337) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
index e172c255a7..a4685b59c7 100644
--- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
@@ -1267,6 +1267,7 @@ void tst_QLocalSocket::syncDisconnectNotify()
QVERIFY(serverSocket);
delete serverSocket;
QCOMPARE(client.waitForReadyRead(), false);
+ QVERIFY(!client.putChar(0));
}
void tst_QLocalSocket::asyncDisconnectNotify()