Skip to content

Commit

Permalink
Merge pull request #2613 from guusdk/OF-2729_Admin-console-redux
Browse files Browse the repository at this point in the history
OF-2729: Admin console S2S 'family' should evaluate both in- and outbound connections
  • Loading branch information
akrherz authored Nov 20, 2024
2 parents c9c923b + b852afe commit 6dfbcc2
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 6dfbcc2

Please sign in to comment.