forked from lix-project/lix
Revert "libstore: remove one Resource::good flag"
This reverts commit 87249eb579bf57f4f09e9fca100588a4d6b90b4c.
Change-Id: Ide4c6e00c4155216a17e46671ff47151d7bb85b4
This commit is contained in:
parent
ad30972867
commit
0b8a17cab6
|
@ -46,6 +46,7 @@ struct LegacySSHStore : public virtual LegacySSHStoreConfig, public virtual Stor
|
||||||
FdSink to;
|
FdSink to;
|
||||||
FdSource from;
|
FdSource from;
|
||||||
ServeProto::Version remoteVersion;
|
ServeProto::Version remoteVersion;
|
||||||
|
bool good = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Coercion to `ServeProto::ReadConn`. This makes it easy to use the
|
* Coercion to `ServeProto::ReadConn`. This makes it easy to use the
|
||||||
|
@ -96,7 +97,8 @@ struct LegacySSHStore : public virtual LegacySSHStoreConfig, public virtual Stor
|
||||||
, host(host)
|
, host(host)
|
||||||
, connections(make_ref<Pool<Connection>>(
|
, connections(make_ref<Pool<Connection>>(
|
||||||
std::max(1, (int) maxConnections),
|
std::max(1, (int) maxConnections),
|
||||||
[this]() { return openConnection(); }
|
[this]() { return openConnection(); },
|
||||||
|
[](const ref<Connection> & r) { return r->good; }
|
||||||
))
|
))
|
||||||
, master(
|
, master(
|
||||||
host,
|
host,
|
||||||
|
@ -194,7 +196,12 @@ struct LegacySSHStore : public virtual LegacySSHStoreConfig, public virtual Stor
|
||||||
<< info.ultimate
|
<< info.ultimate
|
||||||
<< info.sigs
|
<< info.sigs
|
||||||
<< renderContentAddress(info.ca);
|
<< renderContentAddress(info.ca);
|
||||||
copyNAR(source, conn->to);
|
try {
|
||||||
|
copyNAR(source, conn->to);
|
||||||
|
} catch (...) {
|
||||||
|
conn->good = false;
|
||||||
|
throw;
|
||||||
|
}
|
||||||
conn->to.flush();
|
conn->to.flush();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -202,7 +209,12 @@ struct LegacySSHStore : public virtual LegacySSHStoreConfig, public virtual Stor
|
||||||
conn->to
|
conn->to
|
||||||
<< ServeProto::Command::ImportPaths
|
<< ServeProto::Command::ImportPaths
|
||||||
<< 1;
|
<< 1;
|
||||||
copyNAR(source, conn->to);
|
try {
|
||||||
|
copyNAR(source, conn->to);
|
||||||
|
} catch (...) {
|
||||||
|
conn->good = false;
|
||||||
|
throw;
|
||||||
|
}
|
||||||
conn->to
|
conn->to
|
||||||
<< exportMagic
|
<< exportMagic
|
||||||
<< printStorePath(info.path);
|
<< printStorePath(info.path);
|
||||||
|
|
Loading…
Reference in a new issue