Skip to content

Fix handling of EAI_SYSTEM for getaddrinfo#10757

Merged
straight-shoota merged 4 commits intocrystal-lang:masterfrom
straight-shoota:fix/addrinfo-eai_system
Jun 8, 2021
Merged

Fix handling of EAI_SYSTEM for getaddrinfo#10757
straight-shoota merged 4 commits intocrystal-lang:masterfrom
straight-shoota:fix/addrinfo-eai_system

Conversation

@straight-shoota
Copy link
Member

When getaddrinfo returns EAI_SYSTEM, it describes a system error and the actual error value is to be retrieved from errno.

Ref: https://forum.crystal-lang.org/t/intermittent-dns-errors-inside-crystal/3326

When getaddrinfo returns EAI_SYSTEM, it describes a system error and the
actual error value is to be retrieved from errno.
@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:networking labels May 28, 2021
Copy link
Member

@asterite asterite left a comment

Choose a reason for hiding this comment

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

Thanks!

@straight-shoota straight-shoota added this to the 1.1.0 milestone May 29, 2021
@straight-shoota
Copy link
Member Author

Due to the refactoring of Addrinfo::Error in #10761, this patch needed to be adapted. At first, I changed it completely to act through overriding Error.from_os_error but I figured it's probably cleaner and easier to understand directly at the callsite, as before.

@straight-shoota straight-shoota merged commit 2f42b6b into crystal-lang:master Jun 8, 2021
@straight-shoota straight-shoota deleted the fix/addrinfo-eai_system branch June 8, 2021 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:networking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants