diff options
-rw-r--r-- | juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionIn.java | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionIn.java b/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionIn.java index ec996071..882cc2f7 100644 --- a/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionIn.java +++ b/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionIn.java @@ -72,6 +72,7 @@ public class ConnectionIn extends Connection implements Runnable { String to = parser.getAttributeValue(null, "to"); logger.info("stream from {} to {} {} asking for dialback", dfrom, to, streamID); if (dfrom.endsWith(xmpp.HOSTNAME) && (dfrom.equals(xmpp.HOSTNAME) || dfrom.endsWith("." + xmpp.HOSTNAME))) { + logger.warn("stream from {} is invalid", dfrom); break; } if (to != null && to.equals(xmpp.HOSTNAME)) { @@ -79,7 +80,8 @@ public class ConnectionIn extends Connection implements Runnable { updateTsRemoteData(); xmpp.startDialback(dfrom, streamID, dbKey); } else { - throw new HostUnknownException("stream from " + dfrom + " " + streamID + " invalid to " + to); + logger.warn("stream from " + dfrom + " " + streamID + " invalid to " + to); + break; } } else if (tag.equals("verify") && parser.getNamespace().equals(NS_DB)) { String vfrom = parser.getAttributeValue(null, "from"); @@ -149,8 +151,6 @@ public class ConnectionIn extends Connection implements Runnable { logger.info("stream {} closed (dirty)", streamID); xmpp.removeConnectionIn(this); closeConnection(); - } catch (HostUnknownException e) { - logger.warn(e.getMessage()); } catch (Exception e) { logger.warn("stream {} error {}", streamID, e); xmpp.removeConnectionIn(this); @@ -201,10 +201,4 @@ public class ConnectionIn extends Connection implements Runnable { } return false; } - - class HostUnknownException extends Exception { - public HostUnknownException(String message) { - super(message); - } - } } |