aboutsummaryrefslogtreecommitdiff
path: root/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionOut.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionOut.java')
-rw-r--r--juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionOut.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionOut.java b/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionOut.java
index 7a6ae122..0111601e 100644
--- a/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionOut.java
+++ b/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionOut.java
@@ -61,7 +61,7 @@ public class ConnectionOut extends Connection implements Runnable {
@Override
public void run() {
- logger.info("STREAM TO {} START", to);
+ logger.info("stream to {} start", to);
try {
socket = new Socket();
socket.connect(DNSQueries.getServerAddress(to));
@@ -72,10 +72,10 @@ public class ConnectionOut extends Connection implements Runnable {
parser.next(); // stream:stream
streamID = parser.getAttributeValue(null, "id");
if (streamID == null || streamID.isEmpty()) {
- throw new Exception("STREAM TO " + to + " INVALID FIRST PACKET");
+ throw new Exception("stream to " + to + " invalid first packet");
}
- logger.info("STREAM TO {} {} OPEN", to, streamID);
+ logger.info("stream to {} {} open", to, streamID);
xmpp.addConnectionOut(ConnectionOut.this);
boolean xmppversionnew = parser.getAttributeValue(null, "version") != null;
if (!xmppversionnew) {
@@ -93,16 +93,16 @@ public class ConnectionOut extends Connection implements Runnable {
String type = parser.getAttributeValue(null, "type");
if (type != null && type.equals("valid")) {
streamReady = true;
- logger.info("STREAM TO {} {} READY", to, streamID);
+ logger.info("stream to {} {} ready", to, streamID);
String cache = xmpp.getFromCache(to);
if (cache != null) {
- logger.info("STREAM TO {} {} SENDING CACHE", to, streamID);
+ logger.info("stream to {} {} sending cache", to, streamID);
sendStanza(cache);
}
} else {
- logger.info("STREAM TO {} {} DIALBACK FAIL", to, streamID);
+ logger.info("stream to {} {} dialback fail", to, streamID);
}
XmlUtils.skip(parser);
} else if (tag.equals("verify") && parser.getNamespace().equals(NS_DB)) {
@@ -119,7 +119,7 @@ public class ConnectionOut extends Connection implements Runnable {
} else if (tag.equals("features") && parser.getNamespace().equals(NS_STREAM)) {
StreamFeatures features = StreamFeatures.parse(parser);
if (sc != null && !isSecured() && features.STARTTLS >= 0 && !xmpp.brokenSSLhosts.contains(to)) {
- logger.info("STREAM TO {} {} SECURING", to, streamID);
+ logger.info("stream to {} {} securing", to, streamID);
sendStanza("<starttls xmlns=\"" + NS_TLS + "\" />");
} else {
processDialback();
@@ -130,7 +130,7 @@ public class ConnectionOut extends Connection implements Runnable {
socket.getPort(), true);
((SSLSocket) socket).startHandshake();
setSecured(true);
- logger.info("STREAM {} SECURED", streamID);
+ logger.info("stream {} secured", streamID);
restartParser();
sendOpenStream();
} catch (SSLException sex) {
@@ -142,16 +142,16 @@ public class ConnectionOut extends Connection implements Runnable {
} else if (isSecured() && tag.equals("stream") && parser.getNamespace().equals(NS_STREAM)) {
streamID = parser.getAttributeValue(null, "id");
} else {
- if (logger.isInfoEnabled()) // prevent parseToString call if logger disabled
- logger.info("STREAM TO {} {} : {}", to, streamID, XmlUtils.parseToString(parser, true));
+ String unhandledStanza = XmlUtils.parseToString(parser, true);
+ logger.warn("Unhandled stanza from {} {} : {}", to, streamID, unhandledStanza);
}
}
- logger.warn("STREAM TO {} {} FINISHED", to, streamID);
+ logger.warn("stream to {} {} finished", to, streamID);
xmpp.removeConnectionOut(ConnectionOut.this);
closeConnection();
} catch (EOFException | SocketException eofex) {
- logger.info("STREAM {} {} CLOSED (dirty)", to, streamID);
+ logger.info("stream {} {} closed (dirty)", to, streamID);
xmpp.removeConnectionOut(ConnectionOut.this);
closeConnection();
} catch (Exception e) {
@@ -165,7 +165,7 @@ public class ConnectionOut extends Connection implements Runnable {
try {
sendStanza("<db:verify from='" + xmpp.HOSTNAME + "' to='" + to + "' id='" + sid + "'>" + key + "</db:verify>");
} catch (IOException e) {
- logger.warn("STREAM TO {} {} ERROR {}", to, streamID, e);
+ logger.warn("stream to {} {} error {}", to, streamID, e);
}
}
}