Skip to content

Migrate the remaining session options to LibSSH::Options - #17

Open
fmang wants to merge 2 commits into
masterfrom
options_full
Open

fmang wants to merge 2 commits into
masterfrom
options_full

Conversation

@fmang

@fmang fmang commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Follows #16.

Though the code is uninterestingly verbose, I am not fond of macros and
variadic functions would lose printf’s type checking.

This:

    session = LibSSH::Session.new
    session.host = "…"

Becomes:

    session = LibSSH::Session.new(host: "…")

Right now only host, port and user are migrated. I will add the other
options next. The proxy jump option will receive a LibSSH::Options,
turning libssh_ruby_options into a linked list.

The key function is libssh_ruby_apply_options, designed to be callable
from a libssh proxy jump callback which cannot use the Ruby API.
Though the code is uninterestingly verbose, I am not fond of macros and
variadic functions would lose printf’s type checking.
@fmang
fmang requested a review from fwininger September 15, 2026 05:43
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