mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 15:32:43 +01:00
Create worker_proto::{Read,Write}Conn
Pass this around instead of `Source &` and `Sink &` directly. This will give us something to put the protocol version on once the time comes. To do this ergonomically, we need to expose `RemoteStore::Connection`, so do that too. Give it some more API docs while we are at it.
This commit is contained in:
parent
4e8b495ad7
commit
9f69b7dee9
16 changed files with 348 additions and 184 deletions
|
|
@ -166,21 +166,7 @@ public:
|
|||
|
||||
void flushBadConnections();
|
||||
|
||||
struct Connection
|
||||
{
|
||||
FdSink to;
|
||||
FdSource from;
|
||||
unsigned int daemonVersion;
|
||||
std::optional<TrustedFlag> remoteTrustsUs;
|
||||
std::optional<std::string> daemonNixVersion;
|
||||
std::chrono::time_point<std::chrono::steady_clock> startTime;
|
||||
|
||||
virtual ~Connection();
|
||||
|
||||
virtual void closeWrite() = 0;
|
||||
|
||||
std::exception_ptr processStderr(Sink * sink = 0, Source * source = 0, bool flush = true);
|
||||
};
|
||||
struct Connection;
|
||||
|
||||
ref<Connection> openConnectionWrapper();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue