neandrake commented on PR #316: URL: https://github.com/apache/guacamole-server/pull/316#issuecomment-1483939885
@mike-jumper That was one I wasn't fully sure about and wanted to ask about though the change did appear to resolve the issue. I was running into issues where new users joining, and sometimes leaving I believe, would cause a corruption in the protocol stream. The symptom was getting an exception on the web server, ``` GuacamoleServerException: Non-numeric character in element length. ``` The most common way to reproduce was to have one user connect to use the workstation and have another user connect to observe. Then have the second user refresh the page to establish new tunnel connections and ~1 in 5 would cause the issue. After observing the exception and then logging the protocol stream on the web server there seemed to be a pattern of a corruption in the protocol, where an instruction after a SYNC would be truncated early - e.g. a BLOB with size 100 would only actually have 50 bytes. Through investigating when the x driver sends SYNC commands it appeared as though places where `guac_socket_flush()` were the source of the corruption. My theory was that while the socket has a lock/mutex when sending data if there is a need to flush the data then that would need to be locked as part of the initial sending of the data. This additional lock did appear to resolve the corruption issues. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
