diff --git a/src/lib/client/ServerProxy.cpp b/src/lib/client/ServerProxy.cpp index 07ab771b..9be6e670 100644 --- a/src/lib/client/ServerProxy.cpp +++ b/src/lib/client/ServerProxy.cpp @@ -564,6 +564,12 @@ ServerProxy::setClipboard() Clipboard clipboard; clipboard.unmarshall(dataCached, 0); m_client->setClipboard(id, &clipboard); + + LOG((CLOG_NOTIFY "Clipboard Transmission Complete: Clipboard is updated.")); + } + else if (r == kStart) { + size_t size = ClipboardChunk::getExpectedSize(); + LOG((CLOG_NOTIFY "Clipboard Transmission Started: Start receiving %u bytes of clipboard data", size)); } } diff --git a/src/lib/server/ClientProxy1_6.cpp b/src/lib/server/ClientProxy1_6.cpp index 8b429cca..08bd9b90 100644 --- a/src/lib/server/ClientProxy1_6.cpp +++ b/src/lib/server/ClientProxy1_6.cpp @@ -91,6 +91,11 @@ ClientProxy1_6::recvClipboard() info->m_sequenceNumber = seq; m_events->addEvent(Event(m_events->forClipboard().clipboardChanged(), getEventTarget(), info)); + LOG((CLOG_NOTIFY "Clipboard Transmission Complete: Clipboard is updated")); + } + else if (r == kStart) { + size_t size = ClipboardChunk::getExpectedSize(); + LOG((CLOG_NOTIFY "Clipboard Transmission Started: Start receiving %u bytes of clipboard data", size)); } return true; diff --git a/src/lib/server/Server.cpp b/src/lib/server/Server.cpp index 5c56adb3..6942e356 100644 --- a/src/lib/server/Server.cpp +++ b/src/lib/server/Server.cpp @@ -1521,6 +1521,7 @@ Server::onClipboardChanged(BaseClientProxy* sender, // ignore update if sequence number is old if (seqNum < clipboard.m_clipboardSeqNum) { LOG((CLOG_INFO "ignored screen \"%s\" update of clipboard %d (missequenced)", getName(sender).c_str(), id)); + LOG((CLOG_NOTIFY "Clipboard Transmission Ignored: Sequence number is old.")); return; } @@ -1534,6 +1535,7 @@ Server::onClipboardChanged(BaseClientProxy* sender, String data = clipboard.m_clipboard.marshall(); if (data == clipboard.m_clipboardData) { LOG((CLOG_DEBUG "ignored screen \"%s\" update of clipboard %d (unchanged)", clipboard.m_clipboardOwner.c_str(), id)); + LOG((CLOG_NOTIFY "Clipboard Transmission Ignored: Clipboard data hasn't changed.")); return; } diff --git a/src/lib/synergy/ClipboardChunk.cpp b/src/lib/synergy/ClipboardChunk.cpp index 0a0cc5c6..8b124d6b 100644 --- a/src/lib/synergy/ClipboardChunk.cpp +++ b/src/lib/synergy/ClipboardChunk.cpp @@ -22,6 +22,8 @@ #include "io/IStream.h" #include "base/Log.h" +size_t ClipboardChunk::s_expectedSize = 0; + ClipboardChunk::ClipboardChunk(size_t size) : Chunk(size) { @@ -89,7 +91,6 @@ ClipboardChunk::assemble(synergy::IStream* stream, ClipboardID& id, UInt32& sequence) { - static size_t expectedSize; UInt8 mark; String data; @@ -98,7 +99,7 @@ ClipboardChunk::assemble(synergy::IStream* stream, } if (mark == kDataStart) { - expectedSize = synergy::string::stringToSizeType(data); + s_expectedSize = synergy::string::stringToSizeType(data); LOG((CLOG_DEBUG "start receiving clipboard data")); dataCached.clear(); return kNotFinish; @@ -112,8 +113,8 @@ ClipboardChunk::assemble(synergy::IStream* stream, if (id >= kClipboardEnd) { return kError; } - else if (expectedSize != dataCached.size()) { - LOG((CLOG_ERR "corrupted clipboard data, expected size=%d actual size=%d", expectedSize, dataCached.size())); + else if (s_expectedSize != dataCached.size()) { + LOG((CLOG_ERR "corrupted clipboard data, expected size=%d actual size=%d", s_expectedSize, dataCached.size())); return kError; } return kFinish; diff --git a/src/lib/synergy/ClipboardChunk.h b/src/lib/synergy/ClipboardChunk.h index 3715b941..459f28b2 100644 --- a/src/lib/synergy/ClipboardChunk.h +++ b/src/lib/synergy/ClipboardChunk.h @@ -52,4 +52,9 @@ public: UInt32& sequence); static void send(synergy::IStream* stream, void* data); + + static size_t getExpectedSize() { return s_expectedSize; } + +private: + static size_t s_expectedSize; }; diff --git a/src/lib/synergy/StreamChunker.cpp b/src/lib/synergy/StreamChunker.cpp index 46230ccd..c4c70f4b 100644 --- a/src/lib/synergy/StreamChunker.cpp +++ b/src/lib/synergy/StreamChunker.cpp @@ -78,6 +78,7 @@ StreamChunker::sendFile( while (true) { if (s_interruptFile) { s_interruptFile = false; + LOG((CLOG_NOTIFY "File Transmission Interrupted: The previous file transmission is interrupted.")); break; } @@ -142,6 +143,7 @@ StreamChunker::sendClipboard( while (true) { if (s_interruptClipboard) { s_interruptClipboard = false; + LOG((CLOG_NOTIFY "Clipboard Transmission Interrupted: The previous clipboard transmission is interrupted.")); break; }