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

There are two contradictory declarations of addrinfo #624

Open
don-clugston-sociomantic opened this issue Aug 29, 2018 · 5 comments
Open
Labels
Milestone

Comments

@don-clugston-sociomantic
Copy link
Contributor

ocean.sys.socket.AddrInfo contains a struct addrinfo which is described as "Address information struct as returned by getaddrinfo().", and it contains an extern(C) declaration of getaddrinfo.

However, core.sys.posix.netdb also contains a struct addrinfo, and a declaration of getaddrinfo.

But, ocean.sys.socket.AddrInfo imports the enum values which getaddrinfo needs, from core.sys.posix.netinet.in_. So this module is not even consistent about whether it is using the druntime declarations, or not.

In D2, these structs are not identical. Mixing the two declararations works in D1, but it D2 it generates really weird error messages. Probably the socket.AddrInfo declaration of addrinfo should be replaced with a public import of the druntime declaration.

@mihails-strasuns
Copy link

@nemanja-boric-sociomantic @david-eckardt-sociomantic do you know anything about it?

@mihails-strasuns mihails-strasuns added this to the v4.2.8 milestone Aug 30, 2018
@nemanja-boric-sociomantic
Copy link
Contributor

@david-eckardt-sociomantic
Copy link
Contributor

This looks like my handwriting. I don't remember why I wrote it so I guess addrinfo and getaddrinfo were somehow missing in the runtime at this time.

@mihails-strasuns
Copy link

So, the problem here is that ocean definition does not exactly match druntime one - it has bunch of helper methods and defines error code and flag enums as named types, all that public and part of addrinfo struct. So switching to druntime version is actually a breaking change.

@mihails-strasuns
Copy link

tbh to me easiest fix would to deprecate whole module and provide ocean.sys.socket.AddrInfo2 instead which uses druntime version (and renaming back in next major).

@mihails-strasuns mihails-strasuns modified the milestones: v4.2.9, v4.2.10 Sep 24, 2018
@matthias-wende-sociomantic matthias-wende-sociomantic modified the milestones: v4.2.11, v4.2.12 Oct 24, 2018
@mihails-strasuns mihails-strasuns modified the milestones: v4.2.12, v4.3.8 Oct 26, 2018
@gavin-norman-sociomantic gavin-norman-sociomantic removed this from the v4.3.8 milestone Dec 11, 2018
@Geod24 Geod24 added this to the v6.0.0 milestone Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants