adding download helping function

Origin commit data
------------------
Commit: f474e60303
Author: TangoCash <eric@loxat.de>
Date: 2018-09-09 (Sun, 09 Sep 2018)
This commit is contained in:
TangoCash
2018-09-09 13:06:05 +02:00
committed by vanhofen
parent 4c589cdced
commit 5f47e7f784
2 changed files with 12 additions and 0 deletions

View File

@@ -1733,6 +1733,17 @@ std::string genTmpName(std::string suffix,unsigned int length)
return Str;
}
std::string dlTmpName(std::string url)
{
if (strstr(url.c_str(), "://"))
{
std::string tmpname = genTmpName(url.substr(url.find_last_of(".")+1),10);
if (downloadUrl(url,tmpname))
url = tmpname;
}
return url;
}
// curl
static void *myrealloc(void *ptr, size_t size)
{