Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unix socket support #183

Merged
merged 2 commits into from
Dec 11, 2019
Merged

unix socket support #183

merged 2 commits into from
Dec 11, 2019

Conversation

tdyas
Copy link
Contributor

@tdyas tdyas commented Dec 5, 2019

Allow debugger clients to connect to the in-process debug server over a UNIX domain socket instead of a local TCP socket which further ensures that only local processes may connect to the debug server.

  • This PR adds start_server_unix and start_control_unix variants of the start_server and start_control functions, respectively, which take a socket path instead of a host/port pair. These new methods are necessary in order for the PR to work with older versions of Ruby.

  • The tests have been refactored enough to allow testing both the TCP socket and UNIX domain socket variants with the same test code.

[See https://github.com//pull/166 for the original PR which can be closed.]

Pre 2.0 versions of Ruby cannot handle keyword arguments and thus the
introduction of a socket_path keyword argument, even if defaulted to
nil, will cause errors.

Solution: Add `start_server_unix` and `start_control_unix` functions
and then share implementation with the original methods by
refactoring the implementations into common methods.
@tdyas tdyas force-pushed the unix_socket_support branch 2 times, most recently from 92670e2 to 825ae23 Compare December 5, 2019 06:56
@ViugiNick ViugiNick merged commit 2e0607a into ruby-debug:master Dec 11, 2019
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.

2 participants