summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qabstractsocket.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-01-20 18:16:08 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-01-20 18:18:59 +0100
commit9033977d3971db5352a2bb51052a723a2ac57a8f (patch)
treed1a70bdf5e892cc391f7bbfd61ff5611fe25ce3d /src/network/socket/qabstractsocket.cpp
parente5e43a2386fb4a4c2cb90d5a8d9bb5ca81a2675e (diff)
parent03b6a2f0f98b70b24c0cce645d6d58c084111f91 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qstring.cpp src/gui/image/image.pri src/gui/image/qimage.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/qeglfshooks_stub.cpp tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp Change-Id: I3b9ba029c8f2263b011f204fdf68c3231c6d4ce5
Diffstat (limited to 'src/network/socket/qabstractsocket.cpp')
-rw-r--r--src/network/socket/qabstractsocket.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index ac2fb1c34d..1906166257 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -591,8 +591,7 @@ QAbstractSocketPrivate::~QAbstractSocketPrivate()
/*! \internal
- Resets the socket layer, clears the read and write buffers and
- deletes any socket notifiers.
+ Resets the socket layer and deletes any socket notifiers.
*/
void QAbstractSocketPrivate::resetSocketLayer()
{
@@ -1834,6 +1833,7 @@ qintptr QAbstractSocket::socketDescriptor() const
as a valid socket descriptor; otherwise returns \c false.
The socket is opened in the mode specified by \a openMode, and
enters the socket state specified by \a socketState.
+ Read and write buffers are cleared, discarding any pending data.
\b{Note:} It is not possible to initialize two abstract sockets
with the same native socket descriptor.
@@ -1846,6 +1846,8 @@ bool QAbstractSocket::setSocketDescriptor(qintptr socketDescriptor, SocketState
Q_D(QAbstractSocket);
d->resetSocketLayer();
+ d->writeBuffer.clear();
+ d->buffer.clear();
d->socketEngine = QAbstractSocketEngine::createSocketEngine(socketDescriptor, this);
if (!d->socketEngine) {
d->socketError = UnsupportedSocketOperationError;
@@ -2310,6 +2312,7 @@ void QAbstractSocket::abort()
#if defined (QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocket::abort()");
#endif
+ d->writeBuffer.clear();
if (d->state == UnconnectedState)
return;
#ifndef QT_NO_SSL
@@ -2324,7 +2327,6 @@ void QAbstractSocket::abort()
d->connectTimer = 0;
}
- d->writeBuffer.clear();
d->abortCalled = true;
close();
}