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

Make successful states coherent #3712

Merged

Conversation

meditans
Copy link
Member

The successful states used in these two places in the code were slightly
different. Should they be the same list?

The successful states used in these two places in the code were slightly
different. Should they be the same list?
@@ -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())
Copy link
Member

Choose a reason for hiding this comment

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

=> successfulStatuses.count(httpStatus)

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, fixed!

@@ -72,6 +72,8 @@ struct curlFileTransfer : public FileTransfer

curl_off_t writtenToSink = 0;

inline static const std::set<long> successfulStatuses;
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, fixed

@edolstra edolstra merged commit 3078404 into NixOS:master Jun 17, 2020
@Ericson2314
Copy link
Member

Thanks!

@Ericson2314 Ericson2314 deleted the make-http-successful-states-coherent branch June 17, 2020 17:41
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.

None yet

4 participants