QLocalSocket: remove double buffer on qlocalsocket_unix

The QLocalSocket is using a QLocalUnixSocket which is a QTcpSocket
that has buffering enabled. Because QLocalSocket is a QIODevice it
also has its own read buffer. By opening the QIODevice Unbuffered
we only use the buffer in the QLocalUnixSocket.

Change-Id: I4b9091522f73b0831b20efb4a2a00c2603fc748b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
This commit is contained in:
Martin Petersson 2012-03-22 10:39:31 +01:00 committed by Qt by Nokia
parent 68f44a7f98
commit f956f9a836

View File

@ -338,7 +338,7 @@ void QLocalSocketPrivate::_q_connectToSocket()
fullServerName = connectingPathName; fullServerName = connectingPathName;
if (unixSocket.setSocketDescriptor(connectingSocket, if (unixSocket.setSocketDescriptor(connectingSocket,
QAbstractSocket::ConnectedState, connectingOpenMode)) { QAbstractSocket::ConnectedState, connectingOpenMode)) {
q->QIODevice::open(connectingOpenMode); q->QIODevice::open(connectingOpenMode | QIODevice::Unbuffered);
q->emit connected(); q->emit connected();
} else { } else {
QString function = QLatin1String("QLocalSocket::connectToServer"); QString function = QLatin1String("QLocalSocket::connectToServer");