-
Notifications
You must be signed in to change notification settings - Fork 149
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
XrdHttp: The deletion of a non-empty directory returns a 405 error code instead of 500 #2016
XrdHttp: The deletion of a non-empty directory returns a 405 error code instead of 500 #2016
Conversation
src/XProtocol/XProtocol.hh
Outdated
// In the case one tries to delete a non-empty directory | ||
// we have decided that until the next major release | ||
// the kXR_ItExists flag will be returned | ||
case ENOTEMPTY: return kXR_ItExists; |
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.
What should happen here is that this case needs to be put ahead if the kXR_ItExists case as a falthrough. That is
using [[fallthrough]]; to indicate that the fallthrough is correct.
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.
I do not understand 🤔 Is it a fallthrough case? I just return kXR_ItExists when the errno code is ENOTEMPTY. Each switch case has a return value, so there's no need for a [[fallthrough]];
attribute, isn't it?
Yes, it's a fallthrough case which makes it much more obvious what is
happening. Don't forget to specify [[falthrough]]
…On Fri, 26 May 2023, ccaffy wrote:
@ccaffy commented on this pull request.
> @@ -1391,6 +1391,10 @@ static int mapError(int rc)
case ETIMEDOUT: return kXR_ReqTimedOut;
case EBADF: return kXR_FileNotOpen;
case ECANCELED: return kXR_Cancelled;
+ // In the case one tries to delete a non-empty directory
+ // we have decided that until the next major release
+ // the kXR_ItExists flag will be returned
+ case ENOTEMPTY: return kXR_ItExists;
I do not understand 🤔 Is it a fallthrough case? I just return kXR_ItExists when the errno code is ENOTEMPTY. Each switch case has a return value, so there's no need for a `[[fallthrough]];` attribute, isn't it?
--
Reply to this email directly or view it on GitHub:
#2016 (comment)
You are receiving this because your review was requested.
Message ID: ***@***.***>
|
e916f41
to
3b87b77
Compare
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.
I don't think I really explained myself here.
3b87b77
to
a979cae
Compare
…de instead of 500 The mapping between errno error codes and XRoot protocol error code has also been changed. ENOTEMPTY is mapped to kXR_ItExists
a979cae
to
ad9d26b
Compare
I'll merge this in 12 hours or so once the CI completes. Thank you Cedric! |
My pleasure :) |
All change requests have been addressed, merging.
The mapping between errno error codes and XRoot protocol error code has also been changed. ENOTEMPTY is mapped to kXR_ItExists