From b0c870cbeb77b69c5bf1046646b5253b411a546a Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 18 Oct 2016 15:51:29 +0300 Subject: [PATCH] Expand documentation for getAbbreviatedMessage() It has always been the intent that getAbbreviatedMessage() is for producing human-readbale nice output for logging purposes only. But this has not been mentioned, so (naturally) the function has been misused. Sigh. --- loolwsd/LOOLProtocol.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/loolwsd/LOOLProtocol.hpp b/loolwsd/LOOLProtocol.hpp index 6120e0cb7..3857a4e86 100644 --- a/loolwsd/LOOLProtocol.hpp +++ b/loolwsd/LOOLProtocol.hpp @@ -133,7 +133,11 @@ namespace LOOLProtocol return getFirstLine(message.data(), message.size()); } - /// Returns an abbereviation of the message (the first line, indicating truncation). + /// Returns an abbereviation of the message (the first line, indicating truncation). We assume + /// that it adhers to the LOOL protocol, i.e. that there is always a first (or only) line that + /// is in printable UTF-8. I.e. no encoding of binary bytes is done. The format of the result is + /// not guaranteed to be stable. It is to be used for logging purposes only, not for decoding + /// protocol frames. inline std::string getAbbreviatedMessage(const char *message, const int length) {