OF-2320: Restore ability to obtain MUC vcard
With the changes of OF-2289, the mutex value was expected to be a username. For MUC rooms, a bare JID is used. Using that as the node-part for a new JID causes problems.
OF-2283: Ensure that all IPs use the same hostname
Without this, various different hostnames would be used for the same IP address. Although technically not wrong, that's confusing, as it suggests that different servers are in play.
With this change, the same hostname is used for each occurrence of an IP address.
OF-2322: Ensure outgoing queue is emptied before routing newer stanzas
The existing code is based around a route of last resort, the
OutgoingSessionPromise, which builds a helper - the PacketsProcessor - and
creates the new session. The PacketsProcessors operate from within a thread
pool, and thus have contended execution time.
As new packets arrives from onward transmission during the session setup, the
PacketsProcessor queues them for retransmission. However, the act of session
creation also creates the outgoing route, meaning that later packets will
bypass the queue, and be transmitted out of order.
This should give the impression of a randomly reordered set of stanzas, but
would in fact be two consecutive sequences of ordered stanzas which are
interleaved, hence if the two sequences are A-E, F-J, one might see:
A, B, F, G, C, H, I, D, J, E
The fix here is two ensure that all packets are queued until the queue itself
is empty.
OF-2325: Prevent endless loop when peer closes during TLS handshake
When a peer closes the connection while performing an initial TLS handshake, a problem occurs if the state of the handshake remains 'not complete': the code in TLSStreamHandler#start() will loop until the handshake is complete. Subsequent iterations will read nothing, which repeats indefinitely. This can drain the available CPU resources.
Instead, throwing an exception will force the invoker to give up.