Verifies the integrety of the projects, as builds are executed immediately after a code change was detected. This plan provides no artifiacts (use a nightly build instead).
OF-2786: Refactoring of DNS resolution utility classes
The implementation that is responsible for resolving an XMPP domain name in a set of socket addresses used a set of purpose-built utility classes. Over time, more and more were added, that each significantly overlapped.
This commit refactors these classes into two basic classes:
- `SrvRecord` - a (partial) representation of a DNS SRV lookup result that represents an _unresolved_ hostname for an XMPP service
- `ResolvedServiceAddress` - a representation of a result of resolving a SrvRecord into an IP address and port.
These replace most other classes, leaving most of them in deprecated state for backwards compatibility.
No major functional changes are intended to be introduced by this commit.
OF-2786: Group DNS SRV results by priority
In preparation of having concurrent TCP connection attempts, the targets to connect to are to be grouped by priority. This allows code to exhaust one group of addresses, before moving to the next group.
OF-2786: Add new IP resolved based on Happy Eyeballs
This introduces a new utility class that resolves hostnames into IP addresses, as defined by the Happy Eyeballs algorithm.
OF-2785: Happy Eyeballs: Have concurrent outbound connection attempts
When establishing an outbound S2S connection, Happy Eyeballs defines that concurrent connection attempts should be made, when the target domain advertises multiple server sockets (throught DNS SRV etc).
This change implements such concurrency. The first connection that is established will be returned, cancelling other scheduled attempts and aborting attempts that are inflight.
Note that this commit does _not_ address the issue where, when establishing an outbound connection, resolving the address to be used from the XMPP domain name results in a socket connection, that's then immediately closed only to be replaced by a new connection to the same address (OF-2721).
java.lang.AssertionError: After completing a test, the amount of remaining tasks cannot be negative (but was for index '0': -1).
at org.jivesoftware.openfire.net.HappyEyeballsResolver.getPreferredImmediately(HappyEyeballsResolver.java:153)
at org.jivesoftware.openfire.net.HappyEyeballsResolver.getNext(HappyEyeballsResolver.java:221)
at org.jivesoftware.openfire.net.HappyEyeballsResolverTest.testFirstResultWhenTwoHostsFourRecords(HappyEyeballsResolverTest.java:244)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
(118 more lines...)