aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/legacy-ssh-store.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-21 21:45:17 +0100
committereldritch horrors <pennae@lix.systems>2024-03-31 00:52:41 +0000
commitc777dcd1ae2f25db3d5c6e828178428f7d594583 (patch)
tree9534aa4ccdca06106fcfe5bcd4b75acb32c82ad1 /src/libstore/legacy-ssh-store.cc
parent0b6d3534741640419fa8489172d22e673fc018d7 (diff)
libstore: remove one Resource::good flag
usage of this flag previously kept connections open much longer than necessary, and at the same time obscured that a connection was being dropped when it *was* set. new variable names clarify this somewhat. Change-Id: I11f6f08f37a5e4dc04ea6c6036ea589154b121c6
Diffstat (limited to 'src/libstore/legacy-ssh-store.cc')
-rw-r--r--src/libstore/legacy-ssh-store.cc18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/libstore/legacy-ssh-store.cc b/src/libstore/legacy-ssh-store.cc
index 2d8667a85..e06d4e08d 100644
--- a/src/libstore/legacy-ssh-store.cc
+++ b/src/libstore/legacy-ssh-store.cc
@@ -46,7 +46,6 @@ struct LegacySSHStore : public virtual LegacySSHStoreConfig, public virtual Stor
FdSink to;
FdSource from;
ServeProto::Version remoteVersion;
- bool good = true;
/**
* Coercion to `ServeProto::ReadConn`. This makes it easy to use the
@@ -97,8 +96,7 @@ struct LegacySSHStore : public virtual LegacySSHStoreConfig, public virtual Stor
, host(host)
, connections(make_ref<Pool<Connection>>(
std::max(1, (int) maxConnections),
- [this]() { return openConnection(); },
- [](const ref<Connection> & r) { return r->good; }
+ [this]() { return openConnection(); }
))
, master(
host,
@@ -196,12 +194,7 @@ struct LegacySSHStore : public virtual LegacySSHStoreConfig, public virtual Stor
<< info.ultimate
<< info.sigs
<< renderContentAddress(info.ca);
- try {
- copyNAR(source, conn->to);
- } catch (...) {
- conn->good = false;
- throw;
- }
+ copyNAR(source, conn->to);
conn->to.flush();
} else {
@@ -209,12 +202,7 @@ struct LegacySSHStore : public virtual LegacySSHStoreConfig, public virtual Stor
conn->to
<< ServeProto::Command::ImportPaths
<< 1;
- try {
- copyNAR(source, conn->to);
- } catch (...) {
- conn->good = false;
- throw;
- }
+ copyNAR(source, conn->to);
conn->to
<< exportMagic
<< printStorePath(info.path);