mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-10-12 08:20:11 +00:00
Improvements for telnet server
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Check POLLHUP and POLLERR in telnet poll loop
to handle the remote end close correctly
Send "NVT"(network virtual terminal) as the default if getenv("TERM") return NULL
telnet should trigger the error handling if inet_pton return zero
since zero mean the string has format error
Don't return 1 in _environ_telnet to avoid trigger the compression
and remove the redundant TELNET_TELOPT_COMPRESS2 check
Change telnet_error_u to telnet_error_e required by the coding standard
Ensure telnet object get freed before the abnormal exit
This commit is contained in:
parent
43a36996ca
commit
bf3e6e2367
5 changed files with 82 additions and 60 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* apps/netutils/telnetc/telnetc.c
|
||||
* apps/include/netutils/telnetc.h
|
||||
*
|
||||
* Leveraged from libtelnet, https://github.com/seanmiddleditch/libtelnet.
|
||||
* Modified and re-released under the BSD license:
|
||||
|
|
@ -208,7 +208,7 @@ extern "C"
|
|||
|
||||
/* Error codes */
|
||||
|
||||
enum telnet_error_u
|
||||
enum telnet_error_e
|
||||
{
|
||||
TELNET_EOK = 0, /* No error */
|
||||
TELNET_EBADVAL, /* Invalid parameter, or API misuse */
|
||||
|
|
@ -284,7 +284,7 @@ union telnet_event_u
|
|||
const char *func; /* Function the error occured in */
|
||||
const char *msg; /* Error message string */
|
||||
int line; /* Line of file error occured on */
|
||||
enum telnet_error_u errcode; /* Error code */
|
||||
enum telnet_error_e errcode; /* Error code */
|
||||
} error;
|
||||
|
||||
/* Command event: for IAC */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue