From: Brian P. Hinz Date: Sat, 2 Nov 2019 18:26:47 +0000 (-0400) Subject: Using socket.getPeerName() causes DNS lookup and noticable UI stall X-Git-Tag: v1.10.90~98 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=65b21db9775228506c745ce93cc18aa0b1378da5;p=tigervnc.git Using socket.getPeerName() causes DNS lookup and noticable UI stall --- diff --git a/java/com/tigervnc/rfb/CSecurityTLS.java b/java/com/tigervnc/rfb/CSecurityTLS.java index 4524b1b7..ad6f6fe1 100644 --- a/java/com/tigervnc/rfb/CSecurityTLS.java +++ b/java/com/tigervnc/rfb/CSecurityTLS.java @@ -377,8 +377,7 @@ public class CSecurityTLS extends CSecurity { LdapName ln = new LdapName(dn); for (Rdn rdn : ln.getRdns()) { if (rdn.getType().equalsIgnoreCase("CN")) { - String peer = - ((CConn)client).getSocket().getPeerName().toLowerCase(); + String peer = client.getServerName().toLowerCase(); if (peer.equals(((String)rdn.getValue()).toLowerCase())) return; } @@ -388,8 +387,7 @@ public class CSecurityTLS extends CSecurity { while (i.hasNext()) { List nxt = (List)i.next(); if (((Integer)nxt.get(0)).intValue() == 2) { - String peer = - ((CConn)client).getSocket().getPeerName().toLowerCase(); + String peer = client.getServerName().toLowerCase(); if (peer.equals(((String)nxt.get(1)).toLowerCase())) return; } else if (((Integer)nxt.get(0)).intValue() == 7) {