lib/nfs/Connection: create the nfs_context in the constructor
Another lifetime simplification.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user