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

Should the response to a kXR_prepare request always be a null terminated string? #1888

Closed
murrayc3 opened this issue Jan 27, 2023 · 3 comments
Assignees
Labels
Documentation Issue Missing or incorrect documentation

Comments

@murrayc3
Copy link
Contributor

Dear XRootD experts,

The following web page documents the kXR_prepare request:

The documentation does not specify if the binary resp buffer returned by a normal response should contain a pure binary response or if it should always be a null terminated C-string.

The GFAL project and indirectly the FTS project have been effected by this ambiguity. When GFAL sends an kXR_prepare request to an EOSCTA storage end point it receives back a binary buffer of 45 bytes which consists of 44 printable characters followed by a null terminator. In other words EOSCTA returns a null terminated string. However when GFAL sends an kXR_prepare request to the dtn20.nese.rc.fas.harvard.edu:1094 storage end point it receives back a binary buffer of 36 bytes that contains 36 printable characters and NO null terminator.

If the response should always be a null terminated string then the GFAL project's code should be modified to fail the kXR_prepare request sent to dtn20.nese.rc.fas.harvard.edu:1094 due to an invalid response. Before this modification can be made we need the XRootD experts to answer the following question:

  • Should the response to a kXR_prepare request ALWAYS be a null terminated string?
@abh3 abh3 self-assigned this Jan 27, 2023
@abh3 abh3 added the Documentation Issue Missing or incorrect documentation label Jan 27, 2023
@abh3
Copy link
Member

abh3 commented Jan 30, 2023

Thanks for bringing this up. This is not the only place we have this ambiguity. Our general take is if we do not explicitly say x then you cannot assume x. Here, we normally say "One should neither assume the response is printable nor that it is null terminate; as the response is implementation dependent."

@murrayc3
Copy link
Contributor Author

Many thanks for the clarification. A test version of the XRootD client plugin for GFAL2 has been created that does not assume the value is null terminated.

@murrayc3
Copy link
Contributor Author

This ticket can be closed.

@abh3 abh3 closed this as completed Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issue Missing or incorrect documentation
Projects
None yet
Development

No branches or pull requests

2 participants