Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework how curl errors are checked #1624

Merged
merged 2 commits into from
Apr 4, 2024
Merged

Conversation

bryteise
Copy link
Member

@bryteise bryteise commented Apr 4, 2024

In cases where curl perform returns an error but is actually a 400 level response, swupd needs to check curl info to see this. If the info reveals a 400 level response, return the corresponding download status error to prevent useless download retries.

bryteise added 2 commits April 4, 2024 11:41
In cases where curl perform returns an error but is actually a 400
level response, swupd needs to check curl info to see this. If the
info reveals a 400 level response, return the corresponding download
status error to prevent useless download retries.

Signed-off-by: William Douglas <[email protected]>
Signed-off-by: William Douglas <[email protected]>
@bryteise bryteise force-pushed the handle-400-perform-fails branch from 25cff6f to 4e53cc2 Compare April 4, 2024 18:42
@bryteise bryteise requested a review from bwarden April 4, 2024 18:56
@@ -456,6 +456,23 @@ enum download_status process_curl_error_codes(int curl_ret, CURL *curl_handle)
return DOWNLOAD_STATUS_ERROR;
}
} else { /* download failed but let our caller do it */
long response = 0;
curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &response);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine for now, but when we refactor, we should move this call before this if/else and figure out how to condense these conditions better.

@bryteise bryteise merged commit bf53867 into master Apr 4, 2024
30 checks passed
@bryteise bryteise deleted the handle-400-perform-fails branch April 4, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants