1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Allowing HTTP requests for source servers

This commit is contained in:
Brian Fiete 2019-09-20 09:19:38 -07:00
parent cb84684517
commit c2d086fe8e
7 changed files with 110 additions and 31 deletions

View file

@ -1616,6 +1616,42 @@ BF_EXPORT const char* BF_CALLTYPE Debugger_GetHotResolveData(uint8* outTypeData,
return outString.c_str();
}
BF_EXPORT NetResult* HTTP_GetFile(char* url, char* destPath)
{
AutoCrit autoCrit(gDebugManager->mNetManager->mThreadPool.mCritSect);
auto netResult = gDebugManager->mNetManager->QueueGet(url, destPath);
netResult->mDoneEvent = new SyncEvent();
return netResult;
}
BF_EXPORT int HTTP_GetResult(NetResult* netResult, int waitMS)
{
if (netResult->mDoneEvent->WaitFor(waitMS))
{
return netResult->mFailed ? 0 : 1;
}
else
{
return -1;
}
}
BF_EXPORT void HTTP_Delete(NetResult* netResult)
{
if (!netResult->mDoneEvent->WaitFor(0))
{
///
{
AutoCrit autoCrit(gDebugManager->mNetManager->mThreadPool.mCritSect);
if (netResult->mCurRequest != NULL)
netResult->mCurRequest->Cancel();
}
netResult->mDoneEvent->WaitFor(-1);
}
delete netResult;
}
BF_EXPORT void Debugger_SetAliasPath(char* origPath, char* localPath)
{
gDebugger->SetAliasPath(origPath, localPath);