mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-08-10 00:52:16 +00:00
tests: add httpcommon tests and add new file_handler methods (#2712)
Co-authored-by: Mariotaku <mariotaku.lee@gmail.com>
This commit is contained in:
@@ -200,6 +200,14 @@ namespace http {
|
||||
BOOST_LOG(error) << "Couldn't create CURL instance";
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string file_dir = file_handler::get_parent_directory(file);
|
||||
if (!file_handler::make_directory(file_dir)) {
|
||||
BOOST_LOG(error) << "Couldn't create directory ["sv << file_dir << ']';
|
||||
curl_easy_cleanup(curl);
|
||||
return false;
|
||||
}
|
||||
|
||||
FILE *fp = fopen(file.c_str(), "wb");
|
||||
if (!fp) {
|
||||
BOOST_LOG(error) << "Couldn't open ["sv << file << ']';
|
||||
|
||||
Reference in New Issue
Block a user