[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498
Maximiliano Curia
maxy at moszumanska.debian.org
Fri Oct 14 14:29:50 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=e379fcd
The following commit has been merged in the master branch:
commit e379fcd69d1e481c0242490837d3bbba5c317bdf
Author: Albert Vaca <albertvaka at gmail.com>
Date: Fri Jun 17 01:59:05 2016 +0200
Destroying a socket should not destroy the link.
Also, sockets can be destroyed as soon as the socketreader is deleted.
---
core/backends/lan/landevicelink.cpp | 3 ++-
core/backends/lan/lanlinkprovider.cpp | 1 +
core/backends/lan/socketlinereader.h | 3 ++-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/core/backends/lan/landevicelink.cpp b/core/backends/lan/landevicelink.cpp
index dc57914..14b8510 100644
--- a/core/backends/lan/landevicelink.cpp
+++ b/core/backends/lan/landevicelink.cpp
@@ -39,6 +39,7 @@ LanDeviceLink::LanDeviceLink(const QString& deviceId, LinkProvider* parent, QSsl
void LanDeviceLink::reset(QSslSocket* socket, ConnectionStarted connectionSource)
{
if (mSocketLineReader) {
+ disconnect(mSocketLineReader->mSocket, SIGNAL(disconnected()), this, SLOT(deleteLater()));
delete mSocketLineReader;
}
@@ -51,7 +52,7 @@ void LanDeviceLink::reset(QSslSocket* socket, ConnectionStarted connectionSource
//When the link provider destroys us,
//the socket (and the reader) will be
//destroyed as well
- socket->setParent(this);
+ socket->setParent(mSocketLineReader);
mConnectionSource = connectionSource;
diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp
index 42ef359..6dd91f3 100644
--- a/core/backends/lan/lanlinkprovider.cpp
+++ b/core/backends/lan/lanlinkprovider.cpp
@@ -473,6 +473,7 @@ void LanLinkProvider::addLink(const QString& deviceId, QSslSocket* socket, Netwo
//Do we have a link for this device already?
QMap< QString, LanDeviceLink* >::iterator linkIterator = mLinks.find(deviceId);
if (linkIterator != mLinks.end()) {
+ //qCDebug(KDECONNECT_CORE) << "Reusing link to" << deviceId;
deviceLink = linkIterator.value();
deviceLink->reset(socket, connectionOrigin);
} else {
diff --git a/core/backends/lan/socketlinereader.h b/core/backends/lan/socketlinereader.h
index 55c9bde..66b9cee 100644
--- a/core/backends/lan/socketlinereader.h
+++ b/core/backends/lan/socketlinereader.h
@@ -47,6 +47,8 @@ public:
QSslCertificate peerCertificate() const { return mSocket->peerCertificate(); }
qint64 bytesAvailable() const { return mPackages.size(); }
+ QSslSocket* mSocket;
+
Q_SIGNALS:
void readyRead();
@@ -55,7 +57,6 @@ private Q_SLOTS:
private:
QByteArray lastChunk;
- QSslSocket* mSocket;
QQueue<QByteArray> mPackages;
};
--
kdeconnect packaging
More information about the pkg-kde-commits
mailing list