]> source.dussan.org Git - tigervnc.git/commitdiff
Add debug logging for ignored clipboard events
authorPierre Ossman <ossman@cendio.se>
Tue, 5 Jan 2021 09:25:54 +0000 (10:25 +0100)
committerPierre Ossman <ossman@cendio.se>
Tue, 5 Jan 2021 09:25:54 +0000 (10:25 +0100)
common/rfb/CConnection.cxx
common/rfb/SConnection.cxx
common/rfb/VNCServerST.cxx

index 6632efa8b80146f42eb1d8384d1ca840ab16e3fd..11cf29c900f7d3d9ad78f5b81956af8c151814d6 100644 (file)
@@ -495,10 +495,14 @@ void CConnection::handleClipboardCaps(rdr::U32 flags,
 
 void CConnection::handleClipboardRequest(rdr::U32 flags)
 {
-  if (!(flags & rfb::clipboardUTF8))
+  if (!(flags & rfb::clipboardUTF8)) {
+    vlog.debug("Ignoring clipboard request for unsupported formats 0x%x", flags);
     return;
-  if (!hasLocalClipboard)
+  }
+  if (!hasLocalClipboard) {
+    vlog.debug("Ignoring unexpected clipboard request");
     return;
+  }
   handleClipboardRequest();
 }
 
@@ -525,8 +529,10 @@ void CConnection::handleClipboardProvide(rdr::U32 flags,
                                          const size_t* lengths,
                                          const rdr::U8* const* data)
 {
-  if (!(flags & rfb::clipboardUTF8))
+  if (!(flags & rfb::clipboardUTF8)) {
+    vlog.debug("Ignoring clipboard provide with unsupported formats 0x%x", flags);
     return;
+  }
 
   strFree(serverClipboard);
   serverClipboard = NULL;
index d44ff786a4c08c583bde27f56d5924a47be3cf19..683d29b60572182d73626fadc87153eca923e4c7 100644 (file)
@@ -327,10 +327,14 @@ void SConnection::clientCutText(const char* str)
 
 void SConnection::handleClipboardRequest(rdr::U32 flags)
 {
-  if (!(flags & rfb::clipboardUTF8))
+  if (!(flags & rfb::clipboardUTF8)) {
+    vlog.debug("Ignoring clipboard request for unsupported formats 0x%x", flags);
     return;
-  if (!hasLocalClipboard)
+  }
+  if (!hasLocalClipboard) {
+    vlog.debug("Ignoring unexpected clipboard request");
     return;
+  }
   handleClipboardRequest();
 }
 
@@ -357,8 +361,10 @@ void SConnection::handleClipboardProvide(rdr::U32 flags,
                                          const size_t* lengths,
                                          const rdr::U8* const* data)
 {
-  if (!(flags & rfb::clipboardUTF8))
+  if (!(flags & rfb::clipboardUTF8)) {
+    vlog.debug("Ignoring clipboard provide with unsupported formats 0x%x", flags);
     return;
+  }
 
   strFree(clientClipboard);
   clientClipboard = NULL;
index 17e963e81c7d3b840927bbee1eb81e4b2c2f7df4..fe0608572f3b9a79187252196b7f4eb9c3b22f63 100644 (file)
@@ -515,8 +515,10 @@ void VNCServerST::handleClipboardAnnounce(VNCSConnectionST* client,
 void VNCServerST::handleClipboardData(VNCSConnectionST* client,
                                       const char* data)
 {
-  if (client != clipboardClient)
+  if (client != clipboardClient) {
+    slog.debug("Ignoring unexpected clipboard data");
     return;
+  }
   desktop->handleClipboardData(data);
 }