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

xcm_local_addr() and xcm_remote_addr() may fail to set errno #94

Open
m-ronnblom opened this issue Mar 25, 2024 · 0 comments
Open

xcm_local_addr() and xcm_remote_addr() may fail to set errno #94

m-ronnblom opened this issue Mar 25, 2024 · 0 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@m-ronnblom
Copy link
Collaborator

m-ronnblom commented Mar 25, 2024

Per the API documentation, xcm_local_addr() and xcm_remote_addr() should set errno.

In many cases in the actual implementation, where NULL is being returned, errno is not modified. This is true for all transports.

xcm_local_addr() and xcm_remote_addr() should probably be made to follow the API contract, and always set errno. In the case the error is recoverable, EAGAIN should probably be used. An alternative approach would be to just set errno to ENOENT in case the address is not available, regardless of reason. The address retrieval functions are not the proper means to discover bad connection state, so that's fine for a usability point of view.

The API documentation should make clear that failure to retrieve the local or remote address is not necessarily a terminal error (i.e., the address may be available on a later stage, e.g., after name resolution has finished).

@m-ronnblom m-ronnblom added bug Something isn't working documentation Improvements or additions to documentation labels Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant