lib/nfs/Connection: move code to method InternalClose()
This commit is contained in:
@@ -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
|
void
|
||||||
NfsConnection::Close(struct nfsfh *fh)
|
NfsConnection::Close(struct nfsfh *fh)
|
||||||
{
|
{
|
||||||
assert(GetEventLoop().IsInside());
|
assert(GetEventLoop().IsInside());
|
||||||
|
|
||||||
nfs_close_async(context, fh, DummyCallback, nullptr);
|
InternalClose(fh);
|
||||||
ScheduleSocket();
|
ScheduleSocket();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -424,8 +434,7 @@ NfsConnection::OnSocketReady(unsigned flags)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (!deferred_close.empty()) {
|
while (!deferred_close.empty()) {
|
||||||
nfs_close_async(context, deferred_close.front(),
|
InternalClose(deferred_close.front());
|
||||||
DummyCallback, nullptr);
|
|
||||||
deferred_close.pop_front();
|
deferred_close.pop_front();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -186,6 +186,11 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void DestroyContext();
|
void DestroyContext();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper for nfs_close_async().
|
||||||
|
*/
|
||||||
|
void InternalClose(struct nfsfh *fh);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoke nfs_close_async() after nfs_service() returns.
|
* Invoke nfs_close_async() after nfs_service() returns.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user