Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[nfs] - we need to refresh the last accessed time of the used context…

… aswell when we reset the filehandle last accessed time. There was a race with PAPlayer where track1 was still opened and the context was nearly timed out - then track2 got opened shortly before track1 was closed and requested the context which was now timed out already - so the open of track2 destroyed the context and created a new one - now track1 was read again with the already destroyed context - booom.
  • Loading branch information...
commit afbae1102fca5ebb6261bc5811f3a8ce53bb48fa 1 parent 26e3185
@Memphiz Memphiz authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 xbmc/filesystem/NFSFile.cpp
View
5 xbmc/filesystem/NFSFile.cpp
@@ -155,7 +155,8 @@ struct nfs_context *CNfsConnection::getContextFromMap(const CStdString &exportna
//its not timedout yet or caller wants the cached entry regardless of timeout
//refresh access time of that
//context and return it
- CLog::Log(LOGDEBUG, "NFS: Refreshing context for %s, old: %"PRId64", new: %"PRId64, exportname.c_str(), it->second.lastAccessedTime, now);
+ if (!forceCacheHit) // only log it if this isn't the resetkeepalive on each read ;)
+ CLog::Log(LOGDEBUG, "NFS: Refreshing context for %s, old: %"PRId64", new: %"PRId64, exportname.c_str(), it->second.lastAccessedTime, now);
it->second.lastAccessedTime = now;
pRet = it->second.pContext;
}
@@ -369,6 +370,8 @@ void CNfsConnection::removeFromKeepAliveList(struct nfsfh *_pFileHandle)
void CNfsConnection::resetKeepAlive(std::string _exportPath, struct nfsfh *_pFileHandle)
{
CSingleLock lock(keepAliveLock);
+ //refresh last access time of the context aswell
+ getContextFromMap(_exportPath, true);
//adds new keys - refreshs existing ones
m_KeepAliveTimeouts[_pFileHandle].exportPath = _exportPath;
m_KeepAliveTimeouts[_pFileHandle].refreshCounter = KEEP_ALIVE_TIMEOUT;
Please sign in to comment.
Something went wrong with that request. Please try again.