This repository has been archived by the owner on May 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Zee314159 <[email protected]>
- Loading branch information
Showing
3 changed files
with
1 addition
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ OSTreeObject::OSTreeObject(const OSTreeRepo &repo, const std::string &object_nam | |
refcount_(0), | ||
is_on_server_(PresenceOnServer::kObjectStateUnknown), | ||
curl_handle_(nullptr), | ||
form_post_(nullptr), | ||
headers_(nullptr) { | ||
if (!boost::filesystem::is_regular_file(file_path_)) { | ||
throw std::runtime_error(file_path_.native() + " is not a valid OSTree repo."); | ||
|
@@ -240,7 +239,7 @@ void OSTreeObject::Upload(const TreehubServer &push_target, CURLM *curl_multi_ha | |
FILE *fd; | ||
struct stat file_info {}; | ||
fd = fopen(file_path_.c_str(), "rb"); | ||
if (!fd) { | ||
if (fd == nullptr) { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
LOG_ERROR << "Could not open file: " << file_path_.c_str(); | ||
return; | ||
This comment has been minimized.
Sorry, something went wrong.
mike-sul
Collaborator
|
||
} else { | ||
|
@@ -330,8 +329,6 @@ void OSTreeObject::CurlDone(CURLM *curl_multi_handle, RequestPool &pool) { | |
} | ||
|
||
} else if (current_operation_ == CurrentOp::kOstreeObjectUploading) { | ||
curl_formfree(form_post_); | ||
form_post_ = nullptr; | ||
// Sanity-check the handle's URL to make sure it contains the expected | ||
// object hash. | ||
if (url == nullptr || strstr(url, object_name_.c_str()) == nullptr) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I am not sure if I see where this
fd
is closed in case if the file is successfully opened.