mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 18:31:22 +02:00
adding download helping function
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -1546,6 +1546,17 @@ std::string genTmpName(std::string suffix,unsigned int length)
|
|||||||
return Str;
|
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
|
// curl
|
||||||
static void *myrealloc(void *ptr, size_t size)
|
static void *myrealloc(void *ptr, size_t size)
|
||||||
{
|
{
|
||||||
|
@@ -160,6 +160,7 @@ std::string iso_8859_1_to_utf8(std::string &str);
|
|||||||
bool utf8_check_is_valid(const std::string &str);
|
bool utf8_check_is_valid(const std::string &str);
|
||||||
|
|
||||||
std::string genTmpName(std::string suffix,unsigned int length);
|
std::string genTmpName(std::string suffix,unsigned int length);
|
||||||
|
std::string dlTmpName(std::string url);
|
||||||
|
|
||||||
// curl
|
// curl
|
||||||
struct MemoryStruct {
|
struct MemoryStruct {
|
||||||
|
Reference in New Issue
Block a user