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

XrdHttp: The deletion of a non-empty directory returns a 405 error code instead of 500 #2016

Merged

Conversation

ccaffy
Copy link
Contributor

@ccaffy ccaffy commented May 26, 2023

The mapping between errno error codes and XRoot protocol error code has also been changed. ENOTEMPTY is mapped to kXR_ItExists

@ccaffy ccaffy requested a review from abh3 May 26, 2023 07:08
// 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;
Copy link
Member

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.

Copy link
Contributor Author

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?

@abh3
Copy link
Member

abh3 commented May 27, 2023 via email

@ccaffy ccaffy force-pushed the 1896-webdav-method-delete-should-return-405 branch 2 times, most recently from e916f41 to 3b87b77 Compare May 30, 2023 07:42
abh3
abh3 previously requested changes May 30, 2023
Copy link
Member

@abh3 abh3 left a 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.

src/XProtocol/XProtocol.hh Outdated Show resolved Hide resolved
@ccaffy ccaffy force-pushed the 1896-webdav-method-delete-should-return-405 branch from 3b87b77 to a979cae Compare May 30, 2023 08:40
src/XProtocol/XProtocol.hh Outdated Show resolved Hide resolved
…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
@ccaffy ccaffy force-pushed the 1896-webdav-method-delete-should-return-405 branch from a979cae to ad9d26b Compare May 30, 2023 09:00
@abh3
Copy link
Member

abh3 commented May 30, 2023

I'll merge this in 12 hours or so once the CI completes. Thank you Cedric!

@ccaffy
Copy link
Contributor Author

ccaffy commented May 30, 2023

My pleasure :)

@amadio amadio dismissed abh3’s stale review May 30, 2023 09:20

All change requests have been addressed, merging.

@amadio amadio merged commit 6f591ad into xrootd:master May 30, 2023
14 checks passed
@amadio amadio added this to the 5.6 milestone May 30, 2023
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.

WebDAV method DELETE fails for non-empty directory, 500 response returned
3 participants