GUACAMOLE-1059: Fine tune comments and log messages.
diff --git a/src/protocols/rdp/channels/rdpdr/rdpdr-messages.c b/src/protocols/rdp/channels/rdpdr/rdpdr-messages.c
index c03d0b9..5fee465 100644
--- a/src/protocols/rdp/channels/rdpdr/rdpdr-messages.c
+++ b/src/protocols/rdp/channels/rdpdr/rdpdr-messages.c
@@ -213,8 +213,12 @@
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);
diff --git a/src/protocols/rdp/channels/rdpdr/rdpdr.c b/src/protocols/rdp/channels/rdpdr/rdpdr.c
index d01abf4..68bb73e 100644
--- a/src/protocols/rdp/channels/rdpdr/rdpdr.c
+++ b/src/protocols/rdp/channels/rdpdr/rdpdr.c
@@ -44,8 +44,8 @@
*/
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;
}
diff --git a/src/protocols/rdp/channels/rdpsnd/rdpsnd-messages.c b/src/protocols/rdp/channels/rdpsnd/rdpsnd-messages.c
index e9eb6cc..c057cd1 100644
--- a/src/protocols/rdp/channels/rdpsnd/rdpsnd-messages.c
+++ b/src/protocols/rdp/channels/rdpsnd/rdpsnd-messages.c
@@ -50,7 +50,10 @@
/* 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. "
diff --git a/src/protocols/rdp/channels/rdpsnd/rdpsnd.c b/src/protocols/rdp/channels/rdpsnd/rdpsnd.c
index 2950d1f..40b5315 100644
--- a/src/protocols/rdp/channels/rdpsnd/rdpsnd.c
+++ b/src/protocols/rdp/channels/rdpsnd/rdpsnd.c
@@ -35,7 +35,7 @@
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 "
diff --git a/src/protocols/rdp/plugins/guacai/guacai.c b/src/protocols/rdp/plugins/guacai/guacai.c
index 577c2ef..b5383c4 100644
--- a/src/protocols/rdp/plugins/guacai/guacai.c
+++ b/src/protocols/rdp/plugins/guacai/guacai.c
@@ -54,9 +54,9 @@
/* 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;
}