aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/nfs/Connection.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-14 15:38:09 +0100
committerMax Kellermann <max@duempel.org>2014-12-14 15:38:09 +0100
commit7fa1a84ec37ba6e891d2eb9d557cf3ddfb902023 (patch)
tree2709dad81558c4c2a85576bb05ac365b5c6b3876 /src/lib/nfs/Connection.cxx
parentab4bb26a0aeac99a7ea5aa9fdd93d379bf3c054d (diff)
downloadmpd-7fa1a84ec37ba6e891d2eb9d557cf3ddfb902023.tar.gz
mpd-7fa1a84ec37ba6e891d2eb9d557cf3ddfb902023.tar.xz
mpd-7fa1a84ec37ba6e891d2eb9d557cf3ddfb902023.zip
lib/nfs/Connection: move code to method InternalClose()
Diffstat (limited to 'src/lib/nfs/Connection.cxx')
-rw-r--r--src/lib/nfs/Connection.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/nfs/Connection.cxx b/src/lib/nfs/Connection.cxx
index c62b11acb..433d49ecf 100644
--- a/src/lib/nfs/Connection.cxx
+++ b/src/lib/nfs/Connection.cxx
@@ -331,12 +331,22 @@ DummyCallback(int, struct nfs_context *, void *, void *)
{
}
+inline void
+NfsConnection::InternalClose(struct nfsfh *fh)
+{
+ assert(GetEventLoop().IsInside());
+ assert(context != nullptr);
+ assert(fh != nullptr);
+
+ nfs_close_async(context, fh, DummyCallback, nullptr);
+}
+
void
NfsConnection::Close(struct nfsfh *fh)
{
assert(GetEventLoop().IsInside());
- nfs_close_async(context, fh, DummyCallback, nullptr);
+ InternalClose(fh);
ScheduleSocket();
}
@@ -424,8 +434,7 @@ NfsConnection::OnSocketReady(unsigned flags)
#endif
while (!deferred_close.empty()) {
- nfs_close_async(context, deferred_close.front(),
- DummyCallback, nullptr);
+ InternalClose(deferred_close.front());
deferred_close.pop_front();
}