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

Compute LOC text representation without using floating point for latitude and longitude #15221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

omoerbeek
Copy link
Member

Fixes the cases mentioned in #10558, though there are still cases where there's no well defined canonical form, and the REST code just enforces it's own idea of what's THE canonical form.

Beware: this changes behaviour. Code submitting data to the REST interface might be surprised that previously accepted strings are no longer accepted (and vice versa).

Short description

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

@omoerbeek omoerbeek added the auth label Feb 26, 2025
Copy link
Contributor

@miodvallat miodvallat left a comment

Choose a reason for hiding this comment

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

Nice!

@coveralls
Copy link

coveralls commented Feb 26, 2025

Pull Request Test Coverage Report for Build 13552106748

Details

  • 39 of 39 (100.0%) changed or added relevant lines in 2 files are covered.
  • 49 unchanged lines in 12 files lost coverage.
  • Overall coverage decreased (-0.003%) to 64.487%

Files with Coverage Reduction New Missed Lines %
pdns/misc.cc 1 62.51%
pdns/pollmplexer.cc 1 83.66%
pdns/recursordist/aggressive_nsec.cc 2 65.8%
pdns/tcpiohandler.cc 2 68.18%
pdns/iputils.cc 3 56.99%
pdns/rcpgenerator.cc 3 90.1%
pdns/recursordist/recpacketcache.hh 3 89.55%
pdns/recursordist/test-syncres_cc2.cc 3 88.85%
pdns/packethandler.cc 5 73.18%
pdns/recursordist/test-syncres_cc1.cc 6 89.84%
Totals Coverage Status
Change from base Build 13540146528: -0.003%
Covered Lines: 127658
Relevant Lines: 166930

💛 - Coveralls

@peterthomassen
Copy link
Contributor

though there are still cases where there's no well defined canonical form, and the REST code just enforces it's own idea of what's THE canonical form

Can you elaborate what THE canonical form is, so we can adapt API clients accordingly?

@omoerbeek
Copy link
Member Author

though there are still cases where there's no well defined canonical form, and the REST code just enforces it's own idea of what's THE canonical form

Can you elaborate what THE canonical form is, so we can adapt API clients accordingly?

@omoerbeek omoerbeek closed this Feb 26, 2025
@omoerbeek omoerbeek reopened this Feb 26, 2025
@omoerbeek
Copy link
Member Author

though there are still cases where there's no well defined canonical form, and the REST code just enforces it's own idea of what's THE canonical form

Can you elaborate what THE canonical form is, so we can adapt API clients accordingly?

The canonical representation the pdns code uses with this PR is: all elements present (so no optional zero parts left out), no leading zeroes (except for the fractional second parts, which always uses three decimals) and the origin is 0 0 0.000 N 0 0 0.000 E. I did not study the altitude parts yet, but I'm pretty sure those parts aren't optional as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants