Add TestServer.SSH#54
Open
richard-ash wants to merge 1 commit intorichard/refactor-http-websocketfrom
Open
Conversation
1f89cfb to
0fe9f1f
Compare
0fe9f1f to
3e767f0
Compare
danschultzer
reviewed
Apr 1, 2026
99e376d to
8798c67
Compare
danschultzer
reviewed
Apr 3, 2026
ab429b1 to
089dd44
Compare
48b96e7 to
65e2e94
Compare
eb5647e to
9f345f8
Compare
danschultzer
reviewed
Apr 6, 2026
a7c2b93 to
146a4c4
Compare
65e2e94 to
9be9f90
Compare
cc36c29 to
78b31c6
Compare
4a75c43 to
6831175
Compare
danschultzer
reviewed
Apr 9, 2026
lib/test_server/ssh/channel.ex
Outdated
Comment on lines
+22
to
+37
| def handle_ssh_msg({:ssh_cm, connection, inner}, state) do | ||
| acknowledge(connection, inner) | ||
|
|
||
| case maybe_dispatch(state, inner) do | ||
| {:ok, :ignore} -> | ||
| {:ok, state} | ||
|
|
||
| {:ok, reply} -> | ||
| send_reply(connection, state, reply) | ||
| finish(connection, inner, reply_opts(reply), state) | ||
|
|
||
| {:error, reason} -> | ||
| handle_dispatch_error(connection, state, inner, reason) | ||
| finish(connection, inner, [exit_status: 1], state) | ||
| end | ||
| end |
Owner
There was a problem hiding this comment.
It should dispatch before anything else because also the reply must be modifiable (you want to be able to control all messages):
Suggested change
| def handle_ssh_msg({:ssh_cm, connection, inner}, state) do | |
| acknowledge(connection, inner) | |
| case maybe_dispatch(state, inner) do | |
| {:ok, :ignore} -> | |
| {:ok, state} | |
| {:ok, reply} -> | |
| send_reply(connection, state, reply) | |
| finish(connection, inner, reply_opts(reply), state) | |
| {:error, reason} -> | |
| handle_dispatch_error(connection, state, inner, reason) | |
| finish(connection, inner, [exit_status: 1], state) | |
| end | |
| end | |
| def handle_ssh_msg({:ssh_cm, connection, frame}, state) do | |
| case dispatch(state, frame) do | |
| {:ok, :ignore} -> | |
| {:ok, state} | |
| {:ok, res} -> | |
| send_resp(res) | |
| {:error, reason} -> | |
| handle_error(reason) | |
| end | |
| end |
Co-Authored-By: Dan Schultzer <1254724+danschultzer@users.noreply.github.com>
6831175 to
dfab4ad
Compare
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.
No description provided.