Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
Use ec.value() and add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tlehman committed Mar 1, 2024
1 parent 91dc9b4 commit 97a01f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions curl/src/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ namespace leatherman { namespace curl {
}

bool error_file_in_use(const boost::system::error_code& ec) {
bool same = (ec == boost::system::error_code(32, boost::system::system_category()));
bool same = (ec.value() == 32);
LOG_DEBUG("error_file_in_use({1}), same = {2}", ec, same);
return same;
}
Expand All @@ -153,7 +153,7 @@ namespace leatherman { namespace curl {
fs::rename(_temp_path, _file_path, ec);
wait_millis *= 2;
max_retries -= 1;
} while (max_retries > 0 && error_file_in_use(ec));
} while (error_file_in_use(ec) && max_retries > 0);
}


Expand All @@ -162,6 +162,7 @@ namespace leatherman { namespace curl {
close_fp();
boost::system::error_code ec;
fs::rename(_temp_path, _file_path, ec);
LOG_DEBUG("error_code = {1}", ec);
if (error_file_in_use(ec)) {
write_retry_with_exp_backoff(_temp_path, _file_path);
}
Expand Down

0 comments on commit 97a01f1

Please sign in to comment.