mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-19 20:02:04 +08:00
f5e4867864
* refactor http download * use chunk_size instead of parts testcase:set chunksize to 5mb * use template space * cleanup * remove unused include * check buffer overfllow * simplify print download speed
14 lines
559 B
C++
14 lines
559 B
C++
#pragma once
|
|
|
|
#include <atomic>
|
|
#include <string>
|
|
|
|
std::string sha256(const std::string &str);
|
|
void precise_nano_sleep(long sleep_ns);
|
|
std::string decompressBZ2(const std::string &in);
|
|
void enableHttpLogging(bool enable);
|
|
std::string getUrlWithoutQuery(const std::string &url);
|
|
size_t getRemoteFileSize(const std::string &url);
|
|
std::string httpGet(const std::string &url, size_t chunk_size = 0, std::atomic<bool> *abort = nullptr);
|
|
bool httpDownload(const std::string &url, const std::string &file, size_t chunk_size = 0, std::atomic<bool> *abort = nullptr);
|