diff options
author | Vitaly Takmazov | 2017-01-24 12:37:43 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-01-30 10:41:52 +0300 |
commit | 09ebad6b9dcb02fd35f15b02c4aa7da279d8f454 (patch) | |
tree | 594b8b902fb99e5066a55c39f57720e8e2518a22 | |
parent | 68a0e8f60cafd7bba03ff14fe6f5671855ffac72 (diff) |
juick-xmpp: refactoring
-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); - } - } } |