1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Fixes to debugging source-server files

This commit is contained in:
Brian Fiete 2019-09-23 13:48:11 -07:00
parent aa313a1a9d
commit 6143c617b7
7 changed files with 29 additions and 19 deletions

View file

@ -111,7 +111,7 @@ bool DbgSymRequest::Get(const StringImpl& url, const StringImpl& destPath, NetRe
{
if (mIsPreCache)
{
auto netResult = mDbgSymSrv->mDebugger->mDebugManager->mNetManager->QueueGet(url, destPath);
auto netResult = mDbgSymSrv->mDebugger->mDebugManager->mNetManager->QueueGet(url, destPath, true);
if (chainNetResult != NULL)
{
if ((*chainNetResult != NULL) && (netResult != NULL))

View file

@ -1620,7 +1620,7 @@ BF_EXPORT NetResult* HTTP_GetFile(char* url, char* destPath)
{
AutoCrit autoCrit(gDebugManager->mNetManager->mThreadPool.mCritSect);
auto netResult = gDebugManager->mNetManager->QueueGet(url, destPath);
auto netResult = gDebugManager->mNetManager->QueueGet(url, destPath, false);
netResult->mDoneEvent = new SyncEvent();
return netResult;
}

View file

@ -447,7 +447,7 @@ NetManager::~NetManager()
}
}
NetRequest* NetManager::CreateGetRequest(const StringImpl& url, const StringImpl& destPath)
NetRequest* NetManager::CreateGetRequest(const StringImpl& url, const StringImpl& destPath, bool useCache)
{
AutoCrit autoCrit(mThreadPool.mCritSect);
@ -462,15 +462,18 @@ NetRequest* NetManager::CreateGetRequest(const StringImpl& url, const StringImpl
netResult->mFailed = false;
netResult->mCurRequest = netRequest;
NetResult** netResultPtr;
if (mCachedResults.TryAdd(url, NULL, &netResultPtr))
if (useCache)
{
*netResultPtr = netResult;
}
else
{
mOldResults.Add(*netResultPtr);
*netResultPtr = netResult;
NetResult** netResultPtr;
if (mCachedResults.TryAdd(url, NULL, &netResultPtr))
{
*netResultPtr = netResult;
}
else
{
mOldResults.Add(*netResultPtr);
*netResultPtr = netResult;
}
}
netRequest->mResult = netResult;
@ -478,11 +481,11 @@ NetRequest* NetManager::CreateGetRequest(const StringImpl& url, const StringImpl
return netRequest;
}
NetResult* NetManager::QueueGet(const StringImpl& url, const StringImpl& destPath)
NetResult* NetManager::QueueGet(const StringImpl& url, const StringImpl& destPath, bool useCache)
{
BfLogDbg("NetManager queueing %s\n", url.c_str());
BfLogDbg("NetManager queueing %s %d\n", url.c_str(), useCache);
auto netRequest = CreateGetRequest(url, destPath);
auto netRequest = CreateGetRequest(url, destPath, useCache);
auto netResult = netRequest->mResult;
mThreadPool.AddJob(netRequest);
return netResult;
@ -524,7 +527,7 @@ bool NetManager::Get(const StringImpl& url, const StringImpl& destPath)
}
else
{
netRequest = CreateGetRequest(url, destPath);
netRequest = CreateGetRequest(url, destPath, true);
break;
}
}

View file

@ -109,8 +109,8 @@ public:
NetManager();
~NetManager();
NetRequest* CreateGetRequest(const StringImpl& url, const StringImpl& destPath);
NetResult* QueueGet(const StringImpl& url, const StringImpl& destPath);
NetRequest* CreateGetRequest(const StringImpl& url, const StringImpl& destPath, bool useCache);
NetResult* QueueGet(const StringImpl& url, const StringImpl& destPath, bool useCache);
bool Get(const StringImpl& url, const StringImpl& destPath);
void CancelAll();