1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-21 09:49:36 +01:00
This commit is contained in:
Eelco Dolstra 2016-11-09 18:57:22 +01:00
commit 4b8f1b0ec0
15 changed files with 465 additions and 91 deletions

View file

@ -18,7 +18,7 @@ template<typename T> class Pool;
/* FIXME: RemoteStore is a misnomer - should be something like
DaemonStore. */
class RemoteStore : public LocalFSStore
class RemoteStore : public virtual Store
{
public:
@ -26,8 +26,6 @@ public:
/* Implementations of abstract store API methods. */
std::string getUri() override;
bool isValidPathUncached(const Path & path) override;
PathSet queryValidPaths(const PathSet & paths) override;
@ -87,25 +85,46 @@ public:
void addSignatures(const Path & storePath, const StringSet & sigs) override;
private:
protected:
struct Connection
{
AutoCloseFD fd;
FdSink to;
FdSource from;
unsigned int daemonVersion;
~Connection();
virtual ~Connection();
void processStderr(Sink * sink = 0, Source * source = 0);
};
virtual ref<Connection> openConnection() = 0;
void initConnection(Connection & conn);
ref<Pool<Connection>> connections;
ref<Connection> openConnection();
private:
void setOptions(ref<Connection> conn);
void setOptions(Connection & conn);
};
class UDSRemoteStore : public LocalFSStore, public RemoteStore
{
public:
UDSRemoteStore(const Params & params, size_t maxConnections = std::numeric_limits<size_t>::max());
std::string getUri() override;
private:
struct Connection : RemoteStore::Connection
{
AutoCloseFD fd;
};
ref<RemoteStore::Connection> openConnection() override;
};