Skip to content

Initialize the default telnet session exit action - #254

Open
dajiaohuang wants to merge 1 commit into
daniele77:masterfrom
dajiaohuang:fix/telnet-default-exit-20261016
Open

dajiaohuang wants to merge 1 commit into
daniele77:masterfrom
dajiaohuang:fix/telnet-default-exit-20261016

Conversation

@dajiaohuang

Copy link
Copy Markdown

Problem

Constructing a BoostAsioCliTelnetServer without calling server.ExitAction(...) permits normal commands but prevents exit from closing the session. The session's exit wrapper unconditionally invokes a copy of the server's empty std::function, throwing std::bad_function_call before Disconnect() and the global CLI exit action.

Change

Initialize the optional server exit action to a no-op, so the existing session exit sequence has a callable default. An explicitly supplied action still replaces it; no downstream checks or exception masking are added.

Validation

A real loopback-only TCP fixture uses the public server API with a synthetic addition command and a global CLI exit action that stops its scheduler. On master 769c5fa, addition succeeds but the process remains running after exit (bounded five-second wait, then only that child is terminated). With this change, the same client executes addition and exit, and the child terminates successfully. An explicit server exit callback was also exercised successfully.

Ubuntu 24.04 / GCC 13 / C++14 / Boost 1.83. Standalone Asio and the upstream platform matrix were not run locally; this does not claim authentication or whole-terminal control testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant