From 5c108b657890d9f2a92de1060884448448b6e565 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 27 Dec 2023 16:32:36 +0100 Subject: [PATCH] Update processMsg() description This method is no longer blocking, so the description needed to be adjusted. --- common/rfb/CConnection.h | 15 +++++---------- common/rfb/SConnection.h | 7 +++++-- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/common/rfb/CConnection.h b/common/rfb/CConnection.h index 31dc687f..b30a997b 100644 --- a/common/rfb/CConnection.h +++ b/common/rfb/CConnection.h @@ -74,16 +74,11 @@ namespace rfb { // there is data to read on the InStream. void initialiseProtocol(); - // processMsg() should be called whenever there is either: - // - data available on the underlying network stream - // In this case, processMsg may return without processing an RFB message, - // if the available data does not result in an RFB message being ready - // to handle. e.g. if data is encrypted. - // NB: This makes it safe to call processMsg() in response to select() - // - data available on the CConnection's current InStream - // In this case, processMsg should always process the available RFB - // message before returning. - // NB: In either case, you must have called initialiseProtocol() first. + // processMsg() should be called whenever there is data available on + // the CConnection's current InStream. It will process at most one + // RFB message before returning. If there was insufficient data, + // then it will return false and should be called again once more + // data is available. bool processMsg(); // close() gracefully shuts down the connection to the server and diff --git a/common/rfb/SConnection.h b/common/rfb/SConnection.h index 2ac53269..46b427ed 100644 --- a/common/rfb/SConnection.h +++ b/common/rfb/SConnection.h @@ -61,8 +61,11 @@ namespace rfb { // there is data to read on the InStream. void initialiseProtocol(); - // processMsg() should be called whenever there is data to read on the - // InStream. You must have called initialiseProtocol() first. + // processMsg() should be called whenever there is data available on + // the CConnection's current InStream. It will process at most one + // RFB message before returning. If there was insufficient data, + // then it will return false and should be called again once more + // data is available. bool processMsg(); // approveConnection() is called to either accept or reject the connection. -- 2.39.5