diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-10-16T21·36+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2018-10-16T21·36+0200 |
commit | 79e358ce6d2a2c34f365c24d68ddbab7461380f8 (patch) | |
tree | 62a7ca153cb1021bcebeb58776ceaacc3efc616e /src/libstore/remote-store.hh | |
parent | ba51100d64c18f627f97e606c4884ba2fb78dfa0 (diff) |
RemoteStore: Close connection if an exception occurs
Fixes #2075.
Diffstat (limited to 'src/libstore/remote-store.hh')
-rw-r--r-- | src/libstore/remote-store.hh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstore/remote-store.hh b/src/libstore/remote-store.hh index 9d768576bad8..7f9d7d1f56d6 100644 --- a/src/libstore/remote-store.hh +++ b/src/libstore/remote-store.hh @@ -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}; |