shell: telnet: Disable echo

When telnet client queries about remote echo support, we reply that we
won't do it (which reduces the traffic), however the echo was not
actually disabled on the shell. In result characters were double-echoed
in the character mode (by both local echo from the client and remote
echo from the server).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2021-11-10 14:49:09 +01:00 committed by Christopher Friedt
commit 51dc4c3b1e

View file

@ -248,6 +248,8 @@ static void telnet_accept(struct net_context *client,
int error,
void *user_data)
{
int ret;
if (error) {
LOG_ERR("Error %d", error);
goto error;
@ -271,6 +273,14 @@ static void telnet_accept(struct net_context *client,
sh_telnet->client_ctx = client;
/* Disable echo - if command handling is enabled we reply that we don't
* support echo.
*/
ret = shell_echo_set(sh_telnet->shell_context, false);
if (ret < 0) {
LOG_ERR("Failed to disable echo, err: %d", ret);
}
return;
error:
net_context_put(client);