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:37 UTC

[04/23] guacamole-server git commit: GUACAMOLE-269: Move constant declaration to ttymode.c

GUACAMOLE-269: Move constant declaration to ttymode.c


Project: http://git-wip-us.apache.org/repos/asf/guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-server/commit/5583748b
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-server/tree/5583748b
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-server/diff/5583748b

Branch: refs/heads/master
Commit: 5583748b548c8d4a9be5865251d956c290e1338a
Parents: f1bf70a
Author: Nick Couchman <vn...@apache.org>
Authored: Thu Feb 22 19:56:05 2018 -0500
Committer: Nick Couchman <vn...@apache.org>
Committed: Thu Mar 8 10:48:21 2018 -0500

----------------------------------------------------------------------
 src/protocols/ssh/Makefile.am |  1 +
 src/protocols/ssh/ssh.c       |  4 ++--
 src/protocols/ssh/ttymode.c   | 27 +++++++++++++++++++++++++++
 src/protocols/ssh/ttymode.h   | 10 +++-------
 4 files changed, 33 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/5583748b/src/protocols/ssh/Makefile.am
----------------------------------------------------------------------
diff --git a/src/protocols/ssh/Makefile.am b/src/protocols/ssh/Makefile.am
index 7306b8b..6a6de03 100644
--- a/src/protocols/ssh/Makefile.am
+++ b/src/protocols/ssh/Makefile.am
@@ -29,6 +29,7 @@ libguac_client_ssh_la_SOURCES = \
     settings.c                  \
     sftp.c                      \
     ssh.c                       \
+    ttymode.c                   \
     user.c
 
 noinst_HEADERS =                \

http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/5583748b/src/protocols/ssh/ssh.c
----------------------------------------------------------------------
diff --git a/src/protocols/ssh/ssh.c b/src/protocols/ssh/ssh.c
index 88614fe..62bfbb2 100644
--- a/src/protocols/ssh/ssh.c
+++ b/src/protocols/ssh/ssh.c
@@ -298,8 +298,8 @@ void* ssh_client_thread(void* data) {
     }
 
     /* Request PTY */
-    if (libssh2_channel_request_pty_ex(ssh_client->term_channel, "linux", sizeof("linux")-1, guac_tty_modes,
-            sizeof(guac_tty_modes), ssh_client->term->term_width, ssh_client->term->term_height, 0, 0)) {
+    if (libssh2_channel_request_pty_ex(ssh_client->term_channel, "linux", sizeof("linux")-1, GUAC_SSH_TTY_MODES,
+            sizeof(GUAC_SSH_TTY_MODES), 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/5583748b/src/protocols/ssh/ttymode.c
----------------------------------------------------------------------
diff --git a/src/protocols/ssh/ttymode.c b/src/protocols/ssh/ttymode.c
new file mode 100644
index 0000000..e5baff4
--- /dev/null
+++ b/src/protocols/ssh/ttymode.c
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "config.h"
+#include "ttymode.h"
+
+const char GUAC_SSH_TTY_MODES[6] = {
+    GUAC_SSH_TTY_OP_VERASE,
+    0, 0, 0, GUAC_SSH_TERM_DEFAULT_BACKSPACE,
+    GUAC_SSH_TTY_OP_END
+};

http://git-wip-us.apache.org/repos/asf/guacamole-server/blob/5583748b/src/protocols/ssh/ttymode.h
----------------------------------------------------------------------
diff --git a/src/protocols/ssh/ttymode.h b/src/protocols/ssh/ttymode.h
index f248ed8..524051e 100644
--- a/src/protocols/ssh/ttymode.h
+++ b/src/protocols/ssh/ttymode.h
@@ -22,15 +22,11 @@
 
 #include "config.h"
 
-#define TTY_OP_END 0
-#define TTY_OP_VERASE 3
+#define GUAC_SSH_TTY_OP_END 0
+#define GUAC_SSH_TTY_OP_VERASE 3
 
 #define GUAC_SSH_TERM_DEFAULT_BACKSPACE 127
 
-char guac_tty_modes[] = {
-    TTY_OP_VERASE,
-    0, 0, 0, GUAC_SSH_TERM_DEFAULT_BACKSPACE,
-    TTY_OP_END
-};
+extern const char GUAC_SSH_TTY_MODES[6];
 
 #endif