summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-05-11 14:18:11 +0200
committerKai Koehne <kai.koehne@theqtcompany.com>2015-05-11 14:02:07 +0000
commit2e8aad650c50b96afc9e0821453a799ab85889d1 (patch)
tree760d666453eddf81d1564c0d5afd425496b6ee9e
parent5f3333c344ac1ef522cc5d5529e79f09a47e5c98 (diff)
Replace waitForBytesWritten with flush
Unfortunately waitForByesWritten is known to fail from time to time: QTBUG-24451 . We introduced it for making sure large data is actually send, but flush() seems to serve the same purporse. The only drawback is that flush() operates on the concrete socket, and therefore needs to be called on the caller's side. Change-Id: Ic92db298b3dad2c3f9eaa47d160aec517e33e284 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
-rw-r--r--src/libs/installer/protocol.cpp2
-rw-r--r--src/libs/installer/remoteobject.cpp1
-rw-r--r--src/libs/installer/remoteobject.h1
-rw-r--r--src/libs/installer/remoteserverconnection.cpp2
4 files changed, 4 insertions, 2 deletions
diff --git a/src/libs/installer/protocol.cpp b/src/libs/installer/protocol.cpp
index ba19c38ee..1bd3f1eee 100644
--- a/src/libs/installer/protocol.cpp
+++ b/src/libs/installer/protocol.cpp
@@ -65,8 +65,6 @@ void sendPacket(QIODevice *device, const QByteArray &command, const QByteArray &
break;
packet.remove(0, bytesWritten);
}
- // needed for big packages over TCP on Windows
- device->waitForBytesWritten(-1);
}
/*!
diff --git a/src/libs/installer/remoteobject.cpp b/src/libs/installer/remoteobject.cpp
index 990710609..a4e88f84b 100644
--- a/src/libs/installer/remoteobject.cpp
+++ b/src/libs/installer/remoteobject.cpp
@@ -106,6 +106,7 @@ bool RemoteObject::connectToServer(const QVariantList &arguments)
out << arg;
sendPacket(m_socket, Protocol::Create, data);
+ m_socket->flush();
return true;
}
diff --git a/src/libs/installer/remoteobject.h b/src/libs/installer/remoteobject.h
index 57ab0599d..18cd1ccbb 100644
--- a/src/libs/installer/remoteobject.h
+++ b/src/libs/installer/remoteobject.h
@@ -151,6 +151,7 @@ private:
out << arg3;
sendPacket(m_socket, name.toLatin1(), data);
+ m_socket->flush();
}
private:
diff --git a/src/libs/installer/remoteserverconnection.cpp b/src/libs/installer/remoteserverconnection.cpp
index cdaf070fd..78dd58643 100644
--- a/src/libs/installer/remoteserverconnection.cpp
+++ b/src/libs/installer/remoteserverconnection.cpp
@@ -165,6 +165,7 @@ void RemoteServerConnection::run()
if (m_signalReceiver) {
QMutexLocker _(&m_signalReceiver->m_lock);
sendData(&socket, m_signalReceiver->m_receivedSignals);
+ socket.flush();
m_signalReceiver->m_receivedSignals.clear();
}
continue;
@@ -179,6 +180,7 @@ void RemoteServerConnection::run()
} else {
qDebug() << "Unknown command:" << command;
}
+ socket.flush();
} else {
// authorization failed, connection not wanted
socket.close();