diff options
author | Max Kellermann <max@duempel.org> | 2014-11-25 13:27:06 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-11-25 13:27:06 +0100 |
commit | b293b160079fd19cfc675fa86c2b99695aac171f (patch) | |
tree | 04c59ef9cbb64b709fa74434cf5afa7534d1248d /src/lib | |
parent | f5f43db2da6bf0e5f39c8fb281ccca6e3dd8e65a (diff) | |
download | mpd-b293b160079fd19cfc675fa86c2b99695aac171f.tar.gz mpd-b293b160079fd19cfc675fa86c2b99695aac171f.tar.xz mpd-b293b160079fd19cfc675fa86c2b99695aac171f.zip |
lib/nfs/Connection: broadcast error before closing connection
During the NfsLease::OnNfsConnectionFailed() call, the old (defunct)
nfs_context may be used to close file handles. Such code does not yet
exist, but will be added soon to fix other bugs.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/nfs/Connection.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/nfs/Connection.cxx b/src/lib/nfs/Connection.cxx index c4612f613..06d2a4d2a 100644 --- a/src/lib/nfs/Connection.cxx +++ b/src/lib/nfs/Connection.cxx @@ -409,10 +409,10 @@ NfsConnection::OnSocketReady(unsigned flags) error.Format(nfs_domain, "NFS connection has failed: %s", nfs_get_error(context)); + BroadcastError(std::move(error)); + DestroyContext(); closed = true; - - BroadcastError(std::move(error)); } else if (SocketMonitor::IsDefined() && nfs_get_fd(context) < 0) { /* this happens when rpc_reconnect_requeue() is called after the connection broke, but autoreconnet was @@ -425,10 +425,10 @@ NfsConnection::OnSocketReady(unsigned flags) error.Format(nfs_domain, "NFS socket disappeared: %s", msg); + BroadcastError(std::move(error)); + DestroyContext(); closed = true; - - BroadcastError(std::move(error)); } assert(in_event); |