adding download helping function

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
TangoCash
2018-09-09 13:06:05 +02:00
committed by Thilo Graf
parent f72251dbb5
commit 1948302c72
2 changed files with 12 additions and 0 deletions

View File

@@ -1546,6 +1546,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)
{