You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by "mike-jumper (via GitHub)" <gi...@apache.org> on 2023/08/23 22:40:33 UTC
[GitHub] [guacamole-client] mike-jumper commented on a diff in pull request #906: GUACAMOLE-1849: Fix a bug in Parser.js where receive would reparse instructions multiple times.
mike-jumper commented on code in PR #906:
URL: https://github.com/apache/guacamole-client/pull/906#discussion_r1303611284
##########
guacamole-common-js/src/main/webapp/modules/Parser.js:
##########
@@ -209,8 +209,14 @@ Guacamole.Parser = function Parser() {
// completely parsed, so that the next call to receive()
// need not append to the buffer unnecessarily
if (elementEnd + 1 === buffer.length) {
- elementEnd = -1;
- buffer = '';
+ if (isBuffer) {
+ startIndex = buffer.length;
+ break;
+ }
+ else {
+ elementEnd = -1;
+ buffer = '';
+ }
}
Review Comment:
Would it make more sense to just add `!isBuffer &&` to the overall condition here? I would think that the existing logic will already ensure `startIndex` is set correctly and that the loop breaks once the buffer is exhausted.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org