GUACAMOLE-1059: Fine tune comments and log messages.

This commit is contained in:
Nick Couchman 2020-05-06 10:17:20 -04:00
parent 47bf3ab672
commit 557e2f5944
5 changed files with 15 additions and 8 deletions

View File

@ -213,8 +213,12 @@ void guac_rdpdr_process_server_announce(guac_rdp_common_svc* svc,
unsigned int major, minor, client_id;
/* Stream should contain at least 8 bytes (UINT16 + UINT16 + UINT32) */
if (Stream_GetRemainingLength(input_stream) < 8)
if (Stream_GetRemainingLength(input_stream) < 8) {
guac_client_log(svc->client, GUAC_LOG_WARNING, "Server Announce "
"Request PDU does not contain the expected number of bytes. "
"Device redirection may not work as expected.");
return;
}
Stream_Read_UINT16(input_stream, major);
Stream_Read_UINT16(input_stream, minor);

View File

@ -44,8 +44,8 @@ void guac_rdpdr_process_receive(guac_rdp_common_svc* svc,
*/
if (Stream_GetRemainingLength(input_stream) < 4) {
guac_client_log(svc->client, GUAC_LOG_WARNING, "Device redirection "
"channel receive Stream does not contain the expected number "
"of bytes. Device redirection may not function as expected.");
"channel PDU header does not contain the expected number of "
"bytes. Device redirection may not function as expected.");
return;
}

View File

@ -50,7 +50,10 @@ void guac_rdpsnd_formats_handler(guac_rdp_common_svc* svc,
/* Reset own format count */
rdpsnd->format_count = 0;
/* Check to make sure the stream has at least 20 bytes, which */
/*
* Check to make sure the stream has at least 20 bytes (14 byte seek,
* 2 x UTF16 reads, and 2 x UTF8 seeks).
*/
if (Stream_GetRemainingLength(input_stream) < 20) {
guac_client_log(client, GUAC_LOG_WARNING, "Server Audio Formats and "
"Version PDU does not contain the expected number of bytes. "

View File

@ -35,7 +35,7 @@ void guac_rdpsnd_process_receive(guac_rdp_common_svc* svc,
guac_rdpsnd* rdpsnd = (guac_rdpsnd*) svc->data;
guac_rdpsnd_pdu_header header;
/* Check that we at least the 4 byte header (UINT8 + UINT8 + UINT16) */
/* Check that we have at least the 4 byte header (UINT8 + UINT8 + UINT16) */
if (Stream_GetRemainingLength(input_stream) < 4) {
guac_client_log(svc->client, GUAC_LOG_WARNING, "Audio Stream does not "
"contain the expected number of bytes. Audio redirection may "

View File

@ -54,9 +54,9 @@ static void guac_rdp_ai_handle_data(guac_client* client,
/* Verify we have at least 1 byte in the stream (UINT8) */
if (Stream_GetRemainingLength(stream) < 1) {
guac_client_log(client, GUAC_LOG_WARNING, "Audio input stream does not "
"contain the expected number of bytes. Audio input redirection "
"may not work as expected.");
guac_client_log(client, GUAC_LOG_WARNING, "Audio input PDU header does "
"not contain the expected number of bytes. Audio input "
"redirection may not work as expected.");
return;
}