#4740 Removed clipboard interrupt code

This commit is contained in:
Xinyu Hou 2016-09-13 10:50:37 -04:00 committed by Andrew Nelless
parent fc6ce84ee4
commit d14d907ac1
2 changed files with 0 additions and 43 deletions

View File

@ -39,8 +39,6 @@ using namespace std;
#define CHUNK_SIZE 512 * 1024; // 512kb #define CHUNK_SIZE 512 * 1024; // 512kb
bool StreamChunker::s_isChunkingClipboard = false;
bool StreamChunker::s_interruptClipboard = false;
bool StreamChunker::s_isChunkingFile = false; bool StreamChunker::s_isChunkingFile = false;
bool StreamChunker::s_interruptFile = false; bool StreamChunker::s_interruptFile = false;
Mutex* StreamChunker::s_interruptMutex = NULL; Mutex* StreamChunker::s_interruptMutex = NULL;
@ -129,8 +127,6 @@ StreamChunker::sendClipboard(
IEventQueue* events, IEventQueue* events,
void* eventTarget) void* eventTarget)
{ {
s_isChunkingClipboard = true;
// send first message (data size) // send first message (data size)
String dataSize = synergy::string::sizeTypeToString(size); String dataSize = synergy::string::sizeTypeToString(size);
ClipboardChunk* sizeMessage = ClipboardChunk::start(id, sequence, dataSize); ClipboardChunk* sizeMessage = ClipboardChunk::start(id, sequence, dataSize);
@ -144,17 +140,6 @@ StreamChunker::sendClipboard(
sendStopwatch.start(); sendStopwatch.start();
while (true) { while (true) {
{
if (s_interruptMutex == NULL) {
s_interruptMutex = new Mutex();
}
Lock lock(s_interruptMutex);
if (s_interruptClipboard) {
LOG((CLOG_DEBUG "clipboard transmission interrupted"));
break;
}
}
if (sendStopwatch.getTime() > SEND_THRESHOLD) { if (sendStopwatch.getTime() > SEND_THRESHOLD) {
events->addEvent(Event(events->forFile().keepAlive(), eventTarget)); events->addEvent(Event(events->forFile().keepAlive(), eventTarget));
@ -183,8 +168,6 @@ StreamChunker::sendClipboard(
events->addEvent(Event(events->forClipboard().clipboardSending(), eventTarget, end)); events->addEvent(Event(events->forClipboard().clipboardSending(), eventTarget, end));
LOG((CLOG_DEBUG "sent clipboard size=%d", sentLength)); LOG((CLOG_DEBUG "sent clipboard size=%d", sentLength));
s_isChunkingClipboard = false;
} }
void void
@ -195,26 +178,3 @@ StreamChunker::interruptFile()
LOG((CLOG_INFO "previous dragged file has become invalid")); LOG((CLOG_INFO "previous dragged file has become invalid"));
} }
} }
void
StreamChunker::setClipboardInterrupt(bool interrupt)
{
if (s_interruptMutex == NULL) {
s_interruptMutex = new Mutex();
}
Lock lock(s_interruptMutex);
if (interrupt) {
if (s_isChunkingClipboard) {
s_interruptClipboard = interrupt;
LOG((CLOG_INFO "previous clipboard data has become invalid"));
}
else {
LOG((CLOG_DEBUG "no clipboard to interrupt"));
}
}
else {
s_interruptClipboard = interrupt;
LOG((CLOG_DEBUG "reset clipboard interrupt"));
}
}

View File

@ -37,11 +37,8 @@ public:
IEventQueue* events, IEventQueue* events,
void* eventTarget); void* eventTarget);
static void interruptFile(); static void interruptFile();
static void setClipboardInterrupt(bool interrupt);
private: private:
static bool s_isChunkingClipboard;
static bool s_interruptClipboard;
static bool s_isChunkingFile; static bool s_isChunkingFile;
static bool s_interruptFile; static bool s_interruptFile;
static Mutex* s_interruptMutex; static Mutex* s_interruptMutex;