Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix getaddrinfo error reporting #278

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

Merged
merged 4 commits into from
Jan 19, 2023
Merged

Fix getaddrinfo error reporting #278

merged 4 commits into from
Jan 19, 2023

Conversation

nUl1
Copy link
Contributor

@nUl1 nUl1 commented Jan 5, 2023

getaddrinfo error reporting is currently broken on non-Windows platforms as only a subset of its errors are reported via errno.
(On Windows everything gets combined in WSAGetLastError() and gai_strerror is declared not thread-safe for some reason.)

@CLAassistant
Copy link

CLAassistant commented Jan 5, 2023

CLA assistant check
All committers have signed the CLA.

@@ -60,6 +60,18 @@ class windowsErrorCategory : public std::error_category {

#endif

#if defined(_unix_)

class getaddrinfoErrorCategory : public std::error_category {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have to make it part of the API, i.e. visible to the users? IMO it would be better to move declaration to .cpp

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's no requirement for it to be public. But users will have access to it through e.code().category() and nothing to compare it to.

@Enmk Enmk merged commit 5353131 into ClickHouse:master Jan 19, 2023
@nUl1 nUl1 deleted the fix-gaierror branch February 13, 2023 11:18
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.

3 participants