GUACAMOLE-269: Move constant declaration to ttymode.c

This commit is contained in:
Nick Couchman 2018-02-22 19:56:05 -05:00
parent f1bf70a4a2
commit 5583748b54
4 changed files with 33 additions and 9 deletions

View File

@ -29,6 +29,7 @@ libguac_client_ssh_la_SOURCES = \
settings.c \
sftp.c \
ssh.c \
ttymode.c \
user.c
noinst_HEADERS = \

View File

@ -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;
}

View File

@ -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
};

View File

@ -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