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

feat(endpoint): add unix domain socket #127

Merged
merged 2 commits into from
Aug 23, 2023
Merged

Conversation

4kangjc
Copy link
Contributor

@4kangjc 4kangjc commented Aug 22, 2023

No description provided.

@@ -37,7 +38,9 @@ namespace flare {

namespace {

std::string SockAddrToString(const sockaddr* addr) {
constexpr auto offset_sun_path = offsetof(sockaddr_un, sun_path);
Copy link
Collaborator

Choose a reason for hiding this comment

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

kOffsetSunPath

@@ -369,6 +395,33 @@ std::optional<Endpoint> TryParseTraits<Endpoint>::TryParse(std::string_view s,
return er.Build();
}

// TODO(kangjinci): almost always succeeds, need to distinguish between ipv4 and
Copy link
Collaborator

Choose a reason for hiding this comment

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

这儿为啥涉及到ipv4/6呢

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ipv4和ipv6传进去应该失败?如果把这个加到TryParse(std::string_view s)里就要考虑了,比方192.0.0.1.2这种非法ip,传进去TryParse还是会成功

Copy link
Collaborator

Choose a reason for hiding this comment

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

明白了,这样确实不太好。那默认只解析v4/v6,然后支持手动传入from_unix来明确解析unix domain就可以了

@0x804d8000 0x804d8000 merged commit a8ad093 into Tencent:master Aug 23, 2023
7 of 8 checks passed
@0x804d8000
Copy link
Collaborator

Merged, thanks!

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.

2 participants