Skip to content

Commit 523c890

Browse files
Merge pull request #712 from ejohnstown/echo-refresh
Echoserver Refresh
2 parents 93853ae + 63a3068 commit 523c890

4 files changed

Lines changed: 30 additions & 2 deletions

File tree

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ AM_CONDITIONAL([BUILD_KEYGEN],[test "x$ENABLED_KEYGEN" = "xyes"])
313313
AM_CONDITIONAL([BUILD_SCP],[test "x$ENABLED_SCP" = "xyes"])
314314
AM_CONDITIONAL([BUILD_SFTP],[test "x$ENABLED_SFTP" = "xyes"])
315315
AM_CONDITIONAL([BUILD_FWD],[test "x$ENABLED_FWD" = "xyes"])
316-
AM_CONDITIONAL([BUILD_TERM],[test "x$ENABLED_TERM" = "xyes"])
316+
AM_CONDITIONAL([BUILD_TERM],[test "x$ENABLED_PTERM" = "xyes"])
317317
AM_CONDITIONAL([BUILD_SHELL],[test "x$ENABLED_SHELL" = "xyes"])
318318
AM_CONDITIONAL([BUILD_AGENT],[test "x$ENABLED_AGENT" = "xyes"])
319319
AM_CONDITIONAL([BUILD_SSHD],[test "x$ENABLED_SSHD" = "xyes"])

examples/echoserver/echoserver.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,25 @@ static int ssh_worker(thread_ctx_t* threadCtx)
864864
ChildRunning = 1;
865865
#endif
866866

867+
#if defined(WOLFSSH_TERM) && defined(WOLFSSH_SHELL)
868+
/* set initial size of terminal based on saved size */
869+
#if defined(HAVE_SYS_IOCTL_H)
870+
wolfSSH_DoModes(ssh->modes, ssh->modesSz, childFd);
871+
{
872+
struct winsize s = {0};
873+
874+
s.ws_col = ssh->widthChar;
875+
s.ws_row = ssh->heightRows;
876+
s.ws_xpixel = ssh->widthPixels;
877+
s.ws_ypixel = ssh->heightPixels;
878+
879+
ioctl(childFd, TIOCSWINSZ, &s);
880+
}
881+
#endif /* HAVE_SYS_IOCTL_H */
882+
883+
wolfSSH_SetTerminalResizeCtx(ssh, (void*)&childFd);
884+
#endif /* WOLFSSH_TERM && WOLFSSH_SHELL */
885+
867886
while (ChildRunning) {
868887
fd_set readFds;
869888
WS_SOCKET_T maxFd;

examples/echoserver/include.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ examples_echoserver_echoserver_SOURCES = examples/echoserver/echoserver.c \
77
examples/echoserver/echoserver.h
88
examples_echoserver_echoserver_LDADD = src/libwolfssh.la
99
examples_echoserver_echoserver_DEPENDENCIES = src/libwolfssh.la
10-
examples_echoserver_echoserver_CFLAGS = $(AM_CFLAGS)
10+
examples_echoserver_echoserver_CFLAGS = $(AM_CFLAGS) ${AM_CPPFLAGS}
1111
endif

tests/include.am

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ endif
1818
if BUILD_SFTP
1919
tests_unit_test_CPPFLAGS += -DWOLFSSH_SFTP
2020
endif
21+
if BUILD_TERM
22+
tests_unit_test_CPPFLAGS += -DWOLFSSH_TERM
23+
endif
2124
if BUILD_SHELL
2225
tests_unit_test_CPPFLAGS += -DWOLFSSH_SHELL
2326
endif
@@ -45,6 +48,9 @@ endif
4548
if BUILD_SFTP
4649
tests_api_test_CPPFLAGS += -DWOLFSSH_SFTP
4750
endif
51+
if BUILD_TERM
52+
tests_api_test_CPPFLAGS += -DWOLFSSH_TERM
53+
endif
4854
if BUILD_SHELL
4955
tests_api_test_CPPFLAGS += -DWOLFSSH_SHELL
5056
endif
@@ -77,6 +83,9 @@ endif
7783
if BUILD_SFTP
7884
tests_testsuite_test_CPPFLAGS += -DWOLFSSH_SFTP
7985
endif
86+
if BUILD_TERM
87+
tests_testsuite_test_CPPFLAGS += -DWOLFSSH_TERM
88+
endif
8089
if BUILD_SHELL
8190
tests_testsuite_test_CPPFLAGS += -DWOLFSSH_SHELL
8291
endif

0 commit comments

Comments
 (0)