mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 23:10:32 +00:00
Fixed disconnect crash/loop
This commit is contained in:
parent
c7ccedb2f0
commit
34177b0420
1 changed files with 7 additions and 7 deletions
|
@ -681,7 +681,7 @@ U0 ANSIParse()
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 TerminalTask() {
|
U0 TerminalTask() {
|
||||||
while (!term.sock_ready) {
|
while (!term.sock_ready) {
|
||||||
Sleep(100); // Avoid busy waiting
|
Sleep(100); // Avoid busy waiting
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -907,16 +907,13 @@ init_connection:
|
||||||
case CH_BACKSPACE:
|
case CH_BACKSPACE:
|
||||||
if (term.sock_ready) TCPSocketSendString(term.sock, "\x08\x7F");
|
if (term.sock_ready) TCPSocketSendString(term.sock, "\x08\x7F");
|
||||||
break;
|
break;
|
||||||
case CH_ESC:
|
|
||||||
if (term.sock_ready) TCPSocketSendString(term.sock, "\x1B");
|
|
||||||
break;
|
|
||||||
case CH_SHIFT_ESC:
|
case CH_SHIFT_ESC:
|
||||||
if (term.sock_ready)
|
if (term.sock_ready)
|
||||||
{
|
{
|
||||||
if (term.sock_ready) TCPSocketClose(term.sock);
|
|
||||||
host = NULL;
|
|
||||||
term.sock_ready = 0;
|
|
||||||
term.waiting_for_input = TRUE;
|
term.waiting_for_input = TRUE;
|
||||||
|
term.sock_ready = 0;
|
||||||
|
host = NULL;
|
||||||
|
TCPSocketClose(term.sock);
|
||||||
DocClear;
|
DocClear;
|
||||||
"Telnet connection closed.\n";
|
"Telnet connection closed.\n";
|
||||||
Sleep(100);
|
Sleep(100);
|
||||||
|
@ -925,6 +922,9 @@ init_connection:
|
||||||
else
|
else
|
||||||
force_disconnect = TRUE;
|
force_disconnect = TRUE;
|
||||||
break;
|
break;
|
||||||
|
case CH_ESC:
|
||||||
|
if (term.sock_ready) TCPSocketSendString(term.sock, "\x1B");
|
||||||
|
break;
|
||||||
// send buffer on enter
|
// send buffer on enter
|
||||||
case '\n':
|
case '\n':
|
||||||
if (term.sock_ready) TCPSocketSendString(term.sock, "\r\n");
|
if (term.sock_ready) TCPSocketSendString(term.sock, "\r\n");
|
||||||
|
|
Loading…
Reference in a new issue