lib/nfs/Connection: create the nfs_context in the constructor

Another lifetime simplification.
This commit is contained in:
Max Kellermann
2024-05-06 16:53:04 +02:00
parent 4139024b3d
commit d61c83ace8
8 changed files with 43 additions and 32 deletions

View File

@@ -141,7 +141,14 @@ private:
assert(state != State::READY);
assert(GetEventLoop().IsInside());
connection = &nfs_get_connection(server, export_name);
try {
connection = &nfs_get_connection(server, export_name);
} catch (...) {
SetState(State::DELAY, std::current_exception());
reconnect_timer.Schedule(std::chrono::minutes(10));
return;
}
connection->AddLease(*this);
SetState(State::CONNECTING);