Repository navigation
Initialize the default telnet session exit action - #254
Open
dajiaohuang wants to merge 1 commit into
Open
dajiaohuang wants to merge 1 commit into
dajiaohuang wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Constructing a
BoostAsioCliTelnetServerwithout callingserver.ExitAction(...)permits normal commands but preventsexitfrom closing the session. The session's exit wrapper unconditionally invokes a copy of the server's emptystd::function, throwingstd::bad_function_callbeforeDisconnect()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 andexit, 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.