Skip to content

Commit

Permalink
fetch: Do not limit the number of returned payload paths
Browse files Browse the repository at this point in the history
  • Loading branch information
plexoos committed Aug 26, 2022
1 parent f2e34e7 commit 8aa9912
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/fetch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ void parse_response(const std::string& http_data, Result& result)
if (std::filesystem::exists(fullpath) || reqpars.cfg.db.dry_run)
{
result.paths.push_back(fullpath);
break;
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions test/test_xpload_rand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ int main(int argc, char *argv[])

int error_code = 0;

if (result.paths.size() != 1) {
cerr << "Error: Expected single payload but got " << result.paths.size() << " [" << __PRETTY_FUNCTION__ << "]\n";
if (result.paths.size() < 1) {
cerr << "Error: Expected at least one payload but got " << result.paths.size() << " [" << __PRETTY_FUNCTION__ << "]\n";
error_code = 1;
} else if ( result.paths[0].filename() != tk.payload) {
cerr << "Error: Expected " << tk.payload << " but got " << result.paths[0] << " [" << __PRETTY_FUNCTION__ << "]\n";
Expand All @@ -176,7 +176,7 @@ int main(int argc, char *argv[])
<< result.response_code << ", "
<< result.cache_size << ", "
<< result.total_retries << ", \""
<< (!error_code ? result.paths[0] : "") << "\", "
<< (!error_code ? result.payload : "") << "\", "
<< error_code << "\n";
}
}
Expand Down

0 comments on commit 8aa9912

Please sign in to comment.