diff options
author | Alex Trotsenko <alex1973tr@gmail.com> | 2020-10-15 19:13:25 +0300 |
---|---|---|
committer | Alex Trotsenko <alex1973tr@gmail.com> | 2020-10-15 22:56:35 +0300 |
commit | 53b4556332e95820622742e9be16281a77f9d337 (patch) | |
tree | 3c8fda8fd7a388ff061e1df660ddbaebbc638531 /tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp | |
parent | a8b687b1010f92cbc972a5c1e9dc449b1fa44c38 (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.
Pick-to: 5.15
Change-Id: Id136798c7663df1fce7ed0aa4e3c6f5c65218a11
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp')
-rw-r--r-- | tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp | 1 |
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 fee44601cf..e481db6644 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() |