Skip to content

Commit

Permalink
OF-2729: Admin console S2S 'family' should evaluate both in- and outb…
Browse files Browse the repository at this point in the history
…ound connections
  • Loading branch information
guusdk committed Nov 20, 2024
1 parent c9c923b commit b852afe
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions xmppserver/src/main/webapp/server-session-row.jspf
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,37 @@
<% } %>

<%
final boolean hasIPv4 = inSessions.stream().anyMatch(s-> {
final boolean hasInIPv4 = inSessions.stream().anyMatch(s-> {
try {
return InetAddress.getByName(s.getHostAddress()) instanceof Inet4Address;
} catch (UnknownHostException e) {
return false;
}
});
final boolean hasIPv6 = inSessions.stream().anyMatch(s-> {
final boolean hasOutIPv4 = outSessions.stream().anyMatch(s-> {
try {
return InetAddress.getByName(s.getHostAddress()) instanceof Inet4Address;
} catch (UnknownHostException e) {
return false;
}
});

final boolean hasInIPv6 = inSessions.stream().anyMatch(s-> {
try {
return InetAddress.getByName(s.getHostAddress()) instanceof Inet6Address;
} catch (UnknownHostException e) {
return false;
}
});
final boolean hasOutIPv6 = outSessions.stream().anyMatch(s-> {
try {
return InetAddress.getByName(s.getHostAddress()) instanceof Inet6Address;
} catch (UnknownHostException e) {
return false;
}
});
final boolean hasIPv4 = hasInIPv4 || hasOutIPv4;
final boolean hasIPv6 = hasInIPv6 || hasOutIPv6;
%>
<% if (hasIPv4 && hasIPv6) { %>
<td><fmt:message key="server.session.connection.both" /></td>
Expand Down

0 comments on commit b852afe

Please sign in to comment.