DefaultXmppHandler base64Cert debug output messed up terminal display
suggest to remove that debug.
diff --git a/src/main/java/org/lantern/DefaultXmppHandler.java b/src/main/java/org/lantern/DefaultXmppHandler.java
index 6f50cf7..458462b 100644
--- a/src/main/java/org/lantern/DefaultXmppHandler.java
+++ b/src/main/java/org/lantern/DefaultXmppHandler.java
@@ -795,12 +795,10 @@ public class DefaultXmppHandler implements XmppHandler {
//final String mac = (String) msg.getProperty(P2PConstants.MAC);
final String base64Cert = (String) msg.getProperty(P2PConstants.CERT);
- LOG.debug("Base 64 cert: {}", base64Cert);
if (StringUtils.isNotBlank(base64Cert)) {
- LOG.trace("Got certificate for {}:\n{}", uri,
- new String(Base64.decodeBase64(base64Cert),
- LanternConstants.UTF8).replaceAll("\u0007", "[bell]")); // don't ring any bells
+ LOG.trace("Got certificate for {}: ", uri);
+ LOG.debug("Base 64 cert: {}", base64Cert);
// Add the peer if we're able to add the cert.
this.kscopeAdHandler.onBase64Cert(uri, base64Cert);
} else {
problem is String(Base64.decodeBase64(base64Cert), LanternConstants.UTF8).replaceAll("\u0007", "[bell]") it is converting base64 to binary.
It actually looks like it's converting to a utf-8 encoded string.
Did you see this causing a problem? If so, what did you observe?
yes, it could output terminal display control characters, which would messup all the ascii output after that. you will have to reset the terminal.
Gotcha. Let me see if I can find out why we're decoding it at all.