diff --git a/lix/libstore/legacy-ssh-store.cc b/lix/libstore/legacy-ssh-store.cc index 5a939f2a6..9e9ed2442 100644 --- a/lix/libstore/legacy-ssh-store.cc +++ b/lix/libstore/legacy-ssh-store.cc @@ -56,7 +56,7 @@ struct LegacySSHStore final : public Store struct Connection { - std::unique_ptr sshConn; + std::unique_ptr sshConn; FdSink to; FdSource from; ServeProto::Version remoteVersion; @@ -98,7 +98,7 @@ struct LegacySSHStore final : public Store ref> connections; - SSHMaster master; + SSH ssh; static std::set uriSchemes() { return {"ssh"}; } @@ -113,7 +113,7 @@ struct LegacySSHStore final : public Store [this]() { return openConnection(); }, [](const ref & r) { return r->good; } )) - , master( + , ssh( host, config_.port, config_.sshKey, @@ -126,7 +126,7 @@ struct LegacySSHStore final : public Store ref openConnection() { auto conn = make_ref(); - conn->sshConn = master.startCommand( + conn->sshConn = ssh.startCommand( fmt("%s --serve --write", config_.remoteProgram) + (config_.remoteStore.get() == "" ? "" diff --git a/lix/libstore/ssh-store.cc b/lix/libstore/ssh-store.cc index 0a3fa0706..208084473 100644 --- a/lix/libstore/ssh-store.cc +++ b/lix/libstore/ssh-store.cc @@ -37,7 +37,7 @@ public: , RemoteStore(config) , config_(std::move(config)) , host(host) - , master( + , ssh( host, config_.port, config_.sshKey, @@ -68,7 +68,7 @@ protected: struct Connection : RemoteStore::Connection { - std::unique_ptr sshConn; + std::unique_ptr sshConn; void closeWrite() override { @@ -80,7 +80,7 @@ protected: std::string host; - SSHMaster master; + SSH ssh; void setOptions(RemoteStore::Connection & conn) override { @@ -101,7 +101,7 @@ ref SSHStore::openConnection() if (config_.remoteStore.get() != "") command += " --store " + shellEscape(config_.remoteStore.get()); - conn->sshConn = master.startCommand(command); + conn->sshConn = ssh.startCommand(command); conn->to = FdSink(conn->sshConn->in.get()); conn->from = FdSource(conn->sshConn->out.get()); return conn; diff --git a/lix/libstore/ssh.cc b/lix/libstore/ssh.cc index 8311b2c8a..80c11aea7 100644 --- a/lix/libstore/ssh.cc +++ b/lix/libstore/ssh.cc @@ -8,7 +8,7 @@ namespace nix { -SSHMaster::SSHMaster(const std::string & host, const std::optional port, const std::string & keyFile, const std::string & sshPublicHostKey, bool compress, int logFD) +SSH::SSH(const std::string & host, const std::optional port, const std::string & keyFile, const std::string & sshPublicHostKey, bool compress, int logFD) : host(host) , port(port) , fakeSSH(host == "localhost") @@ -24,7 +24,7 @@ SSHMaster::SSHMaster(const std::string & host, const std::optional por state->tmpDir = std::make_unique(createTempDir("", "nix", true, true, 0700)); } -void SSHMaster::addCommonSSHOpts(Strings & args) +void SSH::addCommonSSHOpts(Strings & args) { auto state(state_.lock()); @@ -45,7 +45,7 @@ void SSHMaster::addCommonSSHOpts(Strings & args) args.push_back("-C"); } -std::unique_ptr SSHMaster::startCommand(const std::string & command) +std::unique_ptr SSH::startCommand(const std::string & command) { Pipe in, out; in.create(); diff --git a/lix/libstore/ssh.hh b/lix/libstore/ssh.hh index 31d6dd576..d8a42dd57 100644 --- a/lix/libstore/ssh.hh +++ b/lix/libstore/ssh.hh @@ -8,7 +8,7 @@ namespace nix { -class SSHMaster +class SSH { private: @@ -31,7 +31,7 @@ private: public: - SSHMaster(const std::string & host, const std::optional port, const std::string & keyFile, const std::string & sshPublicHostKey, bool compress, int logFD = -1); + SSH(const std::string & host, const std::optional port, const std::string & keyFile, const std::string & sshPublicHostKey, bool compress, int logFD = -1); struct Connection {