From 9314e64ce35a8e46b20898d72cb9f99f01d811a7 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Thu, 26 Feb 2015 00:27:57 -0500 Subject: [PATCH 1/7] Drag/drop enabling is configurable in the GUI. --- src/gui/res/ServerConfigDialogBase.ui | 21 ++++++++++++++------- src/gui/src/MainWindow.cpp | 4 +++- src/gui/src/ServerConfig.cpp | 3 +++ src/gui/src/ServerConfig.h | 3 +++ src/gui/src/ServerConfigDialog.cpp | 3 +++ 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/gui/res/ServerConfigDialogBase.ui b/src/gui/res/ServerConfigDialogBase.ui index 6d257ba2..cc44f66e 100644 --- a/src/gui/res/ServerConfigDialogBase.ui +++ b/src/gui/res/ServerConfigDialogBase.ui @@ -491,7 +491,21 @@ Double click on a screen to edit its settings. + + + + Ignore auto config clients + + + + + + Enable drag and drop file transfers + + + + Qt::Vertical @@ -504,13 +518,6 @@ Double click on a screen to edit its settings. - - - - Ignore auto config clients - - - diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index b5b0ce11..0c6a60a4 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -442,7 +442,9 @@ void MainWindow::startSynergy() #ifndef Q_OS_LINUX - args << "--enable-drag-drop"; + if (m_ServerConfig.enableDragAndDrop()) { + args << "--enable-drag-drop"; + } #endif diff --git a/src/gui/src/ServerConfig.cpp b/src/gui/src/ServerConfig.cpp index 693e26b8..01b52d80 100644 --- a/src/gui/src/ServerConfig.cpp +++ b/src/gui/src/ServerConfig.cpp @@ -50,6 +50,7 @@ ServerConfig::ServerConfig(QSettings* settings, int numColumns, int numRows , m_NumRows(numRows), m_ServerName(serverName), m_IgnoreAutoConfigClient(false), + m_EnableDragAndDrop(false), m_pMainWindow(mainWindow) { Q_ASSERT(m_pSettings); @@ -114,6 +115,7 @@ void ServerConfig::saveSettings() settings().setValue("switchDoubleTap", switchDoubleTap()); settings().setValue("switchCornerSize", switchCornerSize()); settings().setValue("ignoreAutoConfigClient", ignoreAutoConfigClient()); + settings().setValue("enableDragAndDrop", enableDragAndDrop()); writeSettings(settings(), switchCorners(), "switchCorner"); @@ -157,6 +159,7 @@ void ServerConfig::loadSettings() setSwitchDoubleTap(settings().value("switchDoubleTap", 250).toInt()); setSwitchCornerSize(settings().value("switchCornerSize").toInt()); setIgnoreAutoConfigClient(settings().value("ignoreAutoConfigClient").toBool()); + setEnableDragAndDrop(settings().value("enableDragAndDrop", true).toBool()); readSettings(settings(), switchCorners(), "switchCorner", false, NumSwitchCorners); diff --git a/src/gui/src/ServerConfig.h b/src/gui/src/ServerConfig.h index 2a9d0646..b8cba139 100644 --- a/src/gui/src/ServerConfig.h +++ b/src/gui/src/ServerConfig.h @@ -61,6 +61,7 @@ class ServerConfig : public BaseConfig const QList& switchCorners() const { return m_SwitchCorners; } const HotkeyList& hotkeys() const { return m_Hotkeys; } bool ignoreAutoConfigClient() const { return m_IgnoreAutoConfigClient; } + bool enableDragAndDrop() const { return m_EnableDragAndDrop; } void saveSettings(); void loadSettings(); @@ -88,6 +89,7 @@ class ServerConfig : public BaseConfig void setSwitchCorner(int c, bool on) { m_SwitchCorners[c] = on; } void setSwitchCornerSize(int val) { m_SwitchCornerSize = val; } void setIgnoreAutoConfigClient(bool on) { m_IgnoreAutoConfigClient = on; } + void setEnableDragAndDrop(bool on) { m_EnableDragAndDrop = on; } QList& switchCorners() { return m_SwitchCorners; } HotkeyList& hotkeys() { return m_Hotkeys; } @@ -119,6 +121,7 @@ class ServerConfig : public BaseConfig HotkeyList m_Hotkeys; QString m_ServerName; bool m_IgnoreAutoConfigClient; + bool m_EnableDragAndDrop; MainWindow* m_pMainWindow; }; diff --git a/src/gui/src/ServerConfigDialog.cpp b/src/gui/src/ServerConfigDialog.cpp index 33159c3a..af423ed3 100644 --- a/src/gui/src/ServerConfigDialog.cpp +++ b/src/gui/src/ServerConfigDialog.cpp @@ -56,6 +56,8 @@ ServerConfigDialog::ServerConfigDialog(QWidget* parent, ServerConfig& config, co m_pCheckBoxIgnoreAutoConfigClient->setChecked(serverConfig().ignoreAutoConfigClient()); + m_pCheckBoxEnableDragAndDrop->setChecked(serverConfig().enableDragAndDrop()); + foreach(const Hotkey& hotkey, serverConfig().hotkeys()) m_pListHotkeys->addItem(hotkey.text()); @@ -97,6 +99,7 @@ void ServerConfigDialog::accept() serverConfig().setSwitchCorner(BaseConfig::BottomRight, m_pCheckBoxCornerBottomRight->isChecked()); serverConfig().setSwitchCornerSize(m_pSpinBoxSwitchCornerSize->value()); serverConfig().setIgnoreAutoConfigClient(m_pCheckBoxIgnoreAutoConfigClient->isChecked()); + serverConfig().setEnableDragAndDrop(m_pCheckBoxEnableDragAndDrop->isChecked()); // now that the dialog has been accepted, copy the new server config to the original one, // which is a reference to the one in MainWindow. From 9b87ca38079faa41e740cf1483e45cec43d97665 Mon Sep 17 00:00:00 2001 From: Tom Sparrow Date: Fri, 8 May 2015 00:48:04 +0100 Subject: [PATCH 2/7] Fix missing DLLs after install #3774 The CompanionFile attribute was causing the installer to be confused: Won't Overwrite; Won't patch; Existing file is unversioned but modified and hence not install a bunch of these DLLs in some cases. --- src/setup/win32/Product.wxs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/setup/win32/Product.wxs b/src/setup/win32/Product.wxs index c93b4db6..673c85aa 100644 --- a/src/setup/win32/Product.wxs +++ b/src/setup/win32/Product.wxs @@ -110,13 +110,13 @@ - - - - - + + + + + - + From 72060e59b473b6c1a95042afa68d2f23b99315ef Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Fri, 12 Jun 2015 11:18:29 -0700 Subject: [PATCH 3/7] Fixed send clipboard thread time issue #4749 --- src/lib/client/Client.cpp | 1 + src/lib/server/Server.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/lib/client/Client.cpp b/src/lib/client/Client.cpp index 52258d69..ad586809 100644 --- a/src/lib/client/Client.cpp +++ b/src/lib/client/Client.cpp @@ -273,6 +273,7 @@ Client::leave() if (m_sendClipboardThread != NULL) { StreamChunker::interruptClipboard(); + m_sendClipboardThread->wait(); m_sendClipboardThread = NULL; } diff --git a/src/lib/server/Server.cpp b/src/lib/server/Server.cpp index 4420b2dd..1f04489c 100644 --- a/src/lib/server/Server.cpp +++ b/src/lib/server/Server.cpp @@ -509,6 +509,8 @@ Server::switchScreen(BaseClientProxy* dst, // clipboard data could be corrupted on the other side if (m_sendClipboardThread != NULL) { StreamChunker::interruptClipboard(); + m_sendClipboardThread->wait(); + m_sendClipboardThread = NULL; } // send the clipboard data to new active screen From 3e32d9fbee026c337ea8c6d4b479ddc50d1a344a Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Fri, 12 Jun 2015 16:53:41 -0700 Subject: [PATCH 4/7] Improved secure socket intensive try operations #4796 --- src/lib/net/TCPSocket.cpp | 4 ++-- src/lib/net/TCPSocket.h | 6 ++++-- src/lib/plugin/ns/SecureSocket.cpp | 15 +++++++++++---- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/lib/net/TCPSocket.cpp b/src/lib/net/TCPSocket.cpp index 91655ae3..0be5876b 100644 --- a/src/lib/net/TCPSocket.cpp +++ b/src/lib/net/TCPSocket.cpp @@ -496,7 +496,7 @@ TCPSocket::serviceConnected(ISocketMultiplexerJob* job, } else if (status == 0) { s_retryOutputBufferSize = buffSize; - return job; + return newJob(); } } else { @@ -559,7 +559,7 @@ TCPSocket::serviceConnected(ISocketMultiplexerJob* job, return NULL; } else if (status == 0) { - return job; + return newJob(); } } else { diff --git a/src/lib/net/TCPSocket.h b/src/lib/net/TCPSocket.h index c30a2d7e..b4c833ba 100644 --- a/src/lib/net/TCPSocket.h +++ b/src/lib/net/TCPSocket.h @@ -96,6 +96,10 @@ private: serviceConnected(ISocketMultiplexerJob*, bool, bool, bool); +protected: + bool m_readable; + bool m_writable; + private: Mutex m_mutex; ArchSocket m_socket; @@ -103,8 +107,6 @@ private: StreamBuffer m_outputBuffer; CondVar m_flushed; bool m_connected; - bool m_readable; - bool m_writable; IEventQueue* m_events; SocketMultiplexer* m_socketMultiplexer; }; diff --git a/src/lib/plugin/ns/SecureSocket.cpp b/src/lib/plugin/ns/SecureSocket.cpp index e3e88f06..6630388d 100644 --- a/src/lib/plugin/ns/SecureSocket.cpp +++ b/src/lib/plugin/ns/SecureSocket.cpp @@ -417,14 +417,21 @@ SecureSocket::checkResult(int status, int& retry) break; case SSL_ERROR_WANT_READ: + m_readable = true; + retry++; + LOG((CLOG_DEBUG2 "want to read, error=%d, attempt=%d", errorCode, retry)); + break; + case SSL_ERROR_WANT_WRITE: + m_writable = true; + retry++; + LOG((CLOG_DEBUG2 "want to write, error=%d, attempt=%d", errorCode, retry)); + break; + case SSL_ERROR_WANT_CONNECT: case SSL_ERROR_WANT_ACCEPT: - // it seems like these sort of errors are part of openssl's normal behavior, - // so we should expect a very high amount of these. sleeping doesn't seem to - // help... maybe you just have to swallow the errors (yuck). retry++; - LOG((CLOG_DEBUG2 "passive ssl error, error=%d, attempt=%d", errorCode, retry)); + LOG((CLOG_DEBUG2 "want to connect, error=%d, attempt=%d", errorCode, retry)); break; case SSL_ERROR_SYSCALL: From 667b6f13c78645eb82889150f4f37dd9ed38b192 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Fri, 12 Jun 2015 18:03:28 -0700 Subject: [PATCH 5/7] Enforced secure socket rewrite on the same buffer address #4712 --- src/lib/net/TCPSocket.cpp | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/lib/net/TCPSocket.cpp b/src/lib/net/TCPSocket.cpp index 0be5876b..ab8d189b 100644 --- a/src/lib/net/TCPSocket.cpp +++ b/src/lib/net/TCPSocket.cpp @@ -469,33 +469,46 @@ TCPSocket::serviceConnected(ISocketMultiplexerJob* job, } bool needNewJob = false; - static UInt32 s_retryOutputBufferSize = 0; + + static bool s_retry = false; + static int s_retrySize = 0; + static void* s_staticBuffer = NULL; if (write) { try { // write data - int buffSize = m_outputBuffer.getSize(); + int bufferSize = 0; int bytesWrote = 0; int status = 0; - if (s_retryOutputBufferSize > 0) { - buffSize = s_retryOutputBufferSize; + if (s_retry) { + bufferSize = s_retrySize; } + else { + bufferSize = m_outputBuffer.getSize(); + s_staticBuffer = malloc(bufferSize); + memcpy(s_staticBuffer, m_outputBuffer.peek(bufferSize), bufferSize); + } - const void* buffer = m_outputBuffer.peek(buffSize); + if (bufferSize == 0) { + return job; + } if (isSecure()) { if (isSecureReady()) { - status = secureWrite(buffer, buffSize, bytesWrote); + status = secureWrite(s_staticBuffer, bufferSize, bytesWrote); if (status > 0) { - s_retryOutputBufferSize = 0; - + s_retry = false; + bufferSize = 0; + free(s_staticBuffer); + s_staticBuffer = NULL; } else if (status < 0) { return NULL; } else if (status == 0) { - s_retryOutputBufferSize = buffSize; + s_retry = true; + s_retrySize = bufferSize; return newJob(); } } @@ -504,7 +517,10 @@ TCPSocket::serviceConnected(ISocketMultiplexerJob* job, } } else { - bytesWrote = (UInt32)ARCH->writeSocket(m_socket, buffer, buffSize); + bytesWrote = (UInt32)ARCH->writeSocket(m_socket, s_staticBuffer, bufferSize); + bufferSize = 0; + free(s_staticBuffer); + s_staticBuffer = NULL; } // discard written data From ebb7edfb0fbff4d81665285c96f5b7b162f45575 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Wed, 17 Jun 2015 16:45:15 -0700 Subject: [PATCH 6/7] ChangeLog for v1.7.4-stable --- ChangeLog | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index ec6c108c..873fd434 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +v1.7.4-stable +============= +Bug #4721 - High CPU usage for Windows service on client +Bug #4712 - Unable to send clipboard with size above 1KB when using SSL +Bug #4584 - Drag and drop with SSL causes crash +Bug #3774 - Missing MinGW dependencies after install on Windows +Bug #4749 - Clipboard thread race condition causes assertion failure +Bug #4723 - Waiting for active desktop result freezes Windows service +Bug #4690 - Log line 'activeDesktop' does not use logging system +Bug #4720 - Plugin download shows 'Could not get Linux package type' error +Bug #4737 - Using error log level does not show SSL fingerprint dialog +Enhancement #4696 - Include 'ns' plugin in installers instead of wizard download +Enhancement #4796 - Improve secure socket intensive try operations +Enhancement #4327 - GUI setting to disable drag and drop feature +Enhancement #4745 - Tray icon notification for clipboard data transfer progress +Enhancement #4793 - Additional logging to output OpenSSL version + v1.7.3-stable ============= Bug #4565 - Incorrect plugin downloads on Debian and Mint From f3472c84e2cce05ca15de2e7a30f7812e19eda82 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Thu, 18 Jun 2015 13:50:38 -0700 Subject: [PATCH 7/7] Show notification only on Debug level or above #4745 --- src/gui/src/MainWindow.cpp | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index f1b1055f..1ecfde01 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -467,24 +467,26 @@ void MainWindow::checkFingerprint(const QString& line) void MainWindow::checkTransmission(const QString& line) { - if (line.contains("Transmission")) { - if (line.contains("Started")) { - setSynergyState(synergyTransfering); - } - else if (line.contains("Failed") || - line.contains("Complete") || - line.contains("Interrupted")) { - setSynergyState(synergyConnected); - } + if (appConfig().logLevel() >= 2) { + if (line.contains("Transmission")) { + if (line.contains("Started")) { + setSynergyState(synergyTransfering); + } + else if (line.contains("Failed") || + line.contains("Complete") || + line.contains("Interrupted")) { + setSynergyState(synergyConnected); + } - // NOTIFY: Title: Detail - int p1 = line.indexOf(':'); - if (p1 > 0) { - int p2 = line.indexOf(':', p1 + 1); - if (p2 > 0) { - QString title = line.mid(p1 + 2, p2 - p1 - 2); - QString detail = line.mid(p2 + 2); - m_pTrayIcon->showMessage(title, detail); + // NOTIFY: Title: Detail + int p1 = line.indexOf(':'); + if (p1 > 0) { + int p2 = line.indexOf(':', p1 + 1); + if (p2 > 0) { + QString title = line.mid(p1 + 2, p2 - p1 - 2); + QString detail = line.mid(p2 + 2); + m_pTrayIcon->showMessage(title, detail); + } } } }