1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-27 12:41:00 +01:00

RemoteStore: Close connection if an exception occurs

Fixes #2075.
This commit is contained in:
Eelco Dolstra 2018-10-16 23:36:15 +02:00
parent ba51100d64
commit 79e358ce6d
3 changed files with 121 additions and 63 deletions

View file

@ -14,6 +14,7 @@ class Pid;
struct FdSink;
struct FdSource;
template<typename T> class Pool;
struct ConnectionHandle;
/* FIXME: RemoteStore is a misnomer - should be something like
@ -111,7 +112,7 @@ protected:
virtual ~Connection();
void processStderr(Sink * sink = 0, Source * source = 0);
std::exception_ptr processStderr(Sink * sink = 0, Source * source = 0);
};
ref<Connection> openConnectionWrapper();
@ -124,6 +125,10 @@ protected:
virtual void setOptions(Connection & conn);
ConnectionHandle getConnection();
friend class ConnectionHandle;
private:
std::atomic_bool failed{false};