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
Make successful states coherent #3712
Make successful states coherent #3712
Conversation
The successful states used in these two places in the code were slightly different. Should they be the same list?
src/libstore/filetransfer.cc
Outdated
@@ -352,8 +354,7 @@ struct curlFileTransfer : public FileTransfer | |||
if (writeException) | |||
failEx(writeException); | |||
|
|||
else if (code == CURLE_OK && | |||
(httpStatus == 200 || httpStatus == 201 || httpStatus == 204 || httpStatus == 206 || httpStatus == 304 || httpStatus == 0 /* other protocol */)) | |||
else if (code == CURLE_OK && successfulStatuses.find(httpStatus) != successfulStatuses.end()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=> successfulStatuses.count(httpStatus)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed!
src/libstore/filetransfer.cc
Outdated
@@ -72,6 +72,8 @@ struct curlFileTransfer : public FileTransfer | |||
|
|||
curl_off_t writtenToSink = 0; | |||
|
|||
inline static const std::set<long> successfulStatuses; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it lacks an initializer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed
Thanks! |
The successful states used in these two places in the code were slightly
different. Should they be the same list?