You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by mj...@apache.org on 2018/04/02 19:20:40 UTC
[07/23] guacamole-server git commit: GUACAMOLE-269: Fix minor style
issues and update comments.
GUACAMOLE-269: Fix minor style issues and update comments.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-server/commit/c3e1b2af
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-server/tree/c3e1b2af
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-server/diff/c3e1b2af
Branch: refs/heads/master
Commit: c3e1b2afefb76a12a8c21361c15195e05fecfc84
Parents: 64ca77f
Author: Nick Couchman <vn...@apache.org>
Authored: Tue Feb 27 15:49:57 2018 -0500
Committer: Nick Couchman <vn...@apache.org>
Committed: Thu Mar 8 10:48:22 2018 -0500
----------------------------------------------------------------------
src/protocols/ssh/settings.c | 4 ++--
src/protocols/ssh/ttymode.c | 7 +++++--
src/protocols/telnet/settings.c | 3 ++-
src/protocols/telnet/settings.h | 6 +++---
src/terminal/terminal.c | 3 ++-
src/terminal/terminal/terminal.h | 4 ++--
6 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/c3e1b2af/src/protocols/ssh/settings.c
----------------------------------------------------------------------
diff --git a/src/protocols/ssh/settings.c b/src/protocols/ssh/settings.c
index 89b6e82..983f7f0 100644
--- a/src/protocols/ssh/settings.c
+++ b/src/protocols/ssh/settings.c
@@ -211,8 +211,8 @@ enum SSH_ARGS_IDX {
IDX_SERVER_ALIVE_INTERVAL,
/**
- * The ASCII code, in decimal, to send for the backspace key, as configured
- * by the SSH connection from the client. By default this will be 0x7f,
+ * The ASCII code, as an integer, to send for the backspace key, as configured
+ * by the SSH connection from the client. By default this will be 127,
* the ASCII DELETE code.
*/
IDX_BACKSPACE,
http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/c3e1b2af/src/protocols/ssh/ttymode.c
----------------------------------------------------------------------
diff --git a/src/protocols/ssh/ttymode.c b/src/protocols/ssh/ttymode.c
index 02fb54b..3983090 100644
--- a/src/protocols/ssh/ttymode.c
+++ b/src/protocols/ssh/ttymode.c
@@ -36,17 +36,20 @@ guac_ssh_ttymodes* guac_ssh_ttymodes_init() {
}
void guac_ssh_ttymodes_add(guac_ssh_ttymodes *tty_modes, char opcode, uint32_t value) {
+ /* Increment number of opcodes */
tty_modes->num_opcodes++;
+
+ /* Increase size of the pointer array */
tty_modes->ttymode_array = realloc(tty_modes->ttymode_array, sizeof(guac_ssh_ttymode) * tty_modes->num_opcodes);
+
+ /* Add new values */
tty_modes->ttymode_array[tty_modes->num_opcodes - 1].opcode = opcode;
tty_modes->ttymode_array[tty_modes->num_opcodes - 1].value = value;
-
}
int guac_ssh_ttymodes_size(guac_ssh_ttymodes *tty_modes) {
/* Each opcode pair is 5 bytes (1 opcode, 4 value)
Add one for the ending opcode */
-
return (tty_modes->num_opcodes * 5) + 1;
}
http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/c3e1b2af/src/protocols/telnet/settings.c
----------------------------------------------------------------------
diff --git a/src/protocols/telnet/settings.c b/src/protocols/telnet/settings.c
index acb1f90..b49b773 100644
--- a/src/protocols/telnet/settings.c
+++ b/src/protocols/telnet/settings.c
@@ -176,7 +176,8 @@ enum TELNET_ARGS_IDX {
IDX_READ_ONLY,
/**
- * ASCII code to use for the backspace key, or 127 if not specified.
+ * ASCII code, as an integer to use for the backspace key, or 127
+ * if not specified.
*/
IDX_BACKSPACE,
http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/c3e1b2af/src/protocols/telnet/settings.h
----------------------------------------------------------------------
diff --git a/src/protocols/telnet/settings.h b/src/protocols/telnet/settings.h
index 71c807a..9bc3dc3 100644
--- a/src/protocols/telnet/settings.h
+++ b/src/protocols/telnet/settings.h
@@ -208,9 +208,9 @@ typedef struct guac_telnet_settings {
bool recording_include_keys;
/**
- * The ASCII code, in decimal, that the telnet client will use when the
- * backspace key is pressed. By default, this is 0x7f, ASCII delete,
- * but can be configured in the client settings.
+ * The ASCII code, as an integer, that the telnet client will use when the
+ * backspace key is pressed. By default, this is 127, ASCII delete, if
+ * not specified in the client settings.
*/
int backspace;
http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/c3e1b2af/src/terminal/terminal.c
----------------------------------------------------------------------
diff --git a/src/terminal/terminal.c b/src/terminal/terminal.c
index 70a2640..c19bd83 100644
--- a/src/terminal/terminal.c
+++ b/src/terminal/terminal.c
@@ -1598,11 +1598,12 @@ static int __guac_terminal_send_key(guac_terminal* term, int keysym, int pressed
/* Non-printable keys */
else {
+ /* Backspace can vary based on configuration of terminal by client. */
if (keysym == 0xFF08) {
char* backspace_str = malloc(sizeof(char) * 2);
backspace_str[0] = term->backspace;
backspace_str[1] = '\0';
- return guac_terminal_send_string(term, backspace_str); /* Backspace */
+ return guac_terminal_send_string(term, backspace_str);
}
if (keysym == 0xFF09 || keysym == 0xFF89) return guac_terminal_send_string(term, "\x09"); /* Tab */
if (keysym == 0xFF0D || keysym == 0xFF8D) return guac_terminal_send_string(term, "\x0D"); /* Enter */
http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/c3e1b2af/src/terminal/terminal/terminal.h
----------------------------------------------------------------------
diff --git a/src/terminal/terminal/terminal.h b/src/terminal/terminal/terminal.h
index 90cf06a..c071b40 100644
--- a/src/terminal/terminal/terminal.h
+++ b/src/terminal/terminal/terminal.h
@@ -433,7 +433,7 @@ struct guac_terminal {
guac_common_clipboard* clipboard;
/**
- * Hexidecimal ASCII code sent when backspace is pressed.
+ * ASCII character to send when backspace is pressed.
*/
char backspace;
@@ -470,7 +470,7 @@ struct guac_terminal {
* GUAC_TERMINAL_SCHEME_GRAY_BLACK.
*
* @param backspace
- * The decimal ASCII code to send when backspace is pressed in
+ * The integer ASCII code to send when backspace is pressed in
* this terminal.
*
* @return