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:41 UTC
[08/23] guacamole-server git commit: GUACAMOLE-269: Change struct to
struct pointer.
GUACAMOLE-269: Change struct to struct pointer.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-server/commit/64ca77f3
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-server/tree/64ca77f3
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-server/diff/64ca77f3
Branch: refs/heads/master
Commit: 64ca77f3a59ea69ac42812705744ebece235ddae
Parents: 33cca46
Author: Nick Couchman <vn...@apache.org>
Authored: Tue Feb 27 09:59:18 2018 -0500
Committer: Nick Couchman <vn...@apache.org>
Committed: Thu Mar 8 10:48:22 2018 -0500
----------------------------------------------------------------------
src/protocols/ssh/ssh.c | 6 +++---
src/protocols/ssh/ttymode.c | 9 ++++-----
src/protocols/ssh/ttymode.h | 2 +-
3 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/64ca77f3/src/protocols/ssh/ssh.c
----------------------------------------------------------------------
diff --git a/src/protocols/ssh/ssh.c b/src/protocols/ssh/ssh.c
index 6aecde0..eac4ece 100644
--- a/src/protocols/ssh/ssh.c
+++ b/src/protocols/ssh/ssh.c
@@ -193,7 +193,7 @@ void* ssh_client_thread(void* data) {
}
/* Initialize a ttymode array */
- guac_ssh_ttymodes ssh_ttymodes = guac_ssh_ttymodes_init();
+ guac_ssh_ttymodes* ssh_ttymodes = guac_ssh_ttymodes_init();
/* Set up screen recording, if requested */
if (settings->recording_path != NULL) {
@@ -213,7 +213,7 @@ void* ssh_client_thread(void* data) {
settings->color_scheme, settings->backspace);
/* Add the backspace key to the ttymode array */
- guac_ssh_ttymodes_add(&ssh_ttymodes, GUAC_SSH_TTY_OP_VERASE, settings->backspace);
+ guac_ssh_ttymodes_add(ssh_ttymodes, GUAC_SSH_TTY_OP_VERASE, settings->backspace);
/* Fail if terminal init failed */
if (ssh_client->term == NULL) {
@@ -305,7 +305,7 @@ void* ssh_client_thread(void* data) {
/* Request PTY */
if (libssh2_channel_request_pty_ex(ssh_client->term_channel, "linux", sizeof("linux")-1,
- guac_ssh_ttymodes_to_array(&ssh_ttymodes), guac_ssh_ttymodes_size(&ssh_ttymodes),
+ guac_ssh_ttymodes_to_array(ssh_ttymodes), guac_ssh_ttymodes_size(ssh_ttymodes),
ssh_client->term->term_width, ssh_client->term->term_height, 0, 0)) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR, "Unable to allocate PTY.");
return NULL;
http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/64ca77f3/src/protocols/ssh/ttymode.c
----------------------------------------------------------------------
diff --git a/src/protocols/ssh/ttymode.c b/src/protocols/ssh/ttymode.c
index f21e9f7..02fb54b 100644
--- a/src/protocols/ssh/ttymode.c
+++ b/src/protocols/ssh/ttymode.c
@@ -23,15 +23,14 @@
#include <stdlib.h>
#include <string.h>
-guac_ssh_ttymodes guac_ssh_ttymodes_init() {
+guac_ssh_ttymodes* guac_ssh_ttymodes_init() {
/* Simple allocation for a placeholder */
guac_ssh_ttymode* ttymode_array = malloc(1);
/* Set up the initial data structure. */
- guac_ssh_ttymodes empty_modes = {
- ttymode_array,
- 0
- };
+ guac_ssh_ttymodes* empty_modes = malloc(sizeof(guac_ssh_ttymodes));
+ empty_modes->ttymode_array = ttymode_array;
+ empty_modes->num_opcodes = 0;
return empty_modes;
}
http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/64ca77f3/src/protocols/ssh/ttymode.h
----------------------------------------------------------------------
diff --git a/src/protocols/ssh/ttymode.h b/src/protocols/ssh/ttymode.h
index ca5569d..ecc57de 100644
--- a/src/protocols/ssh/ttymode.h
+++ b/src/protocols/ssh/ttymode.h
@@ -62,7 +62,7 @@ typedef struct guac_ssh_ttymodes {
* with a null array of guac_ssh_ttymode and opcodes
* set to zero.
*/
-guac_ssh_ttymodes guac_ssh_ttymodes_init();
+guac_ssh_ttymodes* guac_ssh_ttymodes_init();
/**
* Add an item to the opcode array. This resizes the