diff options
author | jenkins4kodi <jenkins4kodi@users.noreply.github.com> | 2016-10-21 07:45:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-21 07:45:37 +0200 |
commit | d9c056a5711f405dadcba5312c73538d8bfde88e (patch) | |
tree | 9c4b1a4ddfb6d780d55f206a68f021bd2095d74c | |
parent | f2561a14671f521d51dd6194ab9611581e690081 (diff) | |
parent | 74eeff9b6d49f02a40c882def31a64fab08a6553 (diff) |
Merge pull request #10737 from Memphiz/nfs_context_counter
-rw-r--r-- | xbmc/filesystem/NFSFile.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/xbmc/filesystem/NFSFile.cpp b/xbmc/filesystem/NFSFile.cpp index c15fa65458..e359758aac 100644 --- a/xbmc/filesystem/NFSFile.cpp +++ b/xbmc/filesystem/NFSFile.cpp @@ -126,12 +126,13 @@ void CNfsConnection::clearMembers() // NOTE - DON'T CLEAR m_exportList HERE! // splitUrlIntoExportAndPath checks for m_exportList.empty() // and would query the server in an excessive unwanted fashion + // also don't clear m_KeepAliveTimeouts here because we + // would loose any "paused" file handles during export change m_exportPath.clear(); m_hostName.clear(); m_writeChunkSize = 0; m_readChunkSize = 0; m_pNfsContext = NULL; - m_KeepAliveTimeouts.clear(); } void CNfsConnection::destroyOpenContexts() @@ -346,6 +347,8 @@ void CNfsConnection::Deinit() m_pLibNfs->Unload(); } clearMembers(); + // clear any keep alive timouts on deinit + m_KeepAliveTimeouts.clear(); } /* This is called from CApplication::ProcessSlow() and is used to tell if nfs have been idle for too long */ @@ -402,7 +405,15 @@ void CNfsConnection::resetKeepAlive(std::string _exportPath, struct nfsfh *_pFi { CSingleLock lock(keepAliveLock); //refresh last access time of the context aswell - getContextFromMap(_exportPath, true); + struct nfs_context *pContext = getContextFromMap(_exportPath, true); + + // if we keep alive using m_pNfsContext we need to mark + // its last access time too here + if (m_pNfsContext == pContext) + { + m_lastAccessedTime = XbmcThreads::SystemClockMillis(); + } + //adds new keys - refreshs existing ones m_KeepAliveTimeouts[_pFileHandle].exportPath = _exportPath; m_KeepAliveTimeouts[_pFileHandle].refreshCounter = KEEP_ALIVE_TIMEOUT; |