diff options
author | Alex Trotsenko <alex1973tr@gmail.com> | 2017-09-02 20:04:38 +0300 |
---|---|---|
committer | Alex Trotsenko <alex1973tr@gmail.com> | 2017-09-05 16:58:02 +0000 |
commit | 0fcb6c26c1f4a0506bfa7dba181ed6db4e02bdb0 (patch) | |
tree | ceb01afd3d2647d9ca814de257475eb78cc25cbe /src/network/socket/qlocalsocket_unix.cpp | |
parent | aa95e9e98618d8838ba6d83f3cc365113ca6f410 (diff) |
QLocalSocket: forward skipping to the inner socket
As QLocalSocket keeps incoming data in the inner socket object, we
can implement the outer's skip() by simply calling the inner's. This
avoids the slow read()-based code path provided by the base class.
Change-Id: I66547601ebad1b4acf168475bebd81fbeef969f8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network/socket/qlocalsocket_unix.cpp')
-rw-r--r-- | src/network/socket/qlocalsocket_unix.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp index c1d79e8137..d1df26d9f1 100644 --- a/src/network/socket/qlocalsocket_unix.cpp +++ b/src/network/socket/qlocalsocket_unix.cpp @@ -88,6 +88,11 @@ void QLocalSocketPrivate::init() unixSocket.setParent(q); } +qint64 QLocalSocketPrivate::skip(qint64 maxSize) +{ + return unixSocket.skip(maxSize); +} + void QLocalSocketPrivate::_q_error(QAbstractSocket::SocketError socketError) { Q_Q(QLocalSocket); |