From dd00f6dd91a28f3e76bc4c3e894174efffc7f201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Sun, 28 Aug 2016 21:34:32 +0100 Subject: Handle short reads in the local sockets example Protection against short reads was already half implemented, blockSize was being sent by the server but never used by the client. Also, blockSize was bumped to quint32: If you're in a position where short reads can happen then quint16 is probably not enough to hold the size of your data. On Linux I could only reproduce short reads for messages > 500K. Change-Id: I191a3d781da1d8a119debbdafae641c8340a1da2 Reviewed-by: Giuseppe D'Angelo --- examples/corelib/ipc/localfortuneclient/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/corelib/ipc/localfortuneclient/client.h') diff --git a/examples/corelib/ipc/localfortuneclient/client.h b/examples/corelib/ipc/localfortuneclient/client.h index f12957fe33..8ba767b4fa 100644 --- a/examples/corelib/ipc/localfortuneclient/client.h +++ b/examples/corelib/ipc/localfortuneclient/client.h @@ -76,7 +76,7 @@ private: QLocalSocket *socket; QString currentFortune; - quint16 blockSize; + quint32 blockSize; }; #endif -- cgit v1.2.3