]> source.dussan.org Git - tigervnc.git/commitdiff
Check the correct stream if there is more data pending
authorPierre Ossman <ossman@cendio.se>
Mon, 9 Dec 2019 15:58:07 +0000 (16:58 +0100)
committerPierre Ossman <ossman@cendio.se>
Mon, 9 Dec 2019 15:58:07 +0000 (16:58 +0100)
The input stream might no longer be the raw socket, so we need to
query what's currently active. That wrapping stream might have its
own buffering and may have more data even if the socket is drained.

vncviewer/CConn.cxx

index 6ba3276bea499c11896323bde318aac8ccf24e1f..eba5dd34d1e395817a01e737ed98090a4c4d46e5 100644 (file)
@@ -266,7 +266,7 @@ void CConn::socketEvent(FL_SOCKET fd, void *data)
        // Also check if we need to stop reading and terminate
        if (should_exit())
          break;
-    } while (cc->sock->inStream().checkNoWait(1));
+    } while (cc->getInStream()->checkNoWait(1));
   } catch (rdr::EndOfStream& e) {
     vlog.info("%s", e.str());
     exit_vncviewer();